Skip to content

Commit 8a97a64

Browse files
committed
Merge pull request #238 from dinau/make_depend
[GCC_ARM]: Added checking dependency
2 parents 3dd4af0 + 016e9b7 commit 8a97a64

File tree

7 files changed

+43
-8
lines changed

7 files changed

+43
-8
lines changed

workspace_tools/export/gcc_arm_disco_f051r8.tmpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size
2121

2222
CPU = -mcpu=cortex-m0 -mthumb
2323
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
24+
CC_FLAGS += -MMD -MP
2425
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
2526

2627
LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs
@@ -37,7 +38,7 @@ endif
3738
all: $(PROJECT).bin $(PROJECT).hex size
3839

3940
clean:
40-
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS)
41+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
4142

4243
.s.o:
4344
$(AS) $(CPU) -o $@ $<
@@ -65,3 +66,7 @@ lst: $(PROJECT).lst
6566

6667
size:
6768
$(SIZE) $(PROJECT).elf
69+
70+
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
71+
-include $(DEPS)
72+

workspace_tools/export/gcc_arm_disco_f100rb.tmpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size
2121

2222
CPU = -mcpu=cortex-m3 -mthumb
2323
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
24+
CC_FLAGS += -MMD -MP
2425
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
2526

2627
LD_FLAGS = -mcpu=cortex-m3 -mthumb -Wl,--gc-sections --specs=nano.specs
@@ -36,7 +37,7 @@ endif
3637
all: $(PROJECT).bin $(PROJECT).hex size
3738

3839
clean:
39-
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS)
40+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
4041

4142
.s.o:
4243
$(AS) $(CPU) -o $@ $<
@@ -64,3 +65,7 @@ lst: $(PROJECT).lst
6465

6566
size:
6667
$(SIZE) $(PROJECT).elf
68+
69+
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
70+
-include $(DEPS)
71+

workspace_tools/export/gcc_arm_disco_f407vg.tmpl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
2020
SIZE = $(GCC_BIN)arm-none-eabi-size
2121

2222
CPU = -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp
23-
CC_FLAGS = $(CPU) -c -g3 -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
23+
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
24+
CC_FLAGS += -MMD -MP
2425
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
2526

2627
LD_FLAGS = -mcpu=cortex-m4 -mthumb -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float
@@ -36,7 +37,7 @@ endif
3637
all: $(PROJECT).bin $(PROJECT).hex size
3738

3839
clean:
39-
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS)
40+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
4041

4142
.s.o:
4243
$(AS) $(CPU) -o $@ $<
@@ -64,3 +65,7 @@ lst: $(PROJECT).lst
6465

6566
size:
6667
$(SIZE) $(PROJECT).elf
68+
69+
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
70+
-include $(DEPS)
71+

workspace_tools/export/gcc_arm_lpc1114.tmpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size
2121

2222
CPU = -mcpu=cortex-m0 -mthumb
2323
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
24+
CC_FLAGS += -MMD -MP
2425
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
2526

2627
LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs
@@ -36,7 +37,7 @@ endif
3637
all: $(PROJECT).bin $(PROJECT).hex size
3738

3839
clean:
39-
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS)
40+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
4041

4142
.s.o:
4243
$(AS) $(CPU) -o $@ $<
@@ -69,3 +70,7 @@ lst: $(PROJECT).lst
6970

7071
size:
7172
$(SIZE) $(PROJECT).elf
73+
74+
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
75+
-include $(DEPS)
76+

workspace_tools/export/gcc_arm_lpc11u35_401.tmpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size
2121

2222
CPU = -mcpu=cortex-m0 -mthumb
2323
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
24+
CC_FLAGS += -MMD -MP
2425
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
2526

2627
LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs
@@ -36,7 +37,7 @@ endif
3637
all: $(PROJECT).bin $(PROJECT).hex size
3738

3839
clean:
39-
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS)
40+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
4041

4142
.s.o:
4243
$(AS) $(CPU) -o $@ $<
@@ -69,3 +70,7 @@ lst: $(PROJECT).lst
6970

7071
size:
7172
$(SIZE) $(PROJECT).elf
73+
74+
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
75+
-include $(DEPS)
76+

workspace_tools/export/gcc_arm_lpc11u35_501.tmpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SIZE = $(GCC_BIN)arm-none-eabi-size
2121

2222
CPU = -mcpu=cortex-m0 -mthumb
2323
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
24+
CC_FLAGS += -MMD -MP
2425
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
2526

2627
LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs
@@ -36,7 +37,7 @@ endif
3637
all: $(PROJECT).bin $(PROJECT).hex size
3738

3839
clean:
39-
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS)
40+
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
4041

4142
.s.o:
4243
$(AS) $(CPU) -o $@ $<
@@ -69,3 +70,7 @@ lst: $(PROJECT).lst
6970

7071
size:
7172
$(SIZE) $(PROJECT).elf
73+
74+
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
75+
-include $(DEPS)
76+

workspace_tools/export/gcc_arm_lpc1768.tmpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
1919

2020
CPU = -mcpu=cortex-m3 -mthumb
2121
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
22+
CC_FLAGS += -MMD -MP
2223
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
2324

2425
LD_FLAGS = -mcpu=cortex-m3 -mthumb -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float
@@ -33,7 +34,7 @@ endif
3334
all: $(PROJECT).bin
3435

3536
clean:
36-
rm -f $(PROJECT).bin $(PROJECT).elf $(OBJECTS)
37+
rm -f $(PROJECT).bin $(PROJECT).elf $(OBJECTS) $(DEPS)
3738

3839
.s.o:
3940
$(AS) $(CPU) -o $@ $<
@@ -50,3 +51,7 @@ $(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
5051

5152
$(PROJECT).bin: $(PROJECT).elf
5253
$(OBJCOPY) -O binary $< $@
54+
55+
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
56+
-include $(DEPS)
57+

0 commit comments

Comments
 (0)