summaryrefslogtreecommitdiff
path: root/bluefnorf/Makefile
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2018-07-14 10:59:10 +0200
committerjaseg <git@jaseg.net>2018-07-14 10:59:10 +0200
commit85c3b2d60fc7c57356d1ea1faa74d6889edc6b36 (patch)
tree5c769ab81fbe5be48412586f650d6a86bc4f2dea /bluefnorf/Makefile
parent47fccb6b917fb03be4680da243c39e72525c4831 (diff)
downloadolsndot-85c3b2d60fc7c57356d1ea1faa74d6889edc6b36.tar.gz
olsndot-85c3b2d60fc7c57356d1ea1faa74d6889edc6b36.tar.bz2
olsndot-85c3b2d60fc7c57356d1ea1faa74d6889edc6b36.zip
Prettify makefile and fix up code formatting
Diffstat (limited to 'bluefnorf/Makefile')
-rw-r--r--bluefnorf/Makefile50
1 files changed, 8 insertions, 42 deletions
diff --git a/bluefnorf/Makefile b/bluefnorf/Makefile
index c923e82..b500a1b 100644
--- a/bluefnorf/Makefile
+++ b/bluefnorf/Makefile
@@ -1,51 +1,28 @@
-OPENCM3_PATH ?= ../../libopencm3
-OPENCM3_LIBRARY_PATH ?= $(OPENCM3_PATH)/lib
-OPENCM3_INCLUDE_PATH ?= $(OPENCM3_PATH)/include
+OPENCM3_PATH ?= $(HOME)/resource/libopencm3
CC := arm-none-eabi-gcc
OBJCOPY := arm-none-eabi-objcopy
OBJDUMP := arm-none-eabi-objdump
SIZE := arm-none-eabi-size
+AS = arm-none-eabi-as
-
-# 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 = -Wall -Wextra -g -std=gnu11 -O1
+CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m3 -mfix-cortex-m3-ldrd -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 += -Wl,-Map=main.map
+CFLAGS += -Tstm32f103c8t6.ld --static -nostartfiles
+CFLAGS += -I$(OPENCM3_PATH)/include -L$(OPENCM3_PATH)/lib
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)
@@ -54,22 +31,11 @@ main.elf: main.o usb.o
$(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
-
-
-
+ rm -f $(addprefix main,.o .hex .lst .map .elf .bin)
.PHONY: flash clean