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