diff --git a/workspace_tools/export/gcc_arm_disco_f051r8.tmpl b/workspace_tools/export/gcc_arm_disco_f051r8.tmpl index 1eb6d9a9b6..d21d82ab85 100644 --- a/workspace_tools/export/gcc_arm_disco_f051r8.tmpl +++ b/workspace_tools/export/gcc_arm_disco_f051r8.tmpl @@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size CPU = -mcpu=cortex-m0 -mthumb CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections +CC_FLAGS += -MMD -MP CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs @@ -37,7 +38,7 @@ endif all: $(PROJECT).bin $(PROJECT).hex size clean: - rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) + rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS) .s.o: $(AS) $(CPU) -o $@ $< @@ -65,3 +66,7 @@ lst: $(PROJECT).lst size: $(SIZE) $(PROJECT).elf + +DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) +-include $(DEPS) + diff --git a/workspace_tools/export/gcc_arm_disco_f100rb.tmpl b/workspace_tools/export/gcc_arm_disco_f100rb.tmpl index 3112e14c64..7c60dc514c 100644 --- a/workspace_tools/export/gcc_arm_disco_f100rb.tmpl +++ b/workspace_tools/export/gcc_arm_disco_f100rb.tmpl @@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size CPU = -mcpu=cortex-m3 -mthumb CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections +CC_FLAGS += -MMD -MP CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} LD_FLAGS = -mcpu=cortex-m3 -mthumb -Wl,--gc-sections --specs=nano.specs @@ -36,7 +37,7 @@ endif all: $(PROJECT).bin $(PROJECT).hex size clean: - rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) + rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS) .s.o: $(AS) $(CPU) -o $@ $< @@ -64,3 +65,7 @@ lst: $(PROJECT).lst size: $(SIZE) $(PROJECT).elf + +DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) +-include $(DEPS) + diff --git a/workspace_tools/export/gcc_arm_disco_f407vg.tmpl b/workspace_tools/export/gcc_arm_disco_f407vg.tmpl index dc0236cf49..9f9e8a4950 100644 --- a/workspace_tools/export/gcc_arm_disco_f407vg.tmpl +++ b/workspace_tools/export/gcc_arm_disco_f407vg.tmpl @@ -20,7 +20,8 @@ OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump SIZE = $(GCC_BIN)arm-none-eabi-size CPU = -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -CC_FLAGS = $(CPU) -c -g3 -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections +CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections +CC_FLAGS += -MMD -MP CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} LD_FLAGS = -mcpu=cortex-m4 -mthumb -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float @@ -36,7 +37,7 @@ endif all: $(PROJECT).bin $(PROJECT).hex size clean: - rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) + rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS) .s.o: $(AS) $(CPU) -o $@ $< @@ -64,3 +65,7 @@ lst: $(PROJECT).lst size: $(SIZE) $(PROJECT).elf + +DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) +-include $(DEPS) + diff --git a/workspace_tools/export/gcc_arm_lpc1114.tmpl b/workspace_tools/export/gcc_arm_lpc1114.tmpl index 4bbc5e1a0d..abdbbb11cb 100644 --- a/workspace_tools/export/gcc_arm_lpc1114.tmpl +++ b/workspace_tools/export/gcc_arm_lpc1114.tmpl @@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size CPU = -mcpu=cortex-m0 -mthumb CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections +CC_FLAGS += -MMD -MP CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs @@ -36,7 +37,7 @@ endif all: $(PROJECT).bin $(PROJECT).hex size clean: - rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) + rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS) .s.o: $(AS) $(CPU) -o $@ $< @@ -69,3 +70,7 @@ lst: $(PROJECT).lst size: $(SIZE) $(PROJECT).elf + +DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) +-include $(DEPS) + diff --git a/workspace_tools/export/gcc_arm_lpc11u35_401.tmpl b/workspace_tools/export/gcc_arm_lpc11u35_401.tmpl index 4bbc5e1a0d..abdbbb11cb 100644 --- a/workspace_tools/export/gcc_arm_lpc11u35_401.tmpl +++ b/workspace_tools/export/gcc_arm_lpc11u35_401.tmpl @@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size CPU = -mcpu=cortex-m0 -mthumb CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections +CC_FLAGS += -MMD -MP CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs @@ -36,7 +37,7 @@ endif all: $(PROJECT).bin $(PROJECT).hex size clean: - rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) + rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS) .s.o: $(AS) $(CPU) -o $@ $< @@ -69,3 +70,7 @@ lst: $(PROJECT).lst size: $(SIZE) $(PROJECT).elf + +DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) +-include $(DEPS) + diff --git a/workspace_tools/export/gcc_arm_lpc11u35_501.tmpl b/workspace_tools/export/gcc_arm_lpc11u35_501.tmpl index 4bbc5e1a0d..abdbbb11cb 100644 --- a/workspace_tools/export/gcc_arm_lpc11u35_501.tmpl +++ b/workspace_tools/export/gcc_arm_lpc11u35_501.tmpl @@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size CPU = -mcpu=cortex-m0 -mthumb CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections +CC_FLAGS += -MMD -MP CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs @@ -36,7 +37,7 @@ endif all: $(PROJECT).bin $(PROJECT).hex size clean: - rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) + rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS) .s.o: $(AS) $(CPU) -o $@ $< @@ -69,3 +70,7 @@ lst: $(PROJECT).lst size: $(SIZE) $(PROJECT).elf + +DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) +-include $(DEPS) + diff --git a/workspace_tools/export/gcc_arm_lpc1768.tmpl b/workspace_tools/export/gcc_arm_lpc1768.tmpl index 5d38d5a164..aa3bfdab4b 100644 --- a/workspace_tools/export/gcc_arm_lpc1768.tmpl +++ b/workspace_tools/export/gcc_arm_lpc1768.tmpl @@ -19,6 +19,7 @@ OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy CPU = -mcpu=cortex-m3 -mthumb CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections +CC_FLAGS += -MMD -MP CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} LD_FLAGS = -mcpu=cortex-m3 -mthumb -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float @@ -33,7 +34,7 @@ endif all: $(PROJECT).bin clean: - rm -f $(PROJECT).bin $(PROJECT).elf $(OBJECTS) + rm -f $(PROJECT).bin $(PROJECT).elf $(OBJECTS) $(DEPS) .s.o: $(AS) $(CPU) -o $@ $< @@ -50,3 +51,7 @@ $(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) $(PROJECT).bin: $(PROJECT).elf $(OBJCOPY) -O binary $< $@ + +DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) +-include $(DEPS) +