forked from fnoble/piksi_firmware
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
66 lines (53 loc) · 1.68 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
SWIFTNAV_ROOT := $(shell pwd)
MAKEFLAGS += SWIFTNAV_ROOT=$(SWIFTNAV_ROOT)
# Be silent per default, but 'make V=1' will show all compiler calls.
ifneq ($(V),1)
Q := @
# Do not print "Entering directory ...".
MAKEFLAGS += --no-print-directory
endif
ifneq (,$(findstring W32,$(shell uname)))
CMAKEFLAGS += -G "MSYS Makefiles"
endif
ifndef PRN
MAKEFLAGS += $(warning PRN not defined, using default PRN (22) for tests, specify the PRN with 'make PRN=22')PRN=22
else
MAKEFLAGS += PRN=$(PRN)
endif
.PHONY: all tests firmware docs .FORCE
all: firmware # tests
firmware: libopencm3/lib/libopencm3_stm32f4.a libswiftnav/build/src/libswiftnav-static.a
@printf "BUILD src\n"; \
$(MAKE) -r -C src $(MAKEFLAGS)
tests:
$(Q)for i in tests/*; do \
if [ -d $$i ]; then \
printf "BUILD $$i\n"; \
$(MAKE) -r -C $$i $(MAKEFLAGS) || exit $?; \
fi; \
done
libopencm3/lib/libopencm3_stm32f4.a:
@printf "BUILD libopencm3\n"; \
$(MAKE) -C libopencm3 $(MAKEFLAGS) lib/stm32/f4
libswiftnav/build/src/libswiftnav-static.a: .FORCE
@printf "BUILD libswiftnav\n"; \
mkdir -p libswiftnav/build; cd libswiftnav/build; \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-gcc-arm-embedded.cmake $(CMAKEFLAGS) ../
$(MAKE) -C libswiftnav/build $(MAKEFLAGS)
clean:
@printf "CLEAN src\n"; \
$(MAKE) -C src $(MAKEFLAGS) clean
@printf "CLEAN libopencm3\n"; \
$(MAKE) -C libopencm3 $(MAKEFLAGS) clean
@printf "CLEAN libswiftnav\n"; \
$(RM) -rf libswiftnav/build
$(Q)for i in tests/*; do \
if [ -d $$i ]; then \
printf "CLEAN $$i\n"; \
$(MAKE) -C $$i $(MAKEFLAGS) clean || exit $?; \
fi; \
done
docs:
$(MAKE) -C docs/diagrams
doxygen docs/Doxyfile
.FORCE: