-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.post-targets
62 lines (44 loc) · 1.16 KB
/
Makefile.post-targets
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
57
58
59
60
61
#
# Additional generic targets for nRF51 projects
#
# Author: Matthias Bock <mail@matthiasbock.net>
# License: GNU GPLv3
#
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@ 2>&1 | $(CC_COLORS)
%.o: %s
$(CC) $(CFLAGS) -c $< -o $@
%.hex: %.elf
$(OBJCOPY) -Oihex $< $@
%.bin: %.elf
$(OBJCOPY) -Obinary $< $@
%.text: %.elf
$(OBJCOPY) -O binary -j .text $< $@
%.data: %.elf
$(OBJCOPY) -O binary -j .data $< $@
%.rodata: %.elf
$(OBJCOPY) -O binary -j .rodata $< $@
debug: $(DEBUG_BINARY)
$(GDB) -q $(GDB_ARGS) $< \
-ex "target remote localhost:3333" \
-ex="load" \
-ex="monitor reset halt" \
-ex "continue"
clean:
rm -f *.o $(PROJECT_ROOT)/*/*.o nordic/sdk/nrf51822/Source/*/*.o *.out *.bin *.elf *.hex *.map *.text *.data *.rodata
#
# Flash the SoftDevice HEX-file into the chip
#
# filename of used softdevice (full path)
SOFTDEVICE = $(PROJECT_ROOT)/nordic/softdevice/s110_nrf51822_7.3.0_softdevice.hex
.PHONY: softdevice
softdevice:
$(GDB) -q $(SOFTDEVICE) \
-ex "target remote localhost:3333" \
-ex "load"
#
# include OpenOCD debugger configuration and target
#
OPENOCD_CFG_DIR = $(PROJECT_ROOT)/sdk/debug/
.PHONY: debug
include $(PROJECT_ROOT)/sdk/debug/Makefile