Add igniters and update flight control algorithm
[fw/altos] / Makefile
1 #
2 # AltOS build
3 #
4
5 CC=sdcc
6
7 CFLAGS=--model-small --debug --opt-code-speed 
8
9 LDFLAGS=--out-fmt-ihx --code-loc 0x0000 --code-size 0x8000 \
10         --xram-loc 0xf000 --xram-size 0xda2 --iram-size 0xff
11
12 INC = \
13         ao.h \
14         cc1111.h \
15         altitude.h \
16         25lc1024.h
17
18 #
19 # Common AltOS sources
20 #
21 ALTOS_SRC = \
22         ao_cmd.c \
23         ao_dbg.c \
24         ao_dma.c \
25         ao_mutex.c \
26         ao_panic.c \
27         ao_task.c \
28         ao_timer.c \
29         _bp.c
30
31 #
32 # Shared AltOS drivers
33 #
34 ALTOS_DRIVER_SRC = \
35         ao_beep.c \
36         ao_led.c \
37         ao_radio.c \
38         ao_stdio.c \
39         ao_usb.c
40
41 TELE_COMMON_SRC = \
42         ao_gps_print.c
43
44 #
45 # Receiver code
46 #
47 TELE_RECEIVER_SRC =\
48         ao_monitor.c
49
50 #
51 # Shared Tele drivers (on TeleMetrum, TeleTerra, TeleDongle)
52 #
53
54 TELE_DRIVER_SRC = \
55         ao_convert.c \
56         ao_gps.c \
57         ao_serial.c
58
59
60 # Drivers only on TeleMetrum
61 #
62 TM_DRIVER_SRC = \
63         ao_adc.c \
64         ao_ee.c \
65         ao_ignite.c
66
67 #
68 # Tasks run on TeleMetrum
69 #
70 TM_TASK_SRC = \
71         ao_flight.c \
72         ao_log.c \
73         ao_report.c \
74         ao_telemetry.c \
75         ao_telemetrum.c
76
77 #
78 # All sources for TeleMetrum
79 #
80 TM_SRC = \
81         $(ALTOS_SRC) \
82         $(ALTOS_DRIVER_SRC) \
83         $(TELE_DRIVER_SRC) \
84         $(TELE_COMMON_SRC) \
85         $(TM_DRIVER_SRC) \
86         $(TM_TASK_SRC)
87
88 TI_TASK_SRC = \
89         ao_tidongle.c
90
91 #
92 # All sources for the TI debug dongle
93 #
94 TI_SRC = \
95         $(ALTOS_SRC) \
96         $(ALTOS_DRIVER_SRC) \
97         $(TELE_RECEIVER_SRC) \
98         $(TELE_COMMON_SRC) \
99         $(TI_TASK_SRC)
100         
101 TT_TASK_SRC = \
102         ao_teleterra.c
103 #
104 # All sources for TeleTerra
105 #
106 TT_SRC = \
107         $(ALTOS_SRC) \
108         $(ALTOS_DRIVER_SRC) \
109         $(TELE_RECEIVER_SRC) \
110         $(TELE_DRIVER_SRC) \
111         $(TELE_COMMON_SRC) \
112         $(TT_TASK_SRC)
113         
114         
115 #
116 # Sources for TeleDongle
117 #
118
119 TD_TASK_SRC = \
120         ao_teledongle.c
121
122 TD_SRC = \
123         $(ALTOS_SRC) \
124         $(ALTOS_DRIVER_SRC) \
125         $(TELE_RECEIVER_SRC) \
126         $(TELE_COMMON_SRC) \
127         $(TD_TASK_SRC)
128
129 SRC = \
130         $(ALTOS_SRC) \
131         $(ALTOS_DRIVER_SRC) \
132         $(TELE_DRIVER_SRC) \
133         $(TELE_RECEIVER_SRC) \
134         $(TELE_COMMON_SRC) \
135         $(TM_DRIVER_SRC) \
136         $(TM_TASK_SRC) \
137         $(TI_TASK_SRC) \
138         $(TT_TASK_SRC) \
139         $(TD_TASK_SRC)
140
141 TM_REL=$(TM_SRC:.c=.rel)
142 TI_REL=$(TI_SRC:.c=.rel)
143 TT_REL=$(TT_SRC:.c=.rel)
144 TD_REL=$(TD_SRC:.c=.rel)
145
146 ADB=$(SRC:.c=.adb)
147 ASM=$(SRC:.c=.asm)
148 LNK=$(SRC:.c=.lnk)
149 LST=$(SRC:.c=.lst)
150 REL=$(SRC:.c=.rel)
151 RST=$(SRC:.c=.rst)
152 SYM=$(SRC:.c=.sym)
153
154 PROGS=telemetrum.ihx tidongle.ihx teleterra.ihx teledongle.ihx
155
156 PCDB=$(PROGS:.ihx=.cdb)
157 PLNK=$(PROGS:.ihx=.lnk)
158 PMAP=$(PROGS:.ihx=.map)
159 PMEM=$(PROGS:.ihx=.mem)
160 PAOM=$(PROGS:.ihx=)
161
162 %.rel : %.c $(INC)
163         $(CC) -c $(CFLAGS) -o$*.rel $*.c
164
165 all: $(PROGS)
166
167 telemetrum.ihx: $(TM_REL) Makefile
168         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TM_REL)
169         sh check-stack ao.h telemetrum.mem
170
171 tidongle.ihx: $(TI_REL) Makefile
172         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TI_REL)
173         sh check-stack ao.h tidongle.mem
174
175 tidongle.ihx: telemetrum.ihx
176
177 teleterra.ihx: $(TT_REL) Makefile
178         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TT_REL)
179         sh check-stack ao.h teleterra.mem
180
181 teleterra.ihx: tidongle.ihx
182
183 teledongle.ihx: $(TD_REL) Makefile
184         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TD_REL)
185         sh check-stack ao.h teledongle.mem
186
187 teledongle.ihx: teleterra.ihx
188
189 altitude.h: make-altitude
190         nickle make-altitude > altitude.h
191
192 clean:
193         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
194         rm -f $(PROGS) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
195
196 install:
197
198 ao_flight_test: ao_flight.c ao_flight_test.c
199         cc -g -o $@ ao_flight_test.c