2021-09-16 01:42:59 +00:00
|
|
|
CC=arm-none-eabi-gcc
|
|
|
|
OBJCOPY=arm-none-eabi-objcopy
|
|
|
|
|
2021-11-05 04:16:23 +00:00
|
|
|
SRC=src/test.c
|
|
|
|
LDS=src/test.lds
|
2021-09-16 01:42:59 +00:00
|
|
|
|
|
|
|
OPTI=-O0
|
|
|
|
CFLAGS= $(OPTI) -g -gdwarf-2 -mthumb -fno-builtin -mcpu=cortex-m4 -Wall -std=c99 -ffunction-sections -fdata-sections -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize -fverbose-asm
|
|
|
|
LDFLAGS=-nostartfiles -Wl,-gc-sections -T$(LDS) -L. --specs=nano.specs
|
|
|
|
|
|
|
|
all: test.bin
|
|
|
|
|
2021-11-05 04:16:23 +00:00
|
|
|
test.o: $(SRC)
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2021-09-16 01:42:59 +00:00
|
|
|
|
2021-11-05 04:16:23 +00:00
|
|
|
test.elf: test.o $(LDS)
|
2021-09-16 01:42:59 +00:00
|
|
|
$(CC) $(LDFLAGS) test.o -o test.elf
|
|
|
|
|
|
|
|
test.bin: test.elf
|
|
|
|
$(OBJCOPY) -O binary -S test.elf test.bin
|
|
|
|
|
|
|
|
debug: test.bin
|
|
|
|
st-flash write test.bin 0x8000000
|
|
|
|
st-util
|
|
|
|
|
|
|
|
run: test.bin
|
|
|
|
st-flash write test.bin 0x8000000
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) test.o test.elf test.bin
|