altos: Restructure altos build to prepare for multi-arch support
[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_dbg.c \
38         ao_dma.c \
39         ao_led.c \
40         ao_packet.c \
41         ao_packet_master.c \
42         ao_radio.c \
43         ao_romconfig.c \
44         ao_timer.c \
45         ao_usb.c \
46         _bp.c
47
48 DRIVER_SRC =
49
50 PRODUCT_SRC = \
51         ao_teledongle.c
52
53 SRC = \
54         $(CORE_SRC) \
55         $(CC1111_SRC) \
56         $(DRIVER_SRC) \
57         $(PRODUCT_SRC)
58
59 PROG = teledongle-v$(TD_VER)-$(VERSION).ihx
60 PRODUCT=TeleDongle-v$(TD_VER)
61 PRODUCT_DEF=-DTELEDONGLE_V_$(TD_DEF)
62 IDPRODUCT=0x000c
63
64 include ../cc1111/Makefile.cc1111
65
66 NICKLE=nickle
67 CHECK_STACK=sh ../util/check-stack
68
69 V=0
70 # The user has explicitly enabled quiet compilation.
71 ifeq ($(V),0)
72 quiet = @printf "  $1 $2 $@\n"; $($1)
73 endif
74 # Otherwise, print the full command line.
75 quiet ?= $($1)
76
77 all: ../$(PROG)
78
79 ../$(PROG): $(REL) Makefile
80         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
81         $(call quiet,CHECK_STACK) ../core/ao.h $(PMEM)
82
83 ao_product.h: ao-make-product.5c ../Version
84         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
85
86 distclean:      clean
87
88 clean:
89         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
90         rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
91         rm -f ao_product.h
92         rm -f ../$(PROG) ../$(PMAP)
93
94 install:
95
96 uninstall: