forked from rogercollins/bare_core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 807 Bytes
/
Makefile
File metadata and controls
32 lines (23 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ARM_C_FILES = $(shell find arm -name \*.c)
ARM_O_FILES = $(ARM_C_FILES:.c=.o)
ARM_DEPS = $(ARM_O_FILES:.o=.d)
all: target server test
test:
./test_main
file core | grep ARM
arm-none-eabi-gdb arm/ex1.elf core
target: arm/ex1.elf
arm/ex1.elf: $(ARM_O_FILES)
arm-none-eabi-gcc -nostartfiles -Wl,--gc-sections -Xlinker --script=arm/MK12DX256_app.ld \
-Xlinker -Map=arm/ex1.map $(ARM_O_FILES) \
-o arm/ex1.elf
server: test_main
test_main: test_main.c elfcore.c elfcore.h
gcc -I . test_main.c elfcore.c -o test_main
clean:
rm -f test_main arm/ex1.elf $(ARM_O_FILES) $(ARM_DEPS)
-include $(DEPS)
arm/%.o: arm/%.c
arm-none-eabi-gcc -g -mcpu=cortex-m4 -mlittle-endian -mthumb -g3 -O0 -fmessage-length=0 \
-ffunction-sections -fdata-sections -funsigned-char -std=gnu11 -MP -MMD \
-c $< -o $@