diff --git a/Target/Demo/ARMCM0_STM32F0_Discovery_STM32F051_GCC/Boot/makefile b/Target/Demo/ARMCM0_STM32F0_Discovery_STM32F051_GCC/Boot/makefile index 8b8be313..7d58155d 100644 --- a/Target/Demo/ARMCM0_STM32F0_Discovery_STM32F051_GCC/Boot/makefile +++ b/Target/Demo/ARMCM0_STM32F0_Discovery_STM32F051_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_stm32f051 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -105,6 +105,7 @@ STACK_SIZE = 0x0100 STDFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DSTM32F051x8 -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -112,7 +113,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f051r8_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f051r8_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -139,7 +140,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -155,13 +155,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -172,9 +172,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM0_STM32F0_Discovery_STM32F051_GCC/Prog/makefile b/Target/Demo/ARMCM0_STM32F0_Discovery_STM32F051_GCC/Prog/makefile index 9033da26..ab7626ae 100644 --- a/Target/Demo/ARMCM0_STM32F0_Discovery_STM32F051_GCC/Prog/makefile +++ b/Target/Demo/ARMCM0_STM32F0_Discovery_STM32F051_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32f051 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -95,6 +95,7 @@ STACK_SIZE = 0x0100 STDFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DSTM32F051x8 -DUSE_HAL_DRIVER CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -102,7 +103,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f051r8_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f051r8_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -129,7 +130,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -145,13 +145,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -162,9 +162,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM0_STM32F0_Nucleo_F091RC_GCC/Boot/makefile b/Target/Demo/ARMCM0_STM32F0_Nucleo_F091RC_GCC/Boot/makefile index 92b8151f..34ed40b3 100644 --- a/Target/Demo/ARMCM0_STM32F0_Nucleo_F091RC_GCC/Boot/makefile +++ b/Target/Demo/ARMCM0_STM32F0_Nucleo_F091RC_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_stm32f091 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -105,6 +105,7 @@ STACK_SIZE = 0x0100 STDFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -O2 +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DSTM32F091xC -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -112,7 +113,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f091rc_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f091rc_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -139,7 +140,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -155,13 +155,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -172,9 +172,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM0_STM32F0_Nucleo_F091RC_GCC/Prog/makefile b/Target/Demo/ARMCM0_STM32F0_Nucleo_F091RC_GCC/Prog/makefile index 0a9b3191..438e813a 100644 --- a/Target/Demo/ARMCM0_STM32F0_Nucleo_F091RC_GCC/Prog/makefile +++ b/Target/Demo/ARMCM0_STM32F0_Nucleo_F091RC_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32f091 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -95,6 +95,7 @@ STACK_SIZE = 0x0100 STDFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -O1 +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DSTM32F091xC -DUSE_HAL_DRIVER CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -102,7 +103,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f091rc_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f091rc_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -129,7 +130,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -145,13 +145,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -162,9 +162,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM0_STM32G0_Nucleo_G071RB_GCC/Boot/makefile b/Target/Demo/ARMCM0_STM32G0_Nucleo_G071RB_GCC/Boot/makefile index 28bf130c..d851b778 100644 --- a/Target/Demo/ARMCM0_STM32G0_Nucleo_G071RB_GCC/Boot/makefile +++ b/Target/Demo/ARMCM0_STM32G0_Nucleo_G071RB_GCC/Boot/makefile @@ -85,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -104,12 +103,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m0plus -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -O2 +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DSTM32G071xx -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32G071RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32G071RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -136,7 +136,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -152,13 +151,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -169,9 +168,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM0_STM32G0_Nucleo_G071RB_GCC/Prog/makefile b/Target/Demo/ARMCM0_STM32G0_Nucleo_G071RB_GCC/Prog/makefile index d8575d23..93686650 100644 --- a/Target/Demo/ARMCM0_STM32G0_Nucleo_G071RB_GCC/Prog/makefile +++ b/Target/Demo/ARMCM0_STM32G0_Nucleo_G071RB_GCC/Prog/makefile @@ -75,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -94,12 +93,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m0plus -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -O1 +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DSTM32G071xx -DUSE_HAL_DRIVER CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32G071RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32G071RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -126,7 +126,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -142,13 +141,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -159,9 +158,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM0_STM32G0_Nucleo_G0B1RE_GCC/Boot/makefile b/Target/Demo/ARMCM0_STM32G0_Nucleo_G0B1RE_GCC/Boot/makefile index 0d6048b4..1a767b44 100644 --- a/Target/Demo/ARMCM0_STM32G0_Nucleo_G0B1RE_GCC/Boot/makefile +++ b/Target/Demo/ARMCM0_STM32G0_Nucleo_G0B1RE_GCC/Boot/makefile @@ -85,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -104,12 +103,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m0plus -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Os +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DSTM32G0B1xx -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32G0B1RETx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32G0B1RETx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -136,7 +136,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -152,13 +151,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -169,9 +168,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM0_STM32G0_Nucleo_G0B1RE_GCC/Prog/makefile b/Target/Demo/ARMCM0_STM32G0_Nucleo_G0B1RE_GCC/Prog/makefile index cc3ff034..808ca0e3 100644 --- a/Target/Demo/ARMCM0_STM32G0_Nucleo_G0B1RE_GCC/Prog/makefile +++ b/Target/Demo/ARMCM0_STM32G0_Nucleo_G0B1RE_GCC/Prog/makefile @@ -75,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -94,12 +93,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m0plus -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DSTM32G0B1xx -DUSE_HAL_DRIVER CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32G0B1RETx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32G0B1RETx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -126,7 +126,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -142,13 +141,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -159,9 +158,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM33_STM32L5_Nucleo_L552ZE_GCC/Boot/makefile b/Target/Demo/ARMCM33_STM32L5_Nucleo_L552ZE_GCC/Boot/makefile index c8205a6c..92d8991e 100644 --- a/Target/Demo/ARMCM33_STM32L5_Nucleo_L552ZE_GCC/Boot/makefile +++ b/Target/Demo/ARMCM33_STM32L5_Nucleo_L552ZE_GCC/Boot/makefile @@ -85,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -104,12 +103,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m33 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32L552xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32L552xE_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32L552xE_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -136,7 +136,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -152,13 +151,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -169,9 +168,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM33_STM32L5_Nucleo_L552ZE_GCC/Prog/makefile b/Target/Demo/ARMCM33_STM32L5_Nucleo_L552ZE_GCC/Prog/makefile index 44b55afa..3df18894 100644 --- a/Target/Demo/ARMCM33_STM32L5_Nucleo_L552ZE_GCC/Prog/makefile +++ b/Target/Demo/ARMCM33_STM32L5_Nucleo_L552ZE_GCC/Prog/makefile @@ -75,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -94,12 +93,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m33 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32L552xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32L552xE_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32L552xE_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -126,7 +126,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -142,13 +141,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -159,9 +158,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_EFM32_Olimex_EM32G880F128STK_GCC/Boot/makefile b/Target/Demo/ARMCM3_EFM32_Olimex_EM32G880F128STK_GCC/Boot/makefile index f6427431..1770f8f0 100644 --- a/Target/Demo/ARMCM3_EFM32_Olimex_EM32G880F128STK_GCC/Boot/makefile +++ b/Target/Demo/ARMCM3_EFM32_Olimex_EM32G880F128STK_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_olimex_efm32g880 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -103,12 +103,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 -Wno-maybe-uninitialized OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DEFM32G880F128 CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O binary ODFLAGS = -x @@ -135,7 +136,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).bin - $(BIN_PATH)/$(PROJ_NAME).bin : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -151,13 +151,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -168,9 +168,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).bin @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_EFM32_Olimex_EM32G880F128STK_GCC/Prog/makefile b/Target/Demo/ARMCM3_EFM32_Olimex_EM32G880F128STK_GCC/Prog/makefile index ab844d2a..ec34f3fa 100644 --- a/Target/Demo/ARMCM3_EFM32_Olimex_EM32G880F128STK_GCC/Prog/makefile +++ b/Target/Demo/ARMCM3_EFM32_Olimex_EM32G880F128STK_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_olimex_efm32g880 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -93,12 +93,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 -Wno-maybe-uninitialized OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DEFM32G880F128 CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -125,7 +126,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -141,13 +141,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -158,9 +158,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_GCC/Boot/makefile b/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_GCC/Boot/makefile index ab092afa..872d2a8a 100644 --- a/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_GCC/Boot/makefile +++ b/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_ek_lm3s6965 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -109,7 +110,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -130,12 +130,13 @@ STDFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -Wno-unused-but-set-variable -Wno-maybe-uninitialized STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DDEBUG -Dgcc CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O binary ODFLAGS = -x @@ -162,7 +163,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).bin - $(BIN_PATH)/$(PROJ_NAME).bin : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -178,13 +178,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -195,9 +195,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).bin @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_GCC/Prog/makefile b/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_GCC/Prog/makefile index a7003f35..fae50eac 100644 --- a/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_GCC/Prog/makefile +++ b/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_ek_lm3s6965 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -95,7 +96,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -116,12 +116,13 @@ STDFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -Wno-unused-but-set-variable -Wno-maybe-uninitialized STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DDEBUG -Dgcc CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -148,7 +149,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -164,13 +164,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -181,9 +181,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_GCC/Boot/makefile b/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_GCC/Boot/makefile index 392f6761..e6b6350c 100644 --- a/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_GCC/Boot/makefile +++ b/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_ek_lm3s8962 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -105,12 +105,13 @@ STDFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -Wno-unused-but-set-variable STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DDEBUG -Dgcc CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O binary ODFLAGS = -x @@ -137,7 +138,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).bin - $(BIN_PATH)/$(PROJ_NAME).bin : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -153,13 +153,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -170,9 +170,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).bin @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_GCC/Prog/makefile b/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_GCC/Prog/makefile index 7b11724a..23049bb7 100644 --- a/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_GCC/Prog/makefile +++ b/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_ek_lm3s8962 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -95,12 +95,13 @@ STDFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -Wno-unused-but-set-variable STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DDEBUG -Dgcc CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"memory.x" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -127,7 +128,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -143,13 +143,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -160,9 +160,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F1_Nucleo_F103RB_GCC/Boot/makefile b/Target/Demo/ARMCM3_STM32F1_Nucleo_F103RB_GCC/Boot/makefile index f7b32438..74c06fcc 100644 --- a/Target/Demo/ARMCM3_STM32F1_Nucleo_F103RB_GCC/Boot/makefile +++ b/Target/Demo/ARMCM3_STM32F1_Nucleo_F103RB_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_nucleo_stm32f103rb # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -103,13 +103,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -std=gnu11 -fstack-usage -Wall -specs=nano.specs STDFLAGS += -fdata-sections -ffunction-sections -Wall -g -Wno-strict-aliasing OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32F103xB CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -136,7 +137,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -152,13 +152,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -169,9 +169,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F1_Nucleo_F103RB_GCC/Prog/makefile b/Target/Demo/ARMCM3_STM32F1_Nucleo_F103RB_GCC/Prog/makefile index 70dd7f2c..5d79b0ec 100644 --- a/Target/Demo/ARMCM3_STM32F1_Nucleo_F103RB_GCC/Prog/makefile +++ b/Target/Demo/ARMCM3_STM32F1_Nucleo_F103RB_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_nucleo_stm32f103rb # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -93,13 +93,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -std=gnu11 -fstack-usage -Wall -specs=nano.specs STDFLAGS += -fdata-sections -ffunction-sections -Wall -g -Wno-strict-aliasing OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F103xB CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -126,7 +127,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -142,13 +142,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -159,9 +159,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F1_Olimex_STM32H103_GCC/Boot/makefile b/Target/Demo/ARMCM3_STM32F1_Olimex_STM32H103_GCC/Boot/makefile index f279b3f0..d9c30909 100644 --- a/Target/Demo/ARMCM3_STM32F1_Olimex_STM32H103_GCC/Boot/makefile +++ b/Target/Demo/ARMCM3_STM32F1_Olimex_STM32H103_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_olimex_stm32h103 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -103,13 +103,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -std=gnu11 -fstack-usage -Wall -specs=nano.specs STDFLAGS += -fdata-sections -ffunction-sections -Wall -g -Wno-strict-aliasing OPTFLAGS = -O2 +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32F103xB CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -136,7 +137,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -152,13 +152,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -169,9 +169,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F1_Olimex_STM32H103_GCC/Prog/makefile b/Target/Demo/ARMCM3_STM32F1_Olimex_STM32H103_GCC/Prog/makefile index 3f5c015a..47a36082 100644 --- a/Target/Demo/ARMCM3_STM32F1_Olimex_STM32H103_GCC/Prog/makefile +++ b/Target/Demo/ARMCM3_STM32F1_Olimex_STM32H103_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_olimex_stm32h103 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -93,13 +93,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -std=gnu11 -fstack-usage -Wall -specs=nano.specs STDFLAGS += -fdata-sections -ffunction-sections -Wall -g -Wno-strict-aliasing OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F103xB CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -126,7 +127,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -142,13 +142,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -159,9 +159,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F1_Olimex_STM32P103_GCC/Boot/makefile b/Target/Demo/ARMCM3_STM32F1_Olimex_STM32P103_GCC/Boot/makefile index 19c913e4..b281b3ca 100644 --- a/Target/Demo/ARMCM3_STM32F1_Olimex_STM32P103_GCC/Boot/makefile +++ b/Target/Demo/ARMCM3_STM32F1_Olimex_STM32P103_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_olimex_stm32p103 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -88,7 +89,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -107,13 +107,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -std=gnu11 -fstack-usage -Wall -specs=nano.specs STDFLAGS += -fdata-sections -ffunction-sections -Wall -g -Wno-strict-aliasing OPTFLAGS = -O2 +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32F103xB CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -140,7 +141,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -156,13 +156,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -173,9 +173,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F1_Olimex_STM32P103_GCC/Prog/makefile b/Target/Demo/ARMCM3_STM32F1_Olimex_STM32P103_GCC/Prog/makefile index c2771212..ff680679 100644 --- a/Target/Demo/ARMCM3_STM32F1_Olimex_STM32P103_GCC/Prog/makefile +++ b/Target/Demo/ARMCM3_STM32F1_Olimex_STM32P103_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_olimex_stm32p103 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -93,13 +93,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -std=gnu11 -fstack-usage -Wall -specs=nano.specs STDFLAGS += -fdata-sections -ffunction-sections -Wall -g -Wno-strict-aliasing OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F103xB CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -126,7 +127,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -142,13 +142,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -159,9 +159,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F1_Olimexino_STM32_GCC/Boot/makefile b/Target/Demo/ARMCM3_STM32F1_Olimexino_STM32_GCC/Boot/makefile index 0a1ffb78..c98e115f 100644 --- a/Target/Demo/ARMCM3_STM32F1_Olimexino_STM32_GCC/Boot/makefile +++ b/Target/Demo/ARMCM3_STM32F1_Olimexino_STM32_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_olimexino_stm32 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -88,7 +89,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -107,13 +107,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -std=gnu11 -fstack-usage -Wall -specs=nano.specs STDFLAGS += -fdata-sections -ffunction-sections -Wall -g -Wno-strict-aliasing OPTFLAGS = -O2 +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32F103xB CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -140,7 +141,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -156,13 +156,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -173,9 +173,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F1_Olimexino_STM32_GCC/Prog/makefile b/Target/Demo/ARMCM3_STM32F1_Olimexino_STM32_GCC/Prog/makefile index a08524e8..c8c553ed 100644 --- a/Target/Demo/ARMCM3_STM32F1_Olimexino_STM32_GCC/Prog/makefile +++ b/Target/Demo/ARMCM3_STM32F1_Olimexino_STM32_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_olimexino_stm32 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -93,13 +93,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m3 -mthumb -std=gnu11 -fstack-usage -Wall -specs=nano.specs STDFLAGS += -fdata-sections -ffunction-sections -Wall -g -Wno-strict-aliasing OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F103xB CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F103RB_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -126,7 +127,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -142,13 +142,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -159,9 +159,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F2_Olimex_STM32P207_GCC/Boot/makefile b/Target/Demo/ARMCM3_STM32F2_Olimex_STM32P207_GCC/Boot/makefile index 9d27371c..56d6e5ea 100644 --- a/Target/Demo/ARMCM3_STM32F2_Olimex_STM32P207_GCC/Boot/makefile +++ b/Target/Demo/ARMCM3_STM32F2_Olimex_STM32P207_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_stm32f207 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -88,7 +89,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -109,6 +109,7 @@ STACK_SIZE = 0x0800 STDFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DSTM32F207xx CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -116,7 +117,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f207ze_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f207ze_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -143,7 +144,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -159,13 +159,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -176,9 +176,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM3_STM32F2_Olimex_STM32P207_GCC/Prog/makefile b/Target/Demo/ARMCM3_STM32F2_Olimex_STM32P207_GCC/Prog/makefile index c8cf922e..8e5c2594 100644 --- a/Target/Demo/ARMCM3_STM32F2_Olimex_STM32P207_GCC/Prog/makefile +++ b/Target/Demo/ARMCM3_STM32F2_Olimex_STM32P207_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32f207 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -95,6 +95,7 @@ STACK_SIZE = 0x0800 STDFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F207xx CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -102,7 +103,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f207ze_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f207ze_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -129,7 +130,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -145,13 +145,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -162,9 +162,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32F3_Discovery_F303VC_GCC/Boot/makefile b/Target/Demo/ARMCM4_STM32F3_Discovery_F303VC_GCC/Boot/makefile index 58deeffd..43f5824d 100644 --- a/Target/Demo/ARMCM4_STM32F3_Discovery_F303VC_GCC/Boot/makefile +++ b/Target/Demo/ARMCM4_STM32F3_Discovery_F303VC_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_stm32f303 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -105,6 +105,7 @@ STACK_SIZE = 0x0800 STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Os +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DSTM32F303xC CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -112,7 +113,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f30_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f30_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -139,7 +140,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -155,13 +155,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -172,9 +172,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32F3_Discovery_F303VC_GCC/Prog/makefile b/Target/Demo/ARMCM4_STM32F3_Discovery_F303VC_GCC/Prog/makefile index 57bf9d0a..f879a051 100644 --- a/Target/Demo/ARMCM4_STM32F3_Discovery_F303VC_GCC/Prog/makefile +++ b/Target/Demo/ARMCM4_STM32F3_Discovery_F303VC_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32f303 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -95,6 +95,7 @@ STACK_SIZE = 0x0800 STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F303xC CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -102,7 +103,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f30_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f30_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -129,7 +130,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -145,13 +145,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -162,9 +162,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Boot/makefile b/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Boot/makefile index c94bf401..9b5fcb72 100644 --- a/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Boot/makefile +++ b/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_stm32f303 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -105,6 +105,7 @@ STACK_SIZE = 0x0100 STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Os +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DSTM32F303x8 CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -112,7 +113,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f303k8_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f303k8_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -139,7 +140,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -155,13 +155,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -172,9 +172,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Prog/makefile b/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Prog/makefile index 2466a7f5..d394c8a8 100644 --- a/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Prog/makefile +++ b/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32f303 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.S,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -95,6 +95,7 @@ STACK_SIZE = 0x0100 STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F303x8 CFLAGS += -D__HEAP_SIZE=$(HEAP_SIZE) -D__STACK_SIZE=$(STACK_SIZE) @@ -102,7 +103,7 @@ CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) LFLAGS += -Wl,--defsym=__HEAP_SIZE=$(HEAP_SIZE) -Wl,--defsym=__STACK_SIZE=$(STACK_SIZE) -LFLAGS += -Wl,-script="stm32f303k8_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32f303k8_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -129,7 +130,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -145,13 +145,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.S $(PROJ_CHDRS) +$(AOBJS): %.o: %.S @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -162,9 +162,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32F4_Nucleo_F429ZI_GCC/Boot/makefile b/Target/Demo/ARMCM4_STM32F4_Nucleo_F429ZI_GCC/Boot/makefile index d1230e34..bd4ad1c8 100644 --- a/Target/Demo/ARMCM4_STM32F4_Nucleo_F429ZI_GCC/Boot/makefile +++ b/Target/Demo/ARMCM4_STM32F4_Nucleo_F429ZI_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_stm32f429 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -105,7 +106,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -124,13 +124,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Os +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32F429xx CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F429ZITx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F429ZITx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -157,7 +158,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -173,13 +173,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -190,9 +190,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32F4_Nucleo_F429ZI_GCC/Prog/makefile b/Target/Demo/ARMCM4_STM32F4_Nucleo_F429ZI_GCC/Prog/makefile index eb47e7c1..fb6f115c 100644 --- a/Target/Demo/ARMCM4_STM32F4_Nucleo_F429ZI_GCC/Prog/makefile +++ b/Target/Demo/ARMCM4_STM32F4_Nucleo_F429ZI_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32f429 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -95,7 +96,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -114,13 +114,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F429xx CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F429ZITx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F429ZITx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -147,7 +148,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -163,13 +163,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -180,9 +180,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32F4_Olimex_STM32P405_GCC/Boot/makefile b/Target/Demo/ARMCM4_STM32F4_Olimex_STM32P405_GCC/Boot/makefile index 3c06a60f..0ee8c811 100644 --- a/Target/Demo/ARMCM4_STM32F4_Olimex_STM32P405_GCC/Boot/makefile +++ b/Target/Demo/ARMCM4_STM32F4_Olimex_STM32P405_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_olimex_stm32p405 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -88,7 +89,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -107,13 +107,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Os +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32F405xx CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F405RG_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F405RG_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -140,7 +141,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -156,13 +156,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -173,9 +173,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32F4_Olimex_STM32P405_GCC/Prog/makefile b/Target/Demo/ARMCM4_STM32F4_Olimex_STM32P405_GCC/Prog/makefile index 359b5462..0c4f9363 100644 --- a/Target/Demo/ARMCM4_STM32F4_Olimex_STM32P405_GCC/Prog/makefile +++ b/Target/Demo/ARMCM4_STM32F4_Olimex_STM32P405_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_olimex_stm32p405 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -93,13 +93,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F405xx CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F405RG_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F405RG_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -126,7 +127,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -142,13 +142,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -159,9 +159,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32G4_Nucleo_G474RE_GCC/Boot/makefile b/Target/Demo/ARMCM4_STM32G4_Nucleo_G474RE_GCC/Boot/makefile index 55095a96..952e3459 100644 --- a/Target/Demo/ARMCM4_STM32G4_Nucleo_G474RE_GCC/Boot/makefile +++ b/Target/Demo/ARMCM4_STM32G4_Nucleo_G474RE_GCC/Boot/makefile @@ -85,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -104,13 +103,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32G474xx CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32G474RETx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32G474RETx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -137,7 +137,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -153,13 +152,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -170,9 +169,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32G4_Nucleo_G474RE_GCC/Prog/makefile b/Target/Demo/ARMCM4_STM32G4_Nucleo_G474RE_GCC/Prog/makefile index 0095bda3..5fb32e98 100644 --- a/Target/Demo/ARMCM4_STM32G4_Nucleo_G474RE_GCC/Prog/makefile +++ b/Target/Demo/ARMCM4_STM32G4_Nucleo_G474RE_GCC/Prog/makefile @@ -75,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -94,13 +93,14 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32G474xx CFLAGS += -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32G474RETx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32G474RETx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -127,7 +127,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -143,13 +142,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -160,9 +159,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32L4_Nucleo_L476RG_GCC/Boot/makefile b/Target/Demo/ARMCM4_STM32L4_Nucleo_L476RG_GCC/Boot/makefile index a6bc7a50..bfd68f44 100644 --- a/Target/Demo/ARMCM4_STM32L4_Nucleo_L476RG_GCC/Boot/makefile +++ b/Target/Demo/ARMCM4_STM32L4_Nucleo_L476RG_GCC/Boot/makefile @@ -40,7 +40,9 @@ PROJ_NAME=openblt_stm32l476 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ + #|--------------------------------------------------------------------------------------| #| Collect project files | @@ -83,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -102,12 +103,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Os +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32L476xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="stm32l4_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32l4_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -134,7 +136,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -150,13 +151,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -167,9 +168,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32L4_Nucleo_L476RG_GCC/Prog/makefile b/Target/Demo/ARMCM4_STM32L4_Nucleo_L476RG_GCC/Prog/makefile index 021a0e8b..afcadde1 100644 --- a/Target/Demo/ARMCM4_STM32L4_Nucleo_L476RG_GCC/Prog/makefile +++ b/Target/Demo/ARMCM4_STM32L4_Nucleo_L476RG_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32l476 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -93,12 +93,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32L476xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="stm32l4_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"stm32l4_flash.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -125,7 +126,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -141,13 +141,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -158,9 +158,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32L4_Nucleo_L496ZG_GCC/Boot/makefile b/Target/Demo/ARMCM4_STM32L4_Nucleo_L496ZG_GCC/Boot/makefile index fca2956e..704c1006 100644 --- a/Target/Demo/ARMCM4_STM32L4_Nucleo_L496ZG_GCC/Boot/makefile +++ b/Target/Demo/ARMCM4_STM32L4_Nucleo_L496ZG_GCC/Boot/makefile @@ -85,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -104,12 +103,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32L496xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32L496ZGTx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32L496ZGTx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -136,7 +136,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -152,13 +151,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -169,9 +168,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM4_STM32L4_Nucleo_L496ZG_GCC/Prog/makefile b/Target/Demo/ARMCM4_STM32L4_Nucleo_L496ZG_GCC/Prog/makefile index 742de396..071e1c59 100644 --- a/Target/Demo/ARMCM4_STM32L4_Nucleo_L496ZG_GCC/Prog/makefile +++ b/Target/Demo/ARMCM4_STM32L4_Nucleo_L496ZG_GCC/Prog/makefile @@ -75,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -94,12 +93,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g3 OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32L496xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32L496ZGTx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32L496ZGTx_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -126,7 +126,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -142,13 +141,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -159,9 +158,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM7_STM32F7_Nucleo_F746ZG_GCC/Boot/makefile b/Target/Demo/ARMCM7_STM32F7_Nucleo_F746ZG_GCC/Boot/makefile index 1c7fe99c..9a6797ca 100644 --- a/Target/Demo/ARMCM7_STM32F7_Nucleo_F746ZG_GCC/Boot/makefile +++ b/Target/Demo/ARMCM7_STM32F7_Nucleo_F746ZG_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_stm32f746 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -103,12 +103,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32F746xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F746ZG_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F746ZG_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -135,7 +136,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -151,13 +151,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -168,9 +168,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM7_STM32F7_Nucleo_F746ZG_GCC/Prog/makefile b/Target/Demo/ARMCM7_STM32F7_Nucleo_F746ZG_GCC/Prog/makefile index e583fbbd..db47d736 100644 --- a/Target/Demo/ARMCM7_STM32F7_Nucleo_F746ZG_GCC/Prog/makefile +++ b/Target/Demo/ARMCM7_STM32F7_Nucleo_F746ZG_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32f746 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -93,12 +93,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F746xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F746ZG_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F746ZG_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -125,7 +126,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -141,13 +141,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -158,9 +158,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM7_STM32F7_Nucleo_F767ZI_GCC/Boot/makefile b/Target/Demo/ARMCM7_STM32F7_Nucleo_F767ZI_GCC/Boot/makefile index 81a81c5f..15d4410a 100644 --- a/Target/Demo/ARMCM7_STM32F7_Nucleo_F767ZI_GCC/Boot/makefile +++ b/Target/Demo/ARMCM7_STM32F7_Nucleo_F767ZI_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_stm32f767 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -105,7 +106,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -124,12 +124,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32F767xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F767ZI_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F767ZI_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -156,7 +157,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -172,13 +172,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -189,9 +189,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM7_STM32F7_Nucleo_F767ZI_GCC/Prog/makefile b/Target/Demo/ARMCM7_STM32F7_Nucleo_F767ZI_GCC/Prog/makefile index 286263df..c77f6504 100644 --- a/Target/Demo/ARMCM7_STM32F7_Nucleo_F767ZI_GCC/Prog/makefile +++ b/Target/Demo/ARMCM7_STM32F7_Nucleo_F767ZI_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32f767 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -95,7 +96,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -114,12 +114,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32F767xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32F767ZI_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32F767ZI_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -146,7 +147,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -162,13 +162,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -179,9 +179,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM7_STM32H7_Nucleo_H743ZI_GCC/Boot/makefile b/Target/Demo/ARMCM7_STM32H7_Nucleo_H743ZI_GCC/Boot/makefile index be98426e..856c24d3 100644 --- a/Target/Demo/ARMCM7_STM32H7_Nucleo_H743ZI_GCC/Boot/makefile +++ b/Target/Demo/ARMCM7_STM32H7_Nucleo_H743ZI_GCC/Boot/makefile @@ -40,7 +40,8 @@ PROJ_NAME=openblt_stm32h743 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -84,7 +85,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -103,12 +103,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -DSTM32H743xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32H743ZI_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32H743ZI_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -135,7 +136,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -151,13 +151,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -168,9 +168,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) + diff --git a/Target/Demo/ARMCM7_STM32H7_Nucleo_H743ZI_GCC/Prog/makefile b/Target/Demo/ARMCM7_STM32H7_Nucleo_H743ZI_GCC/Prog/makefile index 44119dd1..94ed3605 100644 --- a/Target/Demo/ARMCM7_STM32H7_Nucleo_H743ZI_GCC/Prog/makefile +++ b/Target/Demo/ARMCM7_STM32H7_Nucleo_H743ZI_GCC/Prog/makefile @@ -40,7 +40,8 @@ PROJ_NAME=demoprog_stm32h743 # 8.3 short pathname format with forward slashes. To obtain the pathname in the 8.3 # format, open the directory in the Windows command prompt and run the following command: # cmd /c for %A in ("%cd%") do @echo %~sA -TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +#TOOL_PATH=/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/ +TOOL_PATH=C:/PROGRA~2/GNUTOO~1/82018-~1/bin/ #|--------------------------------------------------------------------------------------| @@ -74,7 +75,6 @@ SZ = $(TOOL_PATH)arm-none-eabi-size #|--------------------------------------------------------------------------------------| PROJ_ASRCS = $(filter %.s,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) PROJ_CSRCS = $(filter %.c,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) -PROJ_CHDRS = $(filter %.h,$(foreach file,$(PROJ_FILES),$(notdir $(file)))) #|--------------------------------------------------------------------------------------| @@ -93,12 +93,13 @@ LIB_PATH = STDFLAGS = -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 -fno-strict-aliasing STDFLAGS += -fdata-sections -ffunction-sections -Wall -g OPTFLAGS = -Og +DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJ_PATH)/$*.d CFLAGS = $(STDFLAGS) $(OPTFLAGS) CFLAGS += -DUSE_HAL_DRIVER -DSTM32H743xx CFLAGS += $(INC_PATH) AFLAGS = $(CFLAGS) LFLAGS = $(STDFLAGS) $(OPTFLAGS) -LFLAGS += -Wl,-script="STM32H743ZI_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map +LFLAGS += -T"STM32H743ZI_FLASH.ld" -Wl,-Map=$(BIN_PATH)/$(PROJ_NAME).map LFLAGS += -specs=nano.specs -Wl,--gc-sections $(LIB_PATH) OFLAGS = -O srec ODFLAGS = -x @@ -125,7 +126,6 @@ COBJS = $(patsubst %.c,%.o,$(PROJ_CSRCS)) .PHONY: all all: $(BIN_PATH)/$(PROJ_NAME).srec - $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf @$(OC) $< $(OFLAGS) $@ @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @@ -141,13 +141,13 @@ $(BIN_PATH)/$(PROJ_NAME).elf : $(AOBJS) $(COBJS) #|--------------------------------------------------------------------------------------| #| Compile and assemble | #|--------------------------------------------------------------------------------------| -$(AOBJS): %.o: %.s $(PROJ_CHDRS) +$(AOBJS): %.o: %.s @echo +++ Assembling [$(notdir $<)] @$(AS) $(AFLAGS) -c $< -o $(OBJ_PATH)/$(@F) -$(COBJS): %.o: %.c $(PROJ_CHDRS) +$(COBJS): %.o: %.c $(OBJ_PATH)/%.d @echo +++ Compiling [$(notdir $<)] - @$(CC) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) + @$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $(OBJ_PATH)/$(@F) #|--------------------------------------------------------------------------------------| @@ -158,9 +158,18 @@ clean: @echo +++ Cleaning build environment @$(RM) $(RMFLAGS) $(foreach file,$(AOBJS),$(OBJ_PATH)/$(file)) @$(RM) $(RMFLAGS) $(foreach file,$(COBJS),$(OBJ_PATH)/$(file)) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(AOBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(patsubst %.o,%.lst,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) + @$(RM) $(RMFLAGS) $(patsubst %.o,%.d,$(foreach file,$(COBJS),$(OBJ_PATH)/$(file))) @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).map @$(RM) $(RMFLAGS) $(BIN_PATH)/$(PROJ_NAME).srec @echo +++ Clean complete - + +#|--------------------------------------------------------------------------------------| +#| Dependency generation | +#|--------------------------------------------------------------------------------------| +DEPFILES := $(PROJ_CSRCS:%.c=$(OBJ_PATH)/%.d) +$(DEPFILES): +include $(wildcard $(DEPFILES)) +