altos: TM v2 places the MMA6555 upside down compared to Tmega
[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 kalman_micro.5c kalman
12 vpath load_csv.5c kalman
13 vpath matrix.5c kalman
14
15 include Version
16
17 SDCCDIRS=\
18         telemetrum-v1.2 telemetrum-v1.1 telemetrum-v1.0 \
19         teledongle-v0.2 \
20         telemini-v1.0 \
21         telebt-v1.0 \
22         teleterra-v0.2 teleshield-v0.1 \
23         telefire-v0.1 telefire-v0.2
24
25 AVRDIRS=\
26         telescience-v0.1 telescience-pwm micropeak
27
28 ARMDIRS=\
29         telemega-v0.1 telemega-v0.1/flash-loader \
30         telemega-v0.3 telemega-v0.3/flash-loader \
31         megadongle-v0.1 megadongle-v0.1/flash-loader \
32         telegps-v0.1 telegps-v0.1/flash-loader \
33         stm-bringup stm-demo \
34         telelco-v0.2 telelco-v0.2/flash-loader \
35         telescience-v0.2 telescience-v0.2/flash-loader
36
37 ARMM0DIRS=\
38         easymini-v0.1
39
40 ifneq ($(shell which sdcc),)
41         SUBDIRS += $(SDCCDIRS)
42 endif
43
44 ifneq ($(shell which avr-gcc),)
45         SUBDIRS += $(AVRDIRS)
46 endif
47
48 ifneq ($(shell which /opt/cortex/bin/arm-none-eabi-gcc),)
49         SUBDIRS += $(ARMDIRS)
50 endif
51
52 ifneq ($(shell which /usr/bin/arm-none-eabi-gcc),)
53         SUBDIRS += $(ARMM0DIRS)
54 endif
55
56 ALLDIRS=$(SDCCDIRS) $(AVRDIRS) $(ARMDIRS)
57
58 all: all-local all-recursive
59
60 RECURSIVE_TARGETS = all-recursive install-recursive
61
62 $(RECURSIVE_TARGETS):
63         @target=`echo $@ | sed 's/-recursive//'`; \
64         for subdir in $(SUBDIRS); do \
65                 echo "Making $$target in $$subdir"; \
66                 (cd $$subdir && $(MAKE) $$target) || exit 1; \
67         done
68
69 ALL_RECURSIVE_TARGETS = clean-recursive
70
71 $(ALL_RECURSIVE_TARGETS):
72         @target=`echo $@ | sed 's/-recursive//'`; \
73         for subdir in $(ALLDIRS); do \
74                 echo "Making $$target in $$subdir"; \
75                 (cd $$subdir && $(MAKE) $$target) || exit 1; \
76         done
77
78 distclean:      clean
79
80 clean: clean-local clean-recursive
81
82 install: install-recursive
83
84 uninstall:
85
86 all-recursive: all-local
87
88 all-local: altitude.h altitude-pa.h ao_kalman.h ao_whiten.h
89
90 altitude.h: make-altitude
91         nickle $< > $@
92
93 altitude-pa.h: make-altitude-pa
94         nickle $< > $@
95
96 ao_kalman.h: make-kalman kalman.5c kalman_filter.5c load_csv.5c matrix.5c
97         bash $< kalman > $@
98
99 ao_whiten.h: make-whiten
100         nickle $< > $@
101
102 clean-local:
103         rm -f altitude.h ao_kalman.h