altos: Add makefile for telelaunch
[fw/altos] / src / product / Makefile.telelaunch
1 #
2 # TeleLaunch build file
3 #
4 # define TELELAUNCH_VER, TELELAUNCH_DEF
5 # 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
21 CORE_SRC = \
22         ao_cmd.c \
23         ao_config.c \
24         ao_convert.c \
25         ao_mutex.c \
26         ao_panic.c \
27         ao_stdio.c \
28         ao_storage.c \
29         ao_task.c \
30         ao_sample.c
31
32 CC1111_SRC = \
33         ao_adc.c \
34         ao_beep.c \
35         ao_dbg.c \
36         ao_dma.c \
37         ao_ignite.c \
38         ao_led.c \
39         ao_packet.c \
40         ao_packet_slave.c \
41         ao_radio.c \
42         ao_romconfig.c \
43         ao_serial.c \
44         ao_spi.c \
45         ao_timer.c \
46         ao_usb.c \
47         _bp.c
48
49 DRIVER_SRC =
50
51 PRODUCT_SRC = \
52         ao_telelaunch.c
53
54 SRC = \
55         $(CORE_SRC) \
56         $(CC1111_SRC) \
57         $(DRIVER_SRC) \
58         $(PRODUCT_SRC)
59
60 PROG = telelaunch-v$(TELELAUNCH_VER)-$(VERSION).ihx
61 PRODUCT=TeleLaunch-v$(TELELAUNCH_VER)
62 PRODUCT_DEF=-DTELELAUNCH_V_$(TELELAUNCH_DEF)
63 IDPRODUCT=0x000f
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) ../cc1111/ao_arch.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: