From 85c3b2d60fc7c57356d1ea1faa74d6889edc6b36 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 14 Jul 2018 10:59:10 +0200 Subject: Prettify makefile and fix up code formatting --- bluefnorf/Makefile | 50 ++++++++------------------------------------------ 1 file changed, 8 insertions(+), 42 deletions(-) (limited to 'bluefnorf/Makefile') 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 -- cgit