37 lines
905 B
Makefile
37 lines
905 B
Makefile
|
CROSS_COMPILE:=arm-none-eabi-
|
||
|
CC:=$(CROSS_COMPILE)gcc
|
||
|
LD:=$(CROSS_COMPILE)gcc
|
||
|
OBJS:=startup.o main.o system.o button.o usart.o img/chili.o cga_8x8.o
|
||
|
|
||
|
LSCRIPT:=target-f103.ld
|
||
|
|
||
|
OBJCOPY:=$(CROSS_COMPILE)objcopy
|
||
|
|
||
|
UMX:=unicore-mx/lib/libucmx_stm32f1.a
|
||
|
UMXFLAGS:=-Iunicore-mx/include/ -DSTM32F1
|
||
|
|
||
|
|
||
|
CFLAGS:=-mcpu=cortex-m3 -mthumb -g -ggdb -Wall -Wno-main -Wstack-usage=200 -ffreestanding -Wno-unused $(UMXFLAGS) -nostdlib
|
||
|
ASFLAGS+=-mthumb -mlittle-endian -mthumb-interwork -ggdb -ffreestanding -mcpu=cortex-m3
|
||
|
LDFLAGS:=-T $(LSCRIPT) -Wl,-gc-sections -Wl,-Map=image.map -nostdlib
|
||
|
|
||
|
#all: image.bin
|
||
|
|
||
|
image.bin: image.elf
|
||
|
$(OBJCOPY) -O binary $^ $@
|
||
|
|
||
|
image.elf: $(UMX) $(OBJS) $(LSCRIPT)
|
||
|
$(LD) $(LDFLAGS) $(OBJS) $(UMX) -o $@
|
||
|
|
||
|
$(UMX):
|
||
|
make -C unicore-mx FP_FLAGS="-mfloat-abi=soft" PREFIX=arm-frosted-eabi TARGETS=stm32/f1
|
||
|
|
||
|
|
||
|
|
||
|
startup.o: startup.c
|
||
|
|
||
|
main.o: main.c
|
||
|
|
||
|
clean:
|
||
|
rm -f image.bin image.elf *.o image.map
|