diff options
| author | Damien George | 2014-04-16 10:54:16 +0100 |
|---|---|---|
| committer | Damien George | 2014-04-16 10:54:16 +0100 |
| commit | bda2f709646f80dc82e52cd664d17cd41e8b2b6a (patch) | |
| tree | 98da1f4bedc61563c9abc905da6aa02467a61a7b /stmhal/Makefile | |
| parent | 8a919fb051361e422817491c56e9096143b5fe7d (diff) | |
| parent | 1452221aca8851df029702e8a71be339005bd5fd (diff) | |
Merge pull request #498 from lurch/create-headers-from-files
Auto-generate the stmhal/pybcdc_inf header file from static files
Diffstat (limited to 'stmhal/Makefile')
| -rw-r--r-- | stmhal/Makefile | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/stmhal/Makefile b/stmhal/Makefile index 978918994..f0d132520 100644 --- a/stmhal/Makefile +++ b/stmhal/Makefile @@ -210,6 +210,14 @@ PREFIX_FILE = boards/stm32f4xx-prefix.c GEN_PINS_SRC = $(BUILD)/pins_$(BOARD).c GEN_PINS_HDR = $(BUILD)/pins.h +INSERT_USB_IDS = ../tools/insert-usb-ids.py +FILE2H = ../tools/file2h.py + +USB_IDS_FILE = usbd_desc_cdc_msc.c +CDCINF_TEMPLATE = pybcdc.inf_template +GEN_CDCINF_FILE = $(BUILD)/pybcdc.inf +GEN_CDCINF_HEADER = $(BUILD)/pybcdc_inf.h + # Making OBJ use an order-only depenedency on the generated pins.h file # has the side effect of making the pins.h file before we actually compile # any of the objects. The normal dependency generation will deal with the @@ -217,6 +225,8 @@ GEN_PINS_HDR = $(BUILD)/pins.h # which source files might need it. $(OBJ): | $(BUILD)/pins.h +$(BUILD)/main.o: $(GEN_CDCINF_HEADER) + # Use a pattern rule here so that make will only call make-pins.py once to make # both pins_$(BOARD).c and pins.h $(BUILD)/%_$(BOARD).c $(BUILD)/%.h: boards/$(BOARD)/%.csv $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE) @@ -226,4 +236,12 @@ $(BUILD)/%_$(BOARD).c $(BUILD)/%.h: boards/$(BOARD)/%.csv $(MAKE_PINS) $(AF_FILE $(BUILD)/pins_$(BOARD).o: $(BUILD)/pins_$(BOARD).c $(call compile_c) +$(GEN_CDCINF_HEADER): $(GEN_CDCINF_FILE) $(FILE2H) + $(ECHO) "Create $@" + $(Q)$(PYTHON) $(FILE2H) $< > $@ + +$(GEN_CDCINF_FILE): $(CDCINF_TEMPLATE) $(INSERT_USB_IDS) $(USB_IDS_FILE) + $(ECHO) "Create $@" + $(Q)$(PYTHON) $(INSERT_USB_IDS) $(USB_IDS_FILE) $< > $@ + include ../py/mkrules.mk |
