altoslib: Flush output when disabling remote
[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 TOPDIR=.
16
17 include Makedefs
18
19 ARMM3DIRS=\
20         easymega-v1.0 easymega-v1.0/flash-loader \
21         easymega-v2.0 easymega-v2.0/flash-loader \
22         easytimer-v1 easytimer-v1/flash-loader \
23         telemega-v0.1 telemega-v0.1/flash-loader \
24         telemega-v1.0 telemega-v1.0/flash-loader \
25         telemega-v2.0 telemega-v2.0/flash-loader \
26         telemega-v3.0 telemega-v3.0/flash-loader \
27         telemega-v4.0 telemega-v4.0/flash-loader \
28         telemetrum-v2.0 telemetrum-v2.0/flash-loader \
29         telemetrum-v3.0 telemetrum-v3.0/flash-loader \
30         telegps-v0.3 telegps-v0.3/flash-loader \
31         telegps-v1.0 telegps-v1.0/flash-loader \
32         telegps-v2.0 telegps-v2.0/flash-loader \
33         telelco-v0.2 telelco-v0.2/flash-loader \
34         telelco-v0.2-cc1200 telelco-v0.2-cc1200/flash-loader \
35         telelco-v0.3 telelco-v0.3/flash-loader \
36         telelco-v2.0 telelco-v2.0/flash-loader \
37         teledongle-v3.0 teledongle-v3.0/flash-loader \
38         teleballoon-v2.0 \
39         telebt-v3.0 telebt-v3.0/flash-loader \
40         telebt-v4.0 telebt-v4.0/flash-loader \
41         telelcotwo-v0.1 telelcotwo-v0.1/flash-loader \
42         telefireone-v1.0 telefireone-v1.0/flash-loader \
43         telefiretwo-v0.1 telefiretwo-v0.1/flash-loader \
44         telefireeight-v1.0 telefireeight-v1.0/flash-loader \
45         telefireeight-v2.0 telefireeight-v2.0/flash-loader 
46
47 ARMM0DIRS=\
48         easymini-v1.0 easymini-v1.0/flash-loader \
49         chaoskey-v1.0 chaoskey-v1.0/flash-loader \
50         telemini-v3.0 telemini-v3.0/flash-loader \
51         easymini-v2.0 easymini-v2.0/flash-loader \
52         micropeak-v2.0
53
54 AVRDIRS=\
55         micropeak microkite microsplash
56
57 SUBDIRS=
58
59 ifeq ($(strip $(HAVE_ARM_M3_CC)),yes)
60 SUBDIRS+=$(ARMM3DIRS)
61 foo=bar
62 endif
63
64 ifeq ($(strip $(HAVE_ARM_M0_CC)),yes)
65 SUBDIRS+=$(ARMM0DIRS)
66 baz=bletch
67 endif
68
69 ifeq ($(strip $(HAVE_AVR_CC)),yes)
70 SUBDIRS += $(AVRDIRS)
71 endif
72
73 ALLDIRS=$(ARMM3DIRS) $(ARMM0DIRS) $(AVRDIRS)
74
75 all: all-local all-recursive
76
77 RECURSIVE_TARGETS = all-recursive install-recursive
78
79 $(RECURSIVE_TARGETS):
80         @target=`echo $@ | sed 's/-recursive//'`; \
81         for subdir in $(SUBDIRS); do \
82                 echo "Making $$target in $$subdir"; \
83                 (cd $$subdir && $(MAKE) $$target) || exit 1; \
84         done
85
86 ALL_RECURSIVE_TARGETS = clean-recursive
87
88 $(ALL_RECURSIVE_TARGETS):
89         @target=`echo $@ | sed 's/-recursive//'`; \
90         for subdir in $(ALLDIRS); do \
91                 echo "Making $$target in $$subdir"; \
92                 (cd $$subdir && $(MAKE) $$target) || exit 1; \
93         done
94
95 distclean:      clean
96
97 clean: clean-local clean-recursive
98
99 install: install-recursive
100
101 uninstall:
102
103 all-recursive: all-local
104
105 all-local: altitude.h altitude-pa.h altitude-pa-small.h ao_kalman.h ao_whiten.h $(PDCLIB)
106
107 altitude.h: make-altitude
108         nickle $< > $@
109
110 altitude-pa.h: make-altitude-pa
111         nickle $< > $@
112
113 altitude-pa-small.h: make-altitude-pa
114         nickle $< --sample 3 > $@
115
116 ao_kalman.h: make-kalman kalman.5c kalman_micro.5c kalman_filter.5c load_csv.5c matrix.5c
117         bash $< kalman > $@
118
119 ao_whiten.h: make-whiten
120         nickle $< > $@
121
122 clean-local: $(CLEAN_PDCLIB)
123         rm -f altitude.h ao_kalman.h