Merge remote-tracking branch 'origin/simple-quiet' into multiarch
[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_spi.c \
58         ao_timer.c \
59         ao_usb.c \
60         _bp.c
61
62 DRIVER_SRC = \
63         $(TM_SRC)
64
65 PRODUCT_SRC = \
66         ao_telemetrum.c
67
68 SRC = \
69         $(CORE_SRC) \
70         $(CC1111_SRC) \
71         $(DRIVER_SRC) \
72         $(PRODUCT_SRC)
73
74 PROG = telemetrum-v$(TM_VER)-$(VERSION).ihx
75 PRODUCT=TeleMetrum-v$(TM_VER)
76 PRODUCT_DEF=-DTELEMETRUM_V_$(TM_DEF)
77 IDPRODUCT=0x000b
78
79 include ../cc1111/Makefile.cc1111
80
81 NICKLE=nickle
82 CHECK_STACK=sh ../util/check-stack
83
84 V=0
85 # The user has explicitly enabled quiet compilation.
86 ifeq ($(V),0)
87 quiet = @printf "  $1 $2 $@\n"; $($1)
88 endif
89 # Otherwise, print the full command line.
90 quiet ?= $($1)
91
92 all: ../$(PROG)
93
94 ../$(PROG): $(REL) Makefile
95         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
96         $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
97
98 ao_product.h: ao-make-product.5c ../Version
99         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
100
101 distclean:      clean
102
103 clean:
104         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
105         rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
106         rm -f ao_product.h
107         rm -f ../$(PROG) ../$(PMAP)
108
109 install:
110
111 uninstall: