include $(PRODUCT).cfg

$(CONFIG_FILE): $(PRODUCT).cfg
	$(QUIET)rm $(CONFIG_FILE) -rf
	@echo "/* WARNING: Don't modify this file anywhere!!! */" >> $(CONFIG_FILE)
	@echo "#ifndef _CONFIG_H_" >> $(CONFIG_FILE)
	@echo "#define _CONFIG_H_" >> $(CONFIG_FILE)
	@echo "" >> $(CONFIG_FILE)

	@echo "#define PROGNAME \"$(PRODUCT)\"" >> $(CONFIG_FILE)

# debug开关
ifeq ($(CFG_DBG_ON), y)
	@echo "#define CFG_DBG_ON" >> $(CONFIG_FILE)
endif

# 设备类型定义
ifeq ($(CFG_DEV_TYPE_LAND_PD), y)
	@echo "#define CFG_DEV_TYPE_LAND_PD" >> $(CONFIG_FILE)
endif

ifeq ($(CFG_DEV_TYPE_LAND_CA), y)
	@echo "#define CFG_DEV_TYPE_LAND_CA" >> $(CONFIG_FILE)
endif

# 朗德GIS协议开关
ifeq ($(CFG_PROTO_GIS), y)
	@echo "#define CFG_PROTO_GIS" >> $(CONFIG_FILE)
endif

# 默认使能朗德GIS协议开关
ifeq ($(CFG_PROTO_GIS_DEFAULT), y)
	@echo "#define CFG_PROTO_GIS_DEFAULT" >> $(CONFIG_FILE)
endif

# MQTT 协议开关
ifeq ($(CFG_PROTO_MQTT), y)
	@echo "#define CFG_PROTO_MQTT" >> $(CONFIG_FILE)
endif

	@echo "" >> $(CONFIG_FILE)
	@echo "#include \"common.h\"" >> $(CONFIG_FILE)

	@echo "" >> $(CONFIG_FILE)
	@echo "#endif" >> $(CONFIG_FILE)
	@echo "/* WARNING: Don't modify this file anywhere!!! */" >> $(CONFIG_FILE)
	@echo "$(INFO_C)Create $@ done";echo

$(VERSION_FILE): $(PRODUCT).cfg