diff options
author | jaseg <git@jaseg.net> | 2018-07-14 10:57:22 +0200 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2018-07-14 10:57:22 +0200 |
commit | 7c871bbc87159b4b0b98cb44390ee6bba57e6803 (patch) | |
tree | 4d07519a60a375f8bfcc859374d5e801e9e49a5d /bluefnorf/Makefile | |
parent | 5b5a380a4b7d1d5f4adc288e0b6759631c7b893d (diff) | |
parent | 643208f4898400fb04bf0773c388551f58b0b5bf (diff) | |
download | olsndot-7c871bbc87159b4b0b98cb44390ee6bba57e6803.tar.gz olsndot-7c871bbc87159b4b0b98cb44390ee6bba57e6803.tar.bz2 olsndot-7c871bbc87159b4b0b98cb44390ee6bba57e6803.zip |
Merge branch 'master' of github.com:jaseg/led_drv
Diffstat (limited to 'bluefnorf/Makefile')
-rw-r--r-- | bluefnorf/Makefile | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/bluefnorf/Makefile b/bluefnorf/Makefile new file mode 100644 index 0000000..c923e82 --- /dev/null +++ b/bluefnorf/Makefile @@ -0,0 +1,75 @@ + +OPENCM3_PATH ?= ../../libopencm3 +OPENCM3_LIBRARY_PATH ?= $(OPENCM3_PATH)/lib +OPENCM3_INCLUDE_PATH ?= $(OPENCM3_PATH)/include + +CC := arm-none-eabi-gcc +OBJCOPY := arm-none-eabi-objcopy +OBJDUMP := arm-none-eabi-objdump +SIZE := arm-none-eabi-size + + +# CFLAGS = -Wall -g -std=gnu11 -Os +CFLAGS = -Wall -g -std=gnu11 -O1 +CFLAGS += -mlittle-endian -mthumb +CFLAGS += -mcpu=cortex-m3 +CFLAGS += -mfix-cortex-m3-ldrd +CFLAGS += -msoft-float +#CFLAGS += -ffunction-sections -fdata-sections -Wl,--gc-sections +CFLAGS += -Wl,-Map=main.map + + +CFLAGS += -Tstm32f103c8t6.ld + + +CFLAGS += -I$(OPENCM3_INCLUDE_PATH) +CFLAGS += -L$(OPENCM3_LIBRARY_PATH) + +CFLAGS += -DSTM32F1 + +CFLAGS += --static -nostartfiles + + + +LDFLAGS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group +LDFLAGS += -lopencm3_stm32f1 -lm + +AS = arm-none-eabi-as + +all: main.elf + + +cr4_fft_1024_stm32.o: cr4_fft_1024_stm32.s + $(AS) -o cr4_fft_1024_stm32.o cr4_fft_1024_stm32.s + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + + +main.elf: main.o usb.o + $(CC) $(CFLAGS) -o main.elf main.o usb.o $(LDFLAGS) + + $(OBJCOPY) -O ihex $@ $(@:.elf=.hex) + $(OBJCOPY) -O binary $@ $(@:.elf=.bin) + $(OBJDUMP) -St $@ >$(@:.elf=.lst) + $(SIZE) $@ + + + +flash: main.elf + openocd -f openocd.cfg -c "program $< verify reset exit" + + +clean: + rm -f *.o + rm -f *.hex + rm -f *.lst + rm -f *.map + rm -f *.elf + rm -f *.bin + + + + +.PHONY: flash clean + |