2020-04-06 21:08:01 +02:00
|
|
|
CROSS_COMPILE:=arm-none-eabi-
|
|
|
|
CC:=$(CROSS_COMPILE)gcc
|
|
|
|
LD:=$(CROSS_COMPILE)gcc
|
|
|
|
VERSION?=1
|
|
|
|
|
|
|
|
OBJS:=startup.o main.o system.o mem.o led.o \
|
|
|
|
i2c.o display.o font_twisted.o button.o systick.o newlib.o uart.o ui.o timer.o\
|
2020-04-26 19:46:21 +02:00
|
|
|
mutex.o ui_drone.o adc.o spi.o pot.o dac.o sound.o drone.o settings.o ui_pattern.o \
|
|
|
|
flash.o
|
2020-04-06 21:08:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
UMX:=lib/unicore-mx/lib/libucmx_stm32f4.a
|
|
|
|
UMXFLAGS:=-Ilib/unicore-mx/include/ -DSTM32F4
|
|
|
|
LIBS+=$(UMX)
|
|
|
|
|
|
|
|
|
2020-04-11 15:28:44 +02:00
|
|
|
OBJS+=drumkit_0.o drumkit_1.o drumkit_2.o drumkit_3.o drumkit_4.o drumkit_5.o drumkit_6.o drums.o
|
|
|
|
|
2020-04-06 21:08:01 +02:00
|
|
|
LSCRIPT:=target.ld
|
|
|
|
|
|
|
|
OBJCOPY:=$(CROSS_COMPILE)objcopy
|
|
|
|
|
|
|
|
CFLAGS:=-mcpu=cortex-m3 -mthumb -Wall -Wno-main -Wstack-usage=320 \
|
|
|
|
-ffreestanding -Wno-unused -DBLOCK_SIZE=4096 -I. -Ilib/unicore-mx/include \
|
|
|
|
-ffunction-sections -fdata-sections
|
|
|
|
CFLAGS+=-specs=nano.specs -lc -lg
|
|
|
|
CFLAGS+=$(UMXFLAGS)
|
|
|
|
#CFLAGS+=-O3
|
|
|
|
CFLAGS+=-g -ggdb3
|
|
|
|
|
|
|
|
ASFLAGS:=$(CFLAGS)
|
|
|
|
|
|
|
|
LDFLAGS:=-T $(LSCRIPT) -Wl,-gc-sections -Wl,-Map=image.map -mcpu=cortex-m3 -mthumb -nostartfiles
|
|
|
|
|
|
|
|
#all: image.bin
|
|
|
|
|
|
|
|
image.bin: image.elf
|
|
|
|
$(OBJCOPY) -O binary $^ $@
|
|
|
|
|
|
|
|
image.elf: $(LIBS) $(OBJS) $(LSCRIPT)
|
|
|
|
$(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
$(UMX):
|
|
|
|
make -C lib/unicore-mx FP_FLAGS="-O3 -mfloat-abi=soft" TARGETS=stm32/f4
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -f image.bin image.elf *.o image.map $(USECFS)/src/*.o
|
|
|
|
make -C lib/unicore-mx clean
|
|
|
|
|