Skip to content

Commit 2eda513

Browse files
jimmodpgeorge
authored andcommitted
py/mkrules.mk: Add rule for compiling auto-generated source files.
This prevents each port Makefile from having to add an explicit rule for `build-BOARD/pins_BOARD.c`. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <[email protected]>
1 parent aa329d1 commit 2eda513

File tree

7 files changed

+4
-18
lines changed

7 files changed

+4
-18
lines changed

ports/cc3200/application.mk

-3
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,3 @@ $(OBJ): | $(GEN_PINS_HDR)
241241
$(GEN_PINS_SRC) $(GEN_PINS_HDR) $(GEN_PINS_QSTR): $(BOARD_PINS) $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE) | $(HEADER_BUILD)
242242
$(ECHO) "Create $@"
243243
$(Q)$(PYTHON) $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) --qstr $(GEN_PINS_QSTR) > $(GEN_PINS_SRC)
244-
245-
$(BUILD)/pins.o: $(BUILD)/pins.c
246-
$(call compile_c)

ports/mimxrt/Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,4 @@ $(BUILD)/%_gen.c $(HEADER_BUILD)/%.h: $(BOARD_PINS) $(MAKE_PINS) $(AF_FILE) $(PR
510510
--iomux $(abspath $(TOP)/$(MCU_DIR)/drivers/fsl_iomuxc.h) \
511511
--prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) > $(GEN_PINS_SRC)
512512

513-
$(GEN_PINS_SRC:.c=.o): $(GEN_PINS_SRC)
514-
$(call compile_c)
515-
516513
include $(TOP)/py/mkrules.mk

ports/nrf/Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,6 @@ $(BUILD)/%_gen.c $(HEADER_BUILD)/%.h $(HEADER_BUILD)/%_af_const.h $(BUILD)/%_qst
547547
$(ECHO) "Create $@"
548548
$(Q)$(PYTHON) $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) --qstr $(GEN_PINS_QSTR) --af-const $(GEN_PINS_AF_CONST) --af-py $(GEN_PINS_AF_PY) > $(GEN_PINS_SRC)
549549

550-
$(GEN_PINS_SRC:.c=.o): $(GEN_PINS_SRC)
551-
$(call compile_c)
552-
553550
$(PY_BUILD)/nlr%.o: CFLAGS += -Os -fno-lto
554551

555552
include ../../py/mkrules.mk

ports/renesas-ra/Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,6 @@ $(BUILD)/%_$(BOARD).c $(HEADER_BUILD)/%.h $(HEADER_BUILD)/%_af_const.h $(HEADER_
586586
$(ECHO) "GEN $@"
587587
$(Q)$(PYTHON) $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) --qstr $(GEN_PINS_QSTR) --ad-const $(GEN_PINS_AD_CONST) --af-const $(GEN_PINS_AF_CONST) --af-py $(GEN_PINS_AF_PY) > $(GEN_PINS_SRC)
588588

589-
#$(BUILD)/pins_$(BOARD).o: $(BUILD)/pins_$(BOARD).c
590-
# $(call compile_c)
591-
592589
CMSIS_MCU_HDR = $(CMSIS_DIR)/$(CMSIS_MCU_LOWER).h
593590

594591
include $(TOP)/py/mkrules.mk

ports/stm32/Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,6 @@ $(BUILD)/%_$(BOARD).c $(HEADER_BUILD)/%.h $(HEADER_BUILD)/%_af_const.h $(HEADER_
684684
--af-defs $(GEN_PINS_AF_DEFS) --af-defs-cmp-strings \
685685
--af-py $(GEN_PINS_AF_PY) > $(GEN_PINS_SRC)
686686

687-
$(GEN_PINS_SRC:.c=.o): $(GEN_PINS_SRC)
688-
$(call compile_c)
689-
690687
modmachine.c: $(GEN_PLLFREQTABLE_HDR)
691688
$(GEN_PLLFREQTABLE_HDR): $(PLLVALUES) | $(HEADER_BUILD)
692689
$(ECHO) "GEN $@"

py/mkrules.mk

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ $(BUILD)/%.pp: %.c
9797
$(ECHO) "PreProcess $<"
9898
$(Q)$(CPP) $(CFLAGS) -Wp,-C,-dD,-dI -o $@ $<
9999

100+
# Special case for compiling auto-generated source files.
101+
$(BUILD)/%.o: $(BUILD)/%.c
102+
$(call compile_c)
103+
100104
# The following rule uses | to create an order only prerequisite. Order only
101105
# prerequisites only get built if they don't exist. They don't cause timestamp
102106
# checking to be performed.

shared/memzip/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ OBJ += $(BUILD)/memzip-files.o
1818
1919
MAKE_MEMZIP = ../shared/memzip/make-memzip.py
2020
21-
$(BUILD)/memzip-files.o: $(BUILD)/memzip-files.c
22-
$(call compile_c)
23-
2421
$(BUILD)/memzip-files.c: $(shell find ${MEMZIP_DIR} -type f)
2522
@$(ECHO) "Creating $@"
2623
$(Q)$(PYTHON) $(MAKE_MEMZIP) --zip-file $(BUILD)/memzip-files.zip --c-file $@ $(MEMZIP_DIR)

0 commit comments

Comments
 (0)