]> git.gag.com Git - fw/altos/blob - src/telepyro-v0.1/Makefile
Build installable versions of MicroPeak GUI
[fw/altos] / src / telepyro-v0.1 / Makefile
1 #
2 # AltOS build
3 #
4 #
5 vpath % .:..:../core:../product:../drivers:../avr
6 vpath ao-make-product.5c ../util
7
8 MCU=atmega32u4
9 DUDECPUTYPE=m32u4
10 #PROGRAMMER=stk500v2 -P usb
11 PROGRAMMER=usbtiny
12 LOADCMD=avrdude
13 LOADARG=-p $(DUDECPUTYPE) -c $(PROGRAMMER) -e -U flash:w:
14 CC=avr-gcc
15 OBJCOPY=avr-objcopy
16
17 ifndef VERSION
18 include ../Version
19 endif
20
21 INC = \
22         ao.h \
23         ao_usb.h \
24         ao_pins.h \
25         ao_arch.h \
26         ao_arch_funcs.h \
27         ao_product.h
28
29 ALTOS_SRC = \
30         ao_clock.c \
31         ao_cmd.c \
32         ao_mutex.c \
33         ao_panic.c \
34         ao_product.c \
35         ao_stdio.c \
36         ao_task.c \
37         ao_timer.c \
38         ao_led.c \
39         ao_avr_stdio.c \
40         ao_romconfig.c \
41         ao_usb_avr.c \
42         ao_adc_avr.c \
43         ao_pyro_slave.c \
44         ao_spi_slave.c \
45         ao_eeprom_avr.c \
46         ao_storage.c \
47         ao_config.c \
48         ao_pyro.c
49
50 PRODUCT=TelePyro-v0.1
51 MCU=atmega32u4
52 PRODUCT_DEF=-DTELEPYRO
53 IDPRODUCT=0x0011
54 CFLAGS = $(PRODUCT_DEF) -I. -I../avr -I../core -I..
55 CFLAGS += -mmcu=$(MCU) -Wall -Wstrict-prototypes -O3 -mcall-prologues -DAVR
56
57 NICKLE=nickle
58
59 PROG=telepyro-v0.1
60
61 SRC=$(ALTOS_SRC) ao_telepyro.c
62 OBJ=$(SRC:.c=.o)
63
64 V=0
65 # The user has explicitly enabled quiet compilation.
66 ifeq ($(V),0)
67 quiet = @printf "  $1 $2 $@\n"; $($1)
68 endif
69 # Otherwise, print the full command line.
70 quiet ?= $($1)
71
72 all: $(PROG)
73
74 CHECK=sh ../util/check-avr-mem
75
76 $(PROG): Makefile $(OBJ)
77         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ)
78         $(call quiet,CHECK) $(PROG) || ($(RM) -f $(PROG); exit 1)
79
80 $(PROG).hex: $(PROG)
81         avr-size $(PROG)
82         $(OBJCOPY) -R .eeprom -O ihex $(PROG) $@
83
84
85 load: $(PROG).hex
86         $(LOADCMD) $(LOADARG)$(PROG).hex
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 ao_product.o: ao_product.c ao_product.h
92
93 %.o : %.c
94         $(call quiet,CC) -c $(CFLAGS) $<
95
96 distclean:      clean
97
98 clean:
99         rm -f $(OBJ) $(PROG) $(PROG).hex
100         rm -f ao_product.h
101
102 install:
103
104 uninstall:
105
106 $(OBJ): $(INC)