altos: Check pdata+xdata memory usage during build
[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_sqrt.c \
29         ao_stdio.c \
30         ao_storage.c \
31         ao_task.c
32
33 CC1111_SRC = \
34         ao_battery.c \
35         ao_beep.c \
36         ao_button.c \
37         ao_dbg.c \
38         ao_dma.c \
39         ao_packet.c \
40         ao_packet_master.c \
41         ao_radio.c \
42         ao_romconfig.c \
43         ao_serial.c \
44         ao_spi.c \
45         ao_string.c \
46         ao_timer.c \
47         ao_usb.c \
48         ao_lcd_port.c \
49         _bp.c
50
51 DRIVER_SRC = \
52         ao_m25.c \
53         ao_lcd.c \
54         ao_gps_skytraq.c
55
56 PRODUCT_SRC = \
57         ao_teleterra_0_2.c \
58         ao_terraui.c
59
60 SRC = \
61         $(CORE_SRC) \
62         $(CC1111_SRC) \
63         $(DRIVER_SRC) \
64         $(PRODUCT_SRC)
65
66 TELETERRA_VER=0.2
67 TELETERRA_DEF=0_2
68 PROG = teleterra-v$(TELETERRA_VER)-$(VERSION).ihx
69 PRODUCT=TeleTerra-v$(TELETERRA_VER)
70 PRODUCT_DEF=-DTELETERRA_V_$(TELETERRA_DEF)
71 IDPRODUCT=0x000d
72
73 include ../cc1111/Makefile.cc1111
74
75 NICKLE=nickle
76 CHECK_STACK=sh ../util/check-stack
77
78 V=0
79 # The user has explicitly enabled quiet compilation.
80 ifeq ($(V),0)
81 quiet = @printf "  $1 $2 $@\n"; $($1)
82 endif
83 # Otherwise, print the full command line.
84 quiet ?= $($1)
85
86 all: ../$(PROG)
87
88 ../$(PROG): $(REL) Makefile
89         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
90         $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM) || rm $@
91
92 ao_product.h: ao-make-product.5c ../Version
93         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
94
95 distclean:      clean
96
97 clean:
98         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
99         rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
100         rm -f ao_product.h
101         rm -f ../$(PROG) ../$(PMAP)
102
103 install:
104
105 uninstall:
106