altos: Restructure altos build to prepare for multi-arch support
[fw/altos] / src / product / Makefile.telebt
1 #
2 # TeleBT build file
3 #
4 # Define TELEBT_VER, TELEBT_DEF, TELEBT_INC and TELEBT_SRC
5 # and include this file
6
7 vpath %.c ..:../core:../cc1111:../drivers:../product
8 vpath %.h ..:../core:../cc1111:../drivers:../product
9 vpath ao-make-product.5c ../util
10
11 ifndef VERSION
12 include ../Version
13 endif
14
15 INC = \
16         ao.h \
17         ao_pins.h \
18         cc1111.h \
19         ao_product.h \
20         $(TELEBT_INC)
21
22 CORE_SRC = \
23         ao_cmd.c \
24         ao_config.c \
25         ao_gps_print.c \
26         ao_monitor.c \
27         ao_mutex.c \
28         ao_panic.c \
29         ao_rssi.c \
30         ao_state.c \
31         ao_stdio.c \
32         ao_task.c
33
34 CC1111_SRC = \
35         ao_dbg.c \
36         ao_dma.c \
37         ao_led.c \
38         ao_packet.c \
39         ao_packet_master.c \
40         ao_radio.c \
41         ao_romconfig.c \
42         ao_serial.c \
43         ao_timer.c \
44         ao_usb.c \
45         _bp.c
46
47 DRIVER_SRC = \
48         ao_btm.c
49
50 PRODUCT_SRC = \
51         ao_telebt.c
52
53 SRC = \
54         $(CORE_SRC) \
55         $(CC1111_SRC) \
56         $(DRIVER_SRC) \
57         $(PRODUCT_SRC) \
58         $(TELEBT_SRC)
59
60 PROG = telebt-v$(TELEBT_VER)-$(VERSION).ihx
61 PRODUCT=TeleBT-v$(TELEBT_VER)
62 PRODUCT_DEF=-DTELEBT_V_$(TELEBT_DEF)
63 IDPRODUCT=0x000e
64
65 include ../cc1111/Makefile.cc1111
66
67 NICKLE=nickle
68 CHECK_STACK=sh ../util/check-stack
69
70 V=0
71 # The user has explicitly enabled quiet compilation.
72 ifeq ($(V),0)
73 quiet = @printf "  $1 $2 $@\n"; $($1)
74 endif
75 # Otherwise, print the full command line.
76 quiet ?= $($1)
77
78 all: ../$(PROG)
79
80 ../$(PROG): $(REL) Makefile
81         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
82         $(call quiet,CHECK_STACK) ../core/ao.h $(PMEM)
83
84 ao_product.h: ao-make-product.5c ../Version
85         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
86
87 distclean:      clean
88
89 clean:
90         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
91         rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
92         rm -f ao_product.h
93         rm -f ../$(PROG) ../$(PMAP)
94
95 install:
96
97 uninstall: