7 CFLAGS=--model-small --debug --opt-code-speed
9 LDFLAGS=--out-fmt-ihx --code-loc 0x0000 --code-size 0x8000 \
10 --xram-loc 0xf000 --xram-size 0xda2 --iram-size 0xff
19 # Common AltOS sources
32 # Shared AltOS drivers
51 # Shared Tele drivers (on TeleMetrum, TeleTerra, TeleDongle)
60 # Drivers only on TeleMetrum
68 # Tasks run on TeleMetrum
78 # All sources for TeleMetrum
84 $(TELE_RECEIVER_SRC) \
93 # All sources for the TI debug dongle
98 $(TELE_RECEIVER_SRC) \
105 # All sources for TeleTerra
109 $(ALTOS_DRIVER_SRC) \
110 $(TELE_RECEIVER_SRC) \
117 # Sources for TeleDongle
125 $(ALTOS_DRIVER_SRC) \
126 $(TELE_RECEIVER_SRC) \
132 $(ALTOS_DRIVER_SRC) \
134 $(TELE_RECEIVER_SRC) \
142 TM_REL=$(TM_SRC:.c=.rel)
143 TI_REL=$(TI_SRC:.c=.rel)
144 TT_REL=$(TT_SRC:.c=.rel)
145 TD_REL=$(TD_SRC:.c=.rel)
155 PROGS=telemetrum.ihx tidongle.ihx teleterra.ihx teledongle.ihx
157 HOST_PROGS=ao_flight_test
159 PCDB=$(PROGS:.ihx=.cdb)
160 PLNK=$(PROGS:.ihx=.lnk)
161 PMAP=$(PROGS:.ihx=.map)
162 PMEM=$(PROGS:.ihx=.mem)
166 $(CC) -c $(CFLAGS) -o$*.rel $*.c
168 all: $(PROGS) $(HOST_PROGS)
170 telemetrum.ihx: $(TM_REL) Makefile
171 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TM_REL)
172 sh check-stack ao.h telemetrum.mem
174 tidongle.ihx: $(TI_REL) Makefile
175 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TI_REL)
176 sh check-stack ao.h tidongle.mem
178 tidongle.ihx: telemetrum.ihx
180 teleterra.ihx: $(TT_REL) Makefile
181 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TT_REL)
182 sh check-stack ao.h teleterra.mem
184 teleterra.ihx: tidongle.ihx
186 teledongle.ihx: $(TD_REL) Makefile
187 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TD_REL)
188 sh check-stack ao.h teledongle.mem
190 teledongle.ihx: teleterra.ihx
192 altitude.h: make-altitude
193 nickle make-altitude > altitude.h
196 rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
197 rm -f $(PROGS) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
201 ao_flight_test: ao_flight.c ao_flight_test.c
202 cc -g -o $@ ao_flight_test.c