-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (56 loc) · 2.18 KB
/
Makefile
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
62
63
64
65
66
67
include app/sources.mk
FWSRC += tools/format/src/format.c tools/format/lib/printf.c tools/format/lib/snprintf.c tools/format/lib/sprintf.c
FWINC += tools/format/src tools/format/lib
PRJ_ROOT =
# All configuration
ifeq ($(target),)
ifeq ($(MAKECMDGOALS),)
$(error Please specify target! make target=... all)
endif
else
BUILDDIR = build_$(target)
include targets/$(target)/target.mk
FWINC += targets/$(target)
endif
help:
@echo "*********** ARM SDK MAKEFILE HELP **********"
@echo ""
@echo ""
@echo "USAGE:"
@echo "make help Show this help"
@echo "make configure Configure environement for fixture generators"
@echo "make distclean Deconfigure environement, remove additional and builds files"
@echo "make target=... clean_build Clean all compile files with target build directory"
@echo "make target=... all Simply compile test for target using available files"
clean_build: clean
@echo "Cleaning build $(target)"
@rm -r -f build_$(target)
@rm -r -f app/.dep
@rm -r -f .dep
configure:
@echo "Configure environement..."
@if test -d tools; then echo "tools directory exist!"; else mkdir tools; fi
@echo "Downloading the newest GCC toolchain..."
@./scripts/install_new_gcc.sh
@echo "Downloading the newest openocd debugger..."
@./scripts/install_new_openocd.sh
@echo "Cloning ChibiOS..."
@if test -d tools/ChibiOS; then echo "ChibiOS exists - pull" && cd tools/ChibiOS && git pull; else git clone https://github.com/ChibiOS/ChibiOS.git tools/ChibiOS; fi
@echo "Cloning format library..."
@if test -d tools/format; then echo "format exists"; else git clone git@github.com:nejohnson/format.git tools/format; fi
@echo "Done!"
distclean:
@echo "Deconfigure environement..."
@./scripts/clean_all.sh
@rm -r -f build_*
@rm -r -f app/.dep
@rm -r -f .dep
@echo "Done!"
install: all
@echo "Downloading application to MCU..."
@./targets/$(target)/download_to_MCU.sh build_$(target)/arm_sdk.hex
@echo "Done!"
debug:
@echo "Connecting to MCU..."
@./targets/$(target)/debug_MCU.sh
@echo "Debug session finished!"