-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcomponent.mk
More file actions
48 lines (33 loc) · 1.42 KB
/
component.mk
File metadata and controls
48 lines (33 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
COMPONENT_DEPENDS := JsonStreamingParser
COMPONENT_INCDIRS := src/include
COMPONENT_SRCDIRS := src src/Json
COMPONENT_DOXYGEN_INPUT := src/include
ifneq (,$(COMPONENT_RULE))
CONFIGDB_GEN_CMDLINE := $(PYTHON) $(COMPONENT_PATH)/tools/dbgen.py
COMPONENT_VARS := APP_CONFIGDB_DIR
APP_CONFIGDB_DIR := $(PROJECT_DIR)/out/ConfigDB
COMPONENT_INCDIRS += $(APP_CONFIGDB_DIR)
COMPONENT_APPCODE := $(APP_CONFIGDB_DIR)
COMPONENT_VARS += CONFIGDB_SCHEMA
CONFIGDB_SCHEMA := $(wildcard *.cfgdb)
CONFIGDB_JSON := $(patsubst %.cfgdb,$(APP_CONFIGDB_DIR)/schema/%.json,$(CONFIGDB_SCHEMA))
##@ConfigDB
.PHONY: configdb-preprocess
configdb-preprocess: ##Pre-process .cfgdb into .json
$(Q) $(CONFIGDB_GEN_CMDLINE) --preprocess --outdir $(APP_CONFIGDB_DIR) $(CONFIGDB_SCHEMA)
CONFIGDB_FILES := $(patsubst %.cfgdb,$(APP_CONFIGDB_DIR)/%.h,$(CONFIGDB_SCHEMA))
CONFIGDB_FILES := $(CONFIGDB_FILES) $(CONFIGDB_FILES:.h=.cpp)
COMPONENT_PREREQUISITES := configdb-preprocess $(CONFIGDB_FILES)
$(CONFIGDB_FILES): $(CONFIGDB_JSON)
$(MAKE) configdb-build
.PHONY: configdb-build
configdb-build: $(CONFIGDB_SCHEMA) ##Parse schema and generate source code
$(vecho) "CFGDB $^"
$(Q) $(CONFIGDB_GEN_CMDLINE) --outdir $(APP_CONFIGDB_DIR) $^
.PHONY: configdb-rebuild
configdb-rebuild: configdb-clean configdb-build ##Force regeneration of source code
.PHONY: configdb-clean
configdb-clean: ##Remove generated files
$(Q) rm -rf $(APP_CONFIGDB_DIR)/*
clean: configdb-clean
endif