altos: Have 'make clean' remove all programs, even old ones
[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         ao_arch.h \
22         ao_arch_funcs.h \
23         cc1111.h \
24         ao_product.h
25
26 CORE_SRC = \
27         ao_cmd.c \
28         ao_config.c \
29         ao_gps_print.c \
30         ao_monitor.c \
31         ao_mutex.c \
32         ao_panic.c \
33         ao_rssi.c \
34         ao_state.c \
35         ao_stdio.c \
36         ao_task.c \
37         ao_freq.c
38
39 CC1111_SRC = \
40         ao_dbg.c \
41         ao_dma.c \
42         ao_led.c \
43         ao_packet.c \
44         ao_packet_master.c \
45         ao_radio.c \
46         ao_romconfig.c \
47         ao_string.c \
48         ao_timer.c \
49         ao_usb.c \
50         _bp.c
51
52 DRIVER_SRC =
53
54 PRODUCT_SRC = \
55         ao_teledongle.c
56
57 SRC = \
58         $(CORE_SRC) \
59         $(CC1111_SRC) \
60         $(DRIVER_SRC) \
61         $(PRODUCT_SRC)
62
63 PROGNAME = teledongle-v$(TD_VER)
64 PROG = $(PROGNAME)-$(VERSION).ihx
65 PRODUCT=TeleDongle-v$(TD_VER)
66 PRODUCT_DEF=-DTELEDONGLE_V_$(TD_DEF)
67 IDPRODUCT=0x000c
68
69 include ../cc1111/Makefile.cc1111
70
71 NICKLE=nickle
72 CHECK_STACK=sh ../util/check-stack
73
74 V=0
75 # The user has explicitly enabled quiet compilation.
76 ifeq ($(V),0)
77 quiet = @printf "  $1 $2 $@\n"; $($1)
78 endif
79 # Otherwise, print the full command line.
80 quiet ?= $($1)
81
82 all: ../$(PROG)
83
84 ../$(PROG): $(REL) Makefile
85         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
86         $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM) || rm $@
87
88 ao_product.h: ao-make-product.5c ../Version
89         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
90
91 distclean:      clean
92
93 clean: clean-cc1111
94
95 install:
96
97 uninstall: