Remove GPS data missing from skytraq. Save max height/accel/speed
[fw/altos] / src / Makefile.proto
1 #
2 # AltOS build
3 #
4 #
5 vpath %.c ..
6 vpath %.h ..
7 vpath make-altitude ..
8 vpath ao-make-product.5c ..
9
10 CC=sdcc
11
12 ifndef VERSION
13 VERSION=$(shell git describe)
14 endif
15
16 CFLAGS=--model-small --debug --opt-code-speed
17
18 LDFLAGS=--out-fmt-ihx --code-loc 0x0000 --code-size 0x8000 \
19         --xram-loc 0xf000 --xram-size 0xda2 --iram-size 0xff
20
21 INC = \
22         ao.h \
23         ao_pins.h \
24         cc1111.h \
25         altitude.h \
26         25lc1024.h
27
28 #
29 # Common AltOS sources
30 #
31 ALTOS_SRC = \
32         ao_cmd.c \
33         ao_dma.c \
34         ao_mutex.c \
35         ao_panic.c \
36         ao_task.c \
37         ao_timer.c \
38         _bp.c
39
40 #
41 # Shared AltOS drivers
42 #
43 ALTOS_DRIVER_SRC = \
44         ao_beep.c \
45         ao_config.c \
46         ao_led.c \
47         ao_radio.c \
48         ao_stdio.c \
49         ao_usb.c
50
51 TELE_COMMON_SRC = \
52         ao_packet.c \
53         ao_packet_slave.c \
54         ao_state.c
55
56 #
57 # Receiver code
58 #
59 TELE_RECEIVER_SRC =\
60         ao_monitor.c \
61         ao_gps_print.c \
62         ao_packet_master.c \
63         ao_rssi.c
64
65 #
66 # Shared Tele drivers (on TeleMetrum, TeleTerra, TeleDongle)
67 #
68
69 TELE_DRIVER_SRC = \
70         ao_convert.c \
71         ao_serial.c
72
73 #
74 # Debug dongle driver (only on TI)
75 #
76 DBG_SRC = \
77         ao_dbg.c
78
79 #
80 # Drivers only on TeleMetrum
81 #
82 TM_DRIVER_SRC = \
83         ao_adc.c \
84         ao_gps_report.c \
85         ao_ignite.c
86
87 #
88 # 25LC1024 driver source
89 EE_DRIVER_SRC = \
90         ao_ee.c
91
92 #
93 # AT45DB161D driver source
94
95 FLASH_DRIVER_SRC = \
96         ao_flash.c
97
98 #
99 # SiRF driver source
100 #
101 SIRF_DRIVER_SRC = \
102         ao_gps_sirf.c
103 #
104 # Skytraq driver source
105 #
106 SKY_DRIVER_SRC = \
107         ao_gps_skytraq.c
108
109 #
110 # Tasks run on TeleMetrum
111 #
112 TM_TASK_SRC = \
113         ao_flight.c \
114         ao_log.c \
115         ao_report.c \
116         ao_telemetry.c
117
118 TM_MAIN_SRC = \
119         ao_telemetrum.c
120
121 #
122 # Base sources for TeleMetrum
123 #
124 TM_BASE_SRC = \
125         $(ALTOS_SRC) \
126         $(ALTOS_DRIVER_SRC) \
127         $(TELE_DRIVER_SRC) \
128         $(TELE_COMMON_SRC) \
129         $(TM_DRIVER_SRC) \
130         $(TM_TASK_SRC) \
131         $(TM_MAIN_SRC)
132
133 TI_MAIN_SRC = \
134         ao_tidongle.c
135
136 #
137 # All sources for the TI debug dongle
138 #
139 TI_SRC = \
140         $(ALTOS_SRC) \
141         $(ALTOS_DRIVER_SRC) \
142         $(TELE_RECEIVER_SRC) \
143         $(TELE_COMMON_SRC) \
144         $(TI_MAIN_SRC) \
145         $(DBG_SRC)
146
147 TT_MAIN_SRC = \
148         ao_teleterra.c
149 #
150 # All sources for TeleTerra
151 #
152 TT_SRC = \
153         $(ALTOS_SRC) \
154         $(ALTOS_DRIVER_SRC) \
155         $(TELE_RECEIVER_SRC) \
156         $(TELE_DRIVER_SRC) \
157         $(TELE_COMMON_SRC) \
158         $(TT_MAIN_SRC)
159
160
161 #
162 # Sources for TeleDongle
163 #
164
165 TD_MAIN_SRC = \
166         ao_teledongle.c
167
168 TD_SRC = \
169         $(ALTOS_SRC) \
170         $(ALTOS_DRIVER_SRC) \
171         $(TELE_RECEIVER_SRC) \
172         $(TELE_COMMON_SRC) \
173         $(TD_MAIN_SRC)
174
175 include Makefile.defs
176
177 CFLAGS += $(PRODUCT_DEF) -I.
178
179 NICKLE=nickle
180 CHECK_STACK=sh ../check-stack
181
182 REL=$(SRC:.c=.rel) ao_product.rel
183 ADB=$(REL:.rel=.adb)
184 ASM=$(REL:.rel=.asm)
185 LNK=$(REL:.rel=.lnk)
186 LST=$(REL:.rel=.lst)
187 RST=$(REL:.rel=.rst)
188 SYM=$(REL:.rel=.sym)
189
190 PCDB=$(PROG:.ihx=.cdb)
191 PLNK=$(PROG:.ihx=.lnk)
192 PMAP=$(PROG:.ihx=.map)
193 PMEM=$(PROG:.ihx=.mem)
194 PAOM=$(PROG:.ihx=)
195
196 V=0
197 # The user has explicitly enabled quiet compilation.
198 ifeq ($(V),0)
199 quiet = @printf "  $1 $2 $@\n"; $($1)
200 endif
201 # Otherwise, print the full command line.
202 quiet ?= $($1)
203
204 %.rel : %.c $(INC)
205         $(call quiet,CC,$(PRODUCT_DEF)) $(CFLAGS) -c -o$@ $<
206
207 all: ../$(PROG)
208
209 ../$(PROG): $(REL) Makefile Makefile.defs ../Makefile.proto
210         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
211         $(call quiet,CHECK_STACK) ../ao.h $(PMEM)
212
213 ../altitude.h: make-altitude
214         nickle $< > $@
215
216 ao_product.h: ao-make-product.5c
217         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -p $(PRODUCT) -v $(VERSION) > $@
218
219 ao_product.rel: ao_product.c ao_product.h
220         $(call quiet,CC) -c $(CFLAGS) -D PRODUCT_DEFS='\"ao_product.h\"' -o$@ $<
221
222 distclean:      clean
223
224 clean:
225         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
226         rm -f $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
227         rm -f ao_product.h
228         rm -f ../$(PROG)
229
230 install:
231
232 uninstall: