diff options
author | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2022-10-30 10:57:11 +0100 |
---|---|---|
committer | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2022-10-30 10:57:50 +0100 |
commit | 8952e19f00e0930e53e3731fd30be5e2600d9fd6 (patch) | |
tree | 2770bfd4319402c88b6872d1f8699252329c6603 /stm32f091/makefile | |
parent | 6d9df6fe97502a852b68c8c8e6781d7208170cae (diff) | |
parent | 60f954dbaa399f8f0bcaeeb307953fc3b37b9dc7 (diff) |
finish merge
Diffstat (limited to 'stm32f091/makefile')
-rw-r--r-- | stm32f091/makefile | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/stm32f091/makefile b/stm32f091/makefile index 5a185de..dd03761 100644 --- a/stm32f091/makefile +++ b/stm32f091/makefile @@ -4,6 +4,9 @@ OC = arm-none-eabi-objcopy RM = rm -f TARGET = main +HOST=$(strip $(shell uname -o)) + +include ../shared/shared.mk SHARED_FLAGS += -g SHARED_FLAGS += -DSTM32F091xC @@ -11,7 +14,6 @@ SHARED_FLAGS += -Wall SHARED_FLAGS += -Wextra # SHARED_FLAGS += -Wno-register SHARED_FLAGS += -Wa,--defsym,CALL_ARM_SYSTEM_INIT=1 -# SHARED_FLAGS += -I/usr/arm-none-eabi/include/ SHARED_FLAGS += -I./lib/STM32-base-STM32Cube/HAL/STM32F0xx/inc SHARED_FLAGS += -I./lib/STM32-base-STM32Cube/HAL/STM32F0xx/inc/Legacy SHARED_FLAGS += -I./lib/STM32-base-STM32Cube/CMSIS/ARM/inc @@ -20,7 +22,10 @@ SHARED_FLAGS += -I./lib/STM32-base/startup SHARED_FLAGS += -I./lib/FreeRTOS-Kernel/include SHARED_FLAGS += -I./lib/FreeRTOS-Kernel/portable/GCC/ARM_CM0/ SHARED_FLAGS += -I. -SHARED_FLAGS += -O1 +ifeq ($(HOST),GNU/Linux) +SHARED_FLAGS += -I/usr/arm-none-eabi/include/ +endif +# SHARED_FLAGS += -O1 SHARED_FLAGS += -ffunction-sections SHARED_FLAGS += -fdata-sections SHARED_FLAGS += -Wl,--gc-sections @@ -74,14 +79,20 @@ $(TARGET).bin: $(TARGET).elf %.o: %.s $(CC) -c $(AFLAGS) $< -o $@ +lib/%.o: lib/%.c + $(CC) -c $(CFLAGS) -w $< -o $@ + %.o: %.c $(CC) -c $(CFLAGS) $< -o $@ +%-stm.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ + $(TARGET).elf: $(OBJS) $(LD) $(LFLAGS) $^ -o $@ flash: $(TARGET).bin - st-flash write $(TARGET).bin 0x08000000 + st-flash --reset write $(TARGET).bin 0x08000000 compile_commands: clean compiledb make -n |