-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (48 loc) · 2.25 KB
/
Copy pathMakefile
File metadata and controls
56 lines (48 loc) · 2.25 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
CC = arm-none-eabi-gcc
AS = arm-none-eabi-as
LD = arm-none-eabi-ld
OBJCOPY = arm-none-eabi-objcopy
SRCS = hardware.s main.cpp
all: clean main.hex flash
noflash: clean main.hex
flash:
openocd -f interface/cmsis-dap.cfg -f target/nrf52.cfg -c "program main.hex reset exit" 2> /dev/null
clean:
rm -f *.o *.elf *.hex *.map
# main.elf: $(SRCS)
# $(CC) \
# -L/usr/arm-none-eabi/lib/arm/v5te/hard \
# -L/usr/lib/gcc/arm-none-eabi/14.1.0/arm/v5te/hard \
# -Wall -Wextra -Wno-deprecated-copy \
# -ffreestanding \
# -ffunction-sections -fdata-sections \
# -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
# -Os \
# -nostartfiles -nostdlib \
# -mcpu=cortex-m4 -mthumb \
# $^ \
# -o main.elf \
# -T linker.ld \
# -lstdc++ -lm -lc -lgcc -lg -lnosys \
# --specs=nano.specs --specs=nosys.specs \
# -Wl,--gc-sections -Wl,-Map=output.map
main.elf: $(SRCS)
$(CC) \
-L/usr/arm-none-eabi/lib/thumb/v7e-m+dp/hard \
-L/usr/lib/gcc/arm-none-eabi/14.1.0/thumb/v7e-m+dp/hard \
-Wall -Wextra -Wno-deprecated-copy \
-ffreestanding \
-ffunction-sections -fdata-sections \
-mfloat-abi=hard -mfpu=fpv5-d16 \
-Os \
-nostartfiles -nostdlib \
-mcpu=cortex-m4 -mthumb \
$^ \
-I. -Ilibs \
-o main.elf \
-T linker.ld \
-lstdc++ -lm -lc -lgcc -lg -lnosys \
--specs=nano.specs --specs=nosys.specs \
-Wl,--gc-sections -Wl,-Map=output.map
main.hex: main.elf
$(OBJCOPY) main.elf main.hex -O ihex