8f7c74296e8042646457bbdfd7d1ea556ad2b339
[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_state.c \
30         ao_stdio.c \
31         ao_task.c
32
33 CC1111_SRC = \
34         ao_aes.c \
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_radio_cmac.c \
42         ao_romconfig.c \
43         ao_serial.c \
44         ao_string.c \
45         ao_timer.c \
46         ao_usb.c \
47         _bp.c
48
49 DRIVER_SRC = \
50         ao_btm.c
51
52 PRODUCT_SRC = \
53         ao_telebt.c
54
55 SRC = \
56         $(CORE_SRC) \
57         $(CC1111_SRC) \
58         $(DRIVER_SRC) \
59         $(PRODUCT_SRC) \
60         $(TELEBT_SRC)
61
62 PROG = telebt-v$(TELEBT_VER)-$(VERSION).ihx
63 PRODUCT=TeleBT-v$(TELEBT_VER)
64 PRODUCT_DEF=-DTELEBT_V_$(TELEBT_DEF)
65 IDPRODUCT=0x000e
66
67 include ../cc1111/Makefile.cc1111
68
69 NICKLE=nickle
70 CHECK_STACK=sh ../util/check-stack
71
72 V=0
73 # The user has explicitly enabled quiet compilation.
74 ifeq ($(V),0)
75 quiet = @printf "  $1 $2 $@\n"; $($1)
76 endif
77 # Otherwise, print the full command line.
78 quiet ?= $($1)
79
80 all: ../$(PROG)
81
82 ../$(PROG): $(REL) Makefile
83         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
84         $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
85
86 ao_product.h: ao-make-product.5c ../Version
87         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
88
89 distclean:      clean
90
91 clean:
92         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
93         rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
94         rm -f ao_product.h
95         rm -f ../$(PROG) ../$(PMAP)
96
97 install:
98
99 uninstall: