summaryrefslogtreecommitdiff
path: root/bluefnorf/Makefile
diff options
context:
space:
mode:
authorMatthias Hannig <matthias@hannig.cc>2018-07-13 16:13:00 +0200
committerMatthias Hannig <matthias@hannig.cc>2018-07-13 16:13:00 +0200
commit643208f4898400fb04bf0773c388551f58b0b5bf (patch)
tree5762c221e39442fbe114e41162d3395a987bab82 /bluefnorf/Makefile
parent6426b16179ba17637384aea5f04f13aad326a1c8 (diff)
downloadolsndot-643208f4898400fb04bf0773c388551f58b0b5bf.tar.gz
olsndot-643208f4898400fb04bf0773c388551f58b0b5bf.tar.bz2
olsndot-643208f4898400fb04bf0773c388551f58b0b5bf.zip
added bluefnorf skeleton
Diffstat (limited to 'bluefnorf/Makefile')
-rw-r--r--bluefnorf/Makefile75
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
+