Makefile: Rules depend on their output directories

This commit is contained in:
Angus Gratton 2015-05-07 12:03:36 +10:00
parent de4855b86c
commit b50ba19b1f

View file

@ -95,7 +95,7 @@ endif
vpath %.c $(SRC_DIR) vpath %.c $(SRC_DIR)
define compile-objects define compile-objects
$1/%.o: %.c $1/%.o: %.c $1
$(vecho) "CC $$<" $(vecho) "CC $$<"
$(CC_ARGS) -c $$< -o $$@ $(CC_ARGS) -c $$< -o $$@
$(CC_ARGS) -MM -MT $$@ -MF $$(@:.o=.d) $$< $(CC_ARGS) -MM -MT $$@ -MF $$(@:.o=.d) $$<
@ -106,11 +106,11 @@ endef
all: checkdirs $(TARGET_OUT) $(FW_FILE_1) $(FW_FILE_2) all: checkdirs $(TARGET_OUT) $(FW_FILE_1) $(FW_FILE_2)
$(FW_FILE_1): $(TARGET_OUT) $(FW_FILE_1): $(TARGET_OUT) firmware
$(vecho) "FW $@" $(vecho) "FW $@"
$(ESPTOOL) elf2image $< -o $(FW_BASE)/ $(ESPTOOL) elf2image $< -o $(FW_BASE)/
$(FW_FILE_2): $(TARGET_OUT) $(FW_FILE_2): $(TARGET_OUT) firmware
$(vecho) "FW $@" $(vecho) "FW $@"
$(ESPTOOL) elf2image $< -o $(FW_BASE)/ $(ESPTOOL) elf2image $< -o $(FW_BASE)/