conditionalize build of ARM binaries on presence of arm-none-eabi-gcc in PATH
[fw/altos] / src / Makefile
1 #
2 # AltOS build
3 #
4 #
5
6 vpath make-altitude util
7 vpath make-altitude-pa util
8 vpath make-kalman util
9 vpath make-whiten util
10 vpath kalman.5c kalman
11 vpath kalman_filter.5c kalman
12 vpath load_csv.5c kalman
13 vpath matrix.5c kalman
14
15 include Version
16
17 SUBDIRS=\
18         telemetrum-v1.2 telemetrum-v1.1 telemetrum-v1.0 \
19         teledongle-v0.2 teledongle-v0.1 \
20         telemini-v1.0 telenano-v0.1 \
21         telebt-v0.0 telebt-v0.1 \
22         telemetrum-v0.1-sky telemetrum-v0.1-sirf \
23         telelaunch-v0.1 \
24         tidongle test telescience-v0.1 telepyro-v0.1 \
25         teleterra-v0.2 teleshield-v0.1
26
27 ifneq ($(shell which arm-none-eabi-gcc),)
28         SUBDIRS += megametrum-v0.1 stm-bringup stm-demo 
29 endif
30
31 all: all-local all-recursive
32
33 RECURSIVE_TARGETS = all-recursive clean-recursive install-recursive
34
35 $(RECURSIVE_TARGETS):
36         @target=`echo $@ | sed 's/-recursive//'`; \
37         for subdir in $(SUBDIRS); do \
38                 echo "Making $$target in $$subdir"; \
39                 (cd $$subdir && $(MAKE) $$target) || exit 1; \
40         done
41
42 distclean:      clean
43
44 clean: clean-local clean-recursive
45
46 install: install-recursive
47
48 uninstall:
49
50 all-recursive: all-local
51
52 all-local: altitude.h altitude-pa.h ao_kalman.h ao_whiten.h
53
54 altitude.h: make-altitude
55         nickle $< > $@
56
57 altitude-pa.h: make-altitude-pa
58         nickle $< > $@
59
60 ao_kalman.h: make-kalman kalman.5c kalman_filter.5c load_csv.5c matrix.5c
61         bash $< kalman > $@
62
63 ao_whiten.h: make-whiten
64         nickle $< > $@
65
66 clean-local:
67         rm -f altitude.h ao_kalman.h