altos: Make cc1111 products all depend on ao_arch.h and ao_arch_func.h
[fw/altos] / src / product / Makefile.telemetrum
1 #
2 # TeleMetrum build file
3 #
4 # The various telemetrum versions differ only
5 # in which flash and GPS drivers are included,
6 # so the per-board makefiles simply define
7 # TM_VER, TM_DEF, TM_INC and TM_SRC and include
8 # this file
9
10 vpath %.c .:..:../core:../cc1111:../drivers:../product
11 vpath %.h .:..:../core:../cc1111:../drivers:../product
12 vpath ao-make-product.5c ../util
13
14 ifndef VERSION
15 include ../Version
16 endif
17
18 INC = \
19         ao.h \
20         ao_pins.h \
21         ao_arch.h \
22         ao_arch_funcs.h \
23         cc1111.h \
24         altitude.h \
25         ao_kalman.h \
26         ao_product.h \
27         $(TM_INC)
28
29 CORE_SRC = \
30         ao_cmd.c \
31         ao_config.c \
32         ao_convert.c \
33         ao_gps_report.c \
34         ao_mutex.c \
35         ao_panic.c \
36         ao_stdio.c \
37         ao_storage.c \
38         ao_task.c \
39         ao_flight_mm.c \
40         ao_sample_mm.c \
41         ao_kalman.c \
42         ao_log.c \
43         ao_log_big.c \
44         ao_report.c \
45         ao_telemetry.c \
46         ao_freq.c
47
48 CC1111_SRC = \
49         ao_adc.c \
50         ao_beep.c \
51         ao_dbg.c \
52         ao_dma.c \
53         ao_ignite.c \
54         ao_led.c \
55         ao_packet.c \
56         ao_packet_slave.c \
57         ao_radio.c \
58         ao_romconfig.c \
59         ao_serial.c \
60         ao_string.c \
61         ao_spi.c \
62         ao_timer.c \
63         ao_usb.c \
64         _bp.c
65
66 DRIVER_SRC = \
67         $(TM_SRC)
68
69 PRODUCT_SRC = \
70         ao_telemetrum.c
71
72 SRC = \
73         $(CORE_SRC) \
74         $(CC1111_SRC) \
75         $(DRIVER_SRC) \
76         $(PRODUCT_SRC)
77
78 PROG = telemetrum-v$(TM_VER)-$(VERSION)$(TM_EXTRA).ihx
79 PRODUCT=TeleMetrum-v$(TM_VER)
80 PRODUCT_DEF=-DTELEMETRUM_V_$(TM_DEF)
81 IDPRODUCT=0x000b
82
83 include ../cc1111/Makefile.cc1111
84
85 NICKLE=nickle
86 CHECK_STACK=sh ../util/check-stack
87
88 V=0
89 # The user has explicitly enabled quiet compilation.
90 ifeq ($(V),0)
91 quiet = @printf "  $1 $2 $@\n"; $($1)
92 endif
93 # Otherwise, print the full command line.
94 quiet ?= $($1)
95
96 all: ../$(PROG)
97
98 ../$(PROG): $(REL) Makefile
99         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
100         $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM) || rm $@
101
102 ao_product.h: ao-make-product.5c ../Version
103         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
104
105 distclean:      clean
106
107 clean:
108         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
109         rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
110         rm -f ao_product.h
111         rm -f ../$(PROG) ../$(PMAP)
112
113 install:
114
115 uninstall: