583805f6f821c2fdd72fdb1aa7141232de73b3cb
[fw/altos] / src / teleterra-v0.2 / Makefile
1 #
2 # TeleTerra build file
3 #
4
5 vpath %.c ..:../core:../cc1111:../drivers:../product
6 vpath %.h ..:../core:../cc1111:../drivers:../product
7 vpath ao-make-product.5c ../util
8
9 ifndef VERSION
10 include ../Version
11 endif
12
13 INC = \
14         ao.h \
15         ao_pins.h \
16         cc1111.h \
17         ao_product.h
18
19 CORE_SRC = \
20         ao_cmd.c \
21         ao_config.c \
22         ao_monitor.c \
23         ao_log_single.c \
24         ao_log_telem.c \
25         ao_mutex.c \
26         ao_panic.c \
27         ao_report.c \
28         ao_rssi.c \
29         ao_sqrt.c \
30         ao_state.c \
31         ao_stdio.c \
32         ao_storage.c \
33         ao_task.c
34
35 CC1111_SRC = \
36         ao_battery.c \
37         ao_beep.c \
38         ao_button.c \
39         ao_dbg.c \
40         ao_dma.c \
41         ao_led.c \
42         ao_packet.c \
43         ao_packet_master.c \
44         ao_radio.c \
45         ao_romconfig.c \
46         ao_serial.c \
47         ao_spi.c \
48         ao_string.c \
49         ao_timer.c \
50         ao_usb.c \
51         ao_lcd_port.c \
52         _bp.c
53
54 DRIVER_SRC = \
55         ao_m25.c \
56         ao_lcd.c \
57         ao_gps_skytraq.c
58
59 PRODUCT_SRC = \
60         ao_teleterra_0_2.c \
61         ao_terraui.c
62
63 SRC = \
64         $(CORE_SRC) \
65         $(CC1111_SRC) \
66         $(DRIVER_SRC) \
67         $(PRODUCT_SRC)
68
69 TELETERRA_VER=0.2
70 TELETERRA_DEF=0_2
71 PROG = teleterra-v$(TELETERRA_VER)-$(VERSION).ihx
72 PRODUCT=TeleTerra-v$(TELETERRA_VER)
73 PRODUCT_DEF=-DTELETERRA_V_$(TELETERRA_DEF)
74 IDPRODUCT=0x000d
75
76 include ../cc1111/Makefile.cc1111
77
78 NICKLE=nickle
79 CHECK_STACK=sh ../util/check-stack
80
81 V=0
82 # The user has explicitly enabled quiet compilation.
83 ifeq ($(V),0)
84 quiet = @printf "  $1 $2 $@\n"; $($1)
85 endif
86 # Otherwise, print the full command line.
87 quiet ?= $($1)
88
89 all: ../$(PROG)
90
91 ../$(PROG): $(REL) Makefile
92         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
93         $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM)
94
95 ao_product.h: ao-make-product.5c ../Version
96         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
97
98 distclean:      clean
99
100 clean:
101         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
102         rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
103         rm -f ao_product.h
104         rm -f ../$(PROG) ../$(PMAP)
105
106 install:
107
108 uninstall:
109