]> git.gag.com Git - fw/altos/blob - Makefile
Fix up fancy dbg stuff. Add teleterra initial bits.
[fw/altos] / Makefile
1 #
2 # AltOS build
3 #
4
5 CC=/usr/bin/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
124 TM_REL=$(TM_SRC:.c=.rel)
125 TI_REL=$(TI_SRC:.c=.rel)
126 TT_REL=$(TT_SRC:.c=.rel)
127
128 ADB=$(SRC:.c=.adb)
129 ASM=$(SRC:.c=.asm)
130 LNK=$(SRC:.c=.lnk)
131 LST=$(SRC:.c=.lst)
132 REL=$(SRC:.c=.rel)
133 RST=$(SRC:.c=.rst)
134 SYM=$(SRC:.c=.sym)
135
136 PROGS=telemetrum.ihx tidongle.ihx teleterra.ihx
137 PCDB=$(PROGS:.ihx=.cdb)
138 PLNK=$(PROGS:.ihx=.lnk)
139 PMAP=$(PROGS:.ihx=.map)
140 PMEM=$(PROGS:.ihx=.mem)
141 PAOM=$(PROGS:.ihx=)
142
143 %.rel : %.c $(INC)
144         $(CC) -c $(CFLAGS) -o$*.rel $*.c
145
146 all: $(PROGS)
147
148 telemetrum.ihx: $(TM_REL) Makefile
149         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TM_REL)
150         sh check-stack ao.h telemetrum.mem
151
152 tidongle.ihx: $(TI_REL) Makefile
153         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TI_REL)
154         sh check-stack ao.h tidongle.mem
155
156 tidongle.ihx: telemetrum.ihx
157
158 teleterra.ihx: $(TT_REL) Makefile
159         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(TT_REL)
160         sh check-stack ao.h teleterra.mem
161
162 teleterra.ihx: tidongle.ihx
163
164 altitude.h: make-altitude
165         nickle make-altitude > altitude.h
166
167 clean:
168         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
169         rm -f $(PROGS) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
170
171 install: