Set telemetry rate to 100ms
[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 0xf00 --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
66 #
67 # Tasks run on TeleMetrum
68 #
69 TM_TASK_SRC = \
70         ao_flight.c \
71         ao_log.c \
72         ao_report.c \
73         ao_telemetry.c \
74         ao_telemetrum.c
75
76 #
77 # All sources for TeleMetrum
78 #
79 TM_SRC = \
80         $(ALTOS_SRC) \
81         $(ALTOS_DRIVER_SRC) \
82         $(TELE_DRIVER_SRC) \
83         $(TELE_COMMON_SRC) \
84         $(TM_DRIVER_SRC) \
85         $(TM_TASK_SRC)
86
87 TI_TASK_SRC = \
88         ao_tidongle.c
89
90 #
91 # All sources for the TI debug dongle
92 #
93 TI_SRC = \
94         $(ALTOS_SRC) \
95         $(ALTOS_DRIVER_SRC) \
96         $(TELE_RECEIVER_SRC) \
97         $(TELE_COMMON_SRC) \
98         $(TI_TASK_SRC)
99         
100 TT_TASK_SRC = \
101         ao_teleterra.c
102 #
103 # All sources for TeleTerra
104 #
105 TT_SRC = \
106         $(ALTOS_SRC) \
107         $(ALTOS_DRIVER_SRC) \
108         $(TELE_RECEIVER_SRC) \
109         $(TELE_DRIVER_SRC) \
110         $(TELE_COMMON_SRC) \
111         $(TT_TASK_SRC)
112         
113         
114 SRC = \
115         $(ALTOS_SRC) \
116         $(ALTOS_DRIVER_SRC) \
117         $(TELE_DRIVER_SRC) \
118         $(TELE_RECEIVER_SRC) \
119         $(TELE_COMMON_SRC) \
120         $(TM_DRIVER_SRC) \
121         $(TM_TASK_SRC) \
122         $(TI_TASK_SRC) \
123         $(TT_TASK_SRC)
124
125 TM_REL=$(TM_SRC:.c=.rel)
126 TI_REL=$(TI_SRC:.c=.rel)
127 TT_REL=$(TT_SRC:.c=.rel)
128
129 ADB=$(SRC:.c=.adb)
130 ASM=$(SRC:.c=.asm)
131 LNK=$(SRC:.c=.lnk)
132 LST=$(SRC:.c=.lst)
133 REL=$(SRC:.c=.rel)
134 RST=$(SRC:.c=.rst)
135 SYM=$(SRC:.c=.sym)
136
137 PROGS=telemetrum.ihx tidongle.ihx teleterra.ihx
138 PCDB=$(PROGS:.ihx=.cdb)
139 PLNK=$(PROGS:.ihx=.lnk)
140 PMAP=$(PROGS:.ihx=.map)
141 PMEM=$(PROGS:.ihx=.mem)
142 PAOM=$(PROGS:.ihx=)
143
144 %.rel : %.c $(INC)
145         $(CC) -c $(CFLAGS) -o$*.rel $*.c
146
147 all: $(PROGS)
148
149 telemetrum.ihx: $(TM_REL) Makefile
150         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TM_REL)
151         sh check-stack ao.h telemetrum.mem
152
153 tidongle.ihx: $(TI_REL) Makefile
154         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TI_REL)
155         sh check-stack ao.h tidongle.mem
156
157 tidongle.ihx: telemetrum.ihx
158
159 teleterra.ihx: $(TT_REL) Makefile
160         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TT_REL)
161         sh check-stack ao.h teleterra.mem
162
163 teleterra.ihx: tidongle.ihx
164
165 altitude.h: make-altitude
166         nickle make-altitude > altitude.h
167
168 clean:
169         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
170         rm -f $(PROGS) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
171
172 install: