40fc6bc257efcd16c2ec6d0ec4f4ade89ed6a094
[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         cc1111.h \
22         altitude.h \
23         ao_kalman.h \
24         ao_product.h \
25         $(TM_INC)
26
27 CORE_SRC = \
28         ao_cmd.c \
29         ao_config.c \
30         ao_convert.c \
31         ao_gps_report.c \
32         ao_mutex.c \
33         ao_panic.c \
34         ao_stdio.c \
35         ao_storage.c \
36         ao_task.c \
37         ao_flight.c \
38         ao_sample.c \
39         ao_kalman.c \
40         ao_log.c \
41         ao_log_big.c \
42         ao_report.c \
43         ao_telemetry.c
44
45 CC1111_SRC = \
46         ao_adc.c \
47         ao_beep.c \
48         ao_dbg.c \
49         ao_dma.c \
50         ao_ignite.c \
51         ao_led.c \
52         ao_packet.c \
53         ao_packet_slave.c \
54         ao_radio.c \
55         ao_romconfig.c \
56         ao_serial.c \
57         ao_string.c \
58         ao_spi.c \
59         ao_timer.c \
60         ao_usb.c \
61         _bp.c
62
63 DRIVER_SRC = \
64         $(TM_SRC)
65
66 PRODUCT_SRC = \
67         ao_telemetrum.c
68
69 SRC = \
70         $(CORE_SRC) \
71         $(CC1111_SRC) \
72         $(DRIVER_SRC) \
73         $(PRODUCT_SRC)
74
75 PROG = telemetrum-v$(TM_VER)-$(VERSION)$(TM_EXTRA).ihx
76 PRODUCT=TeleMetrum-v$(TM_VER)
77 PRODUCT_DEF=-DTELEMETRUM_V_$(TM_DEF)
78 IDPRODUCT=0x000b
79
80 include ../cc1111/Makefile.cc1111
81
82 NICKLE=nickle
83 CHECK_STACK=sh ../util/check-stack
84
85 V=0
86 # The user has explicitly enabled quiet compilation.
87 ifeq ($(V),0)
88 quiet = @printf "  $1 $2 $@\n"; $($1)
89 endif
90 # Otherwise, print the full command line.
91 quiet ?= $($1)
92
93 all: ../$(PROG)
94
95 ../$(PROG): $(REL) Makefile
96         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
97         $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
98
99 ao_product.h: ao-make-product.5c ../Version
100         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
101
102 distclean:      clean
103
104 clean:
105         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
106         rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
107         rm -f ao_product.h
108         rm -f ../$(PROG) ../$(PMAP)
109
110 install:
111
112 uninstall: