add: test programm and linker script
Signed-off-by: Nicolas Robert <nicolas.robert@epita.fr>
This commit is contained in:
1 parent
d966107648
commit
3b87f1c39e
3 files changed
+222
No files matched your search
@@ -0,0 +1,29 @@
|
||||
CC=arm-none-eabi-gcc
|
||||
OBJCOPY=arm-none-eabi-objcopy
|
||||
|
||||
LDS=test.lds
|
||||
|
||||
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
|
||||
|
||||
test.o: test.c
|
||||
$(CC) $(CFLAGS) -c test.o test.c
|
||||
|
||||
test.elf: test.o test.lds
|
||||
$(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
|
||||