05075ae1947464bc1e00128f0d09771153f8f4dc
[fw/altos] / src / Makefile
1 #
2 # AltOS build
3 #
4
5 vpath make-altitude util
6 vpath make-altitude-pa util
7 vpath make-kalman util
8 vpath make-whiten util
9 vpath kalman.5c kalman
10 vpath kalman_filter.5c kalman
11 vpath load_csv.5c kalman
12 vpath matrix.5c kalman
13
14 include Version
15
16 ifneq ($(shell which sdcc),)
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 tidongle test \
24         teleterra-v0.2 teleshield-v0.1 \
25         telefire-v0.1 \
26         spiradio-v0.1
27 endif
28
29 ifneq ($(shell which avr-gcc),)
30         SUBDIRS += telescience-v0.1 telescience-pwm telepyro-v0.1 micropeak
31 endif
32
33 ifneq ($(shell which arm-none-eabi-gcc),)
34         SUBDIRS += megametrum-v0.1 megadongle-v0.1 stm-bringup stm-demo telelco-v0.1
35 endif
36
37 all: all-local all-recursive
38
39 RECURSIVE_TARGETS = all-recursive clean-recursive install-recursive
40
41 $(RECURSIVE_TARGETS):
42         @target=`echo $@ | sed 's/-recursive//'`; \
43         for subdir in $(SUBDIRS); do \
44                 echo "Making $$target in $$subdir"; \
45                 (cd $$subdir && $(MAKE) $$target) || exit 1; \
46         done
47
48 distclean:      clean
49
50 clean: clean-local clean-recursive
51
52 install: install-recursive
53
54 uninstall:
55
56 all-recursive: all-local
57
58 all-local: altitude.h altitude-pa.h ao_kalman.h ao_whiten.h
59
60 altitude.h: make-altitude
61         nickle $< > $@
62
63 altitude-pa.h: make-altitude-pa
64         nickle $< > $@
65
66 ao_kalman.h: make-kalman kalman.5c kalman_filter.5c load_csv.5c matrix.5c
67         bash $< kalman > $@
68
69 ao_whiten.h: make-whiten
70         nickle $< > $@
71
72 clean-local:
73         rm -f altitude.h ao_kalman.h