56182b8494f7a357801e68ac3bd5400e6a8f1cf4
[fw/altos] / src / product / Makefile.teledongle
1 #
2 # TeleDongle build file
3 #
4 # The various teledongle versions differ only
5 # in minor pin variations
6 # so the per-board makefiles simply define
7 # TD_VER, TD_DEF 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         ao_product.h
23
24 CORE_SRC = \
25         ao_cmd.c \
26         ao_config.c \
27         ao_gps_print.c \
28         ao_monitor.c \
29         ao_mutex.c \
30         ao_panic.c \
31         ao_rssi.c \
32         ao_state.c \
33         ao_stdio.c \
34         ao_task.c
35
36 CC1111_SRC = \
37         ao_aes.c \
38         ao_dbg.c \
39         ao_dma.c \
40         ao_led.c \
41         ao_packet.c \
42         ao_packet_master.c \
43         ao_radio.c \
44         ao_radio_cmac.c \
45         ao_romconfig.c \
46         ao_timer.c \
47         ao_usb.c \
48         _bp.c
49
50 DRIVER_SRC =
51
52 PRODUCT_SRC = \
53         ao_teledongle.c
54
55 SRC = \
56         $(CORE_SRC) \
57         $(CC1111_SRC) \
58         $(DRIVER_SRC) \
59         $(PRODUCT_SRC)
60
61 PROG = teledongle-v$(TD_VER)-$(VERSION).ihx
62 PRODUCT=TeleDongle-v$(TD_VER)
63 PRODUCT_DEF=-DTELEDONGLE_V_$(TD_DEF)
64 IDPRODUCT=0x000c
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: