diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-09-08 12:18:48 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-09-08 12:18:48 +0200 |
commit | dc98c23aa2b2bd781b8a8c245465d615039b6f5f (patch) | |
tree | 4b7952c37df9988165e95a0ef02ef4b266e033cd /stm32f091/makefile | |
parent | c3b4382302a7ac74ad12a4d315d1d2c15204ca54 (diff) |
stm32 code compiling
Diffstat (limited to 'stm32f091/makefile')
-rw-r--r-- | stm32f091/makefile | 79 |
1 files changed, 30 insertions, 49 deletions
diff --git a/stm32f091/makefile b/stm32f091/makefile index 63139cb..fa610fd 100644 --- a/stm32f091/makefile +++ b/stm32f091/makefile @@ -4,58 +4,39 @@ OC = arm-none-eabi-objcopy RM = rm -f TARGET = main -MCU_SPEC = cortex-m0 -CFLAGS += -g -CFLAGS += -Wall -CFLAGS += -Os -CFLAGS += -mcpu=$(MCU_SPEC) -CFLAGS += -mthumb -CFLAGS += --specs=nosys.specs -CFLAGS += -I./lib/STM32CubeF0/Drivers/CMSIS/DSP/Include -CFLAGS += -I./lib/STM32CubeF0/Drivers/CMSIS/Core/Include -CFLAGS += -I./lib/STM32CubeF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include -CFLAGS += -I./lib/STM32CubeF0/Drivers/CMSIS/RTOS2/Include -CFLAGS += -I./lib/STM32CubeF0/Drivers/CMSIS/Core_A/Include -CFLAGS += -I./lib/STM32CubeF0/Drivers/CMSIS/Include -CFLAGS += -I./lib/STM32CubeF0/Drivers/CMSIS/NN/Include -CFLAGS += -I./lib/STM32-base/startup -CFLAGS += -D STM32F091xC - -LFLAGS += -Wl,-u,vfprintf -LFLAGS += -lm -LFLAGS += -Wl,-relax -LFLAGS += -Wl,-gc-sections -LFLAGS += -mcpu=$(MCU_SPEC) -LFLAGS += -mthumb -LFLAGS += -Wall -LFLAGS += --specs=nosys.specs -LFLAGS += -nostartfiles -LFLAGS += -nostdlib -LFLAGS += -lgcc -LFLAGS += -Wl,-L./lib/STM32-base/linker,-T./lib/STM32-base/linker/STM32F0xx/STM32F091xC.ld - -LFLAGS += -Wa,--defsym,CALL_ARM_SYSTEM_INIT=1 -LFLAGS += -march=armv6-m -LFLAGS += -mlittle-endian -LFLAGS += -mthumb -LFLAGS += -masm-syntax-unified -LFLAGS += -fno-threadsafe-statics -LFLAGS += -fno-rtti -LFLAGS += -fno-exceptions -LFLAGS += -fno-unwind-tables - -# AFLAGS += -ffunction-sections -fdata-sections - -SRCS += $(wildcard *.cpp) -OBJS += $(patsubst %.cpp,%.o, $(SRCS)) - -# SRCS += ./lib/STM32-base/startup/STM32F0xx/STM32F091xC.s -SRCS += ./lib/STM32CubeF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.o +SHARED_FLAGS += -g +SHARED_FLAGS += -D STM32F091xC +SHARED_FLAGS += -Wall +SHARED_FLAGS += -Wextra +SHARED_FLAGS += -Wa,--defsym,CALL_ARM_SYSTEM_INIT=1 +SHARED_FLAGS += -I./lib/STM32-base-STM32Cube/CMSIS/ARM/inc +SHARED_FLAGS += -I./lib/STM32-base-STM32Cube/CMSIS/STM32F0xx/inc +SHARED_FLAGS += -I./lib/STM32-base/startup +SHARED_FLAGS += -ffunction-sections +SHARED_FLAGS += -fdata-sections +SHARED_FLAGS += -mlittle-endian +SHARED_FLAGS += -mthumb +SHARED_FLAGS += -masm-syntax-unified +SHARED_FLAGS += -specs=nosys.specs +SHARED_FLAGS += -fno-threadsafe-statics +SHARED_FLAGS += -fno-rtti +SHARED_FLAGS += -fno-exceptions +SHARED_FLAGS += -fno-unwind-tables +SHARED_FLAGS += -Wl,-L./lib/STM32-base/linker,-T./lib/STM32-base/linker/STM32F0xx/STM32F091xC.ld +SHARED_FLAGS += -mcpu=cortex-m0 +SHARED_FLAGS += -march=armv6-m + +CFLAGS += $(SHARED_FLAGS) +LFLAGS += $(SHARED_FLAGS) +AFLAGS += $(SHARED_FLAGS) + +OBJS += $(patsubst %.cpp,%.o, $(wildcard *.cpp)) OBJS += ./lib/STM32-base/startup/STM32F0xx/STM32F091xC.o +OBJS += ./lib/STM32-base-STM32Cube/CMSIS/STM32F0xx/src/system_stm32f0xx.o %.o: %.s - $(CC) -x assembler-with-cpp -c $(CFLAGS) $(AFLAGS) $< -o $@ + $(CC) -c $(AFLAGS) $< -o $@ %.o: %.c $(CC) -c $(CFLAGS) $< -o $@ @@ -64,7 +45,7 @@ OBJS += ./lib/STM32-base/startup/STM32F0xx/STM32F091xC.o $(CC) -c $(CFLAGS) $< -o $@ $(TARGET).elf: $(OBJS) - $(LD) $^ $(LFLAGS) -o $@ + $(LD) $(LFLAGS) $^ -o $@ $(TARGET).bin: $(TARGET).elf $(OC) -O binary $< $@ |