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