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