Merge remote-tracking branch 'origin/telescience-v0.2' into telescience-v0.2
[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 SDCCDIRS=\
17         telemetrum-v1.2 telemetrum-v1.1 telemetrum-v1.0 \
18         teledongle-v0.2 teledongle-v0.1 \
19         telemini-v1.0 telenano-v0.1 \
20         telebt-v0.0 telebt-v0.1 \
21         telemetrum-v0.1-sky telemetrum-v0.1-sirf \
22         telelaunch-v0.1 tidongle test \
23         teleterra-v0.2 teleshield-v0.1 \
24         telefire-v0.1 \
25         spiradio-v0.1 telescience-v0.2
26
27 AVRDIRS=\
28         telescience-v0.1 telescience-pwm telepyro-v0.1 micropeak
29
30 ARMDIRS=\
31         megametrum-v0.1 megadongle-v0.1 stm-bringup stm-demo telelco-v0.1
32
33 ifneq ($(shell which sdcc),)
34         SUBDIRS += $(SDCCDIRS)
35 endif
36
37 ifneq ($(shell which avr-gcc),)
38         SUBDIRS += $(AVRDIRS)
39 endif
40
41 ifneq ($(shell which arm-none-eabi-gcc),)
42         SUBDIRS += $(ARMDIRS)
43 endif
44
45 ALLDIRS=$(SDCCDIRS) $(AVRDIRS) $(ARMDIRS)
46
47 all: all-local all-recursive
48
49 RECURSIVE_TARGETS = all-recursive install-recursive
50
51 $(RECURSIVE_TARGETS):
52         @target=`echo $@ | sed 's/-recursive//'`; \
53         for subdir in $(SUBDIRS); do \
54                 echo "Making $$target in $$subdir"; \
55                 (cd $$subdir && $(MAKE) $$target) || exit 1; \
56         done
57
58 ALL_RECURSIVE_TARGETS = clean-recursive
59
60 $(ALL_RECURSIVE_TARGETS):
61         @target=`echo $@ | sed 's/-recursive//'`; \
62         for subdir in $(ALLDIRS); do \
63                 echo "Making $$target in $$subdir"; \
64                 (cd $$subdir && $(MAKE) $$target) || exit 1; \
65         done
66
67 distclean:      clean
68
69 clean: clean-local clean-recursive
70
71 install: install-recursive
72
73 uninstall:
74
75 all-recursive: all-local
76
77 all-local: altitude.h altitude-pa.h ao_kalman.h ao_whiten.h
78
79 altitude.h: make-altitude
80         nickle $< > $@
81
82 altitude-pa.h: make-altitude-pa
83         nickle $< > $@
84
85 ao_kalman.h: make-kalman kalman.5c kalman_filter.5c load_csv.5c matrix.5c
86         bash $< kalman > $@
87
88 ao_whiten.h: make-whiten
89         nickle $< > $@
90
91 clean-local:
92         rm -f altitude.h ao_kalman.h