]> git.gag.com Git - fw/altos/blob - src/telescience-pwm/Makefile
altos/lisp: Empty lambda body is not an error
[fw/altos] / src / telescience-pwm / Makefile
1 #
2 # AltOS build
3 #
4 #
5 vpath % ..:../kernel:../product:../drivers:../avr
6 vpath ao-make-product.5c ../util
7
8 include ../avr/Makefile.defs
9
10 MCU=atmega32u4
11 DUDECPUTYPE=m32u4
12 #PROGRAMMER=stk500v2 -P usb
13 LOADARG=-p $(DUDECPUTYPE) -c $(PROGRAMMER) -e -U flash:w:
14
15 #LDFLAGS=-L$(LDSCRIPTS) -Tavr5.x
16
17 INC = \
18         ao.h \
19         ao_arch.h \
20         ao_usb.h \
21         ao_pins.h \
22         ao_product.h
23
24 #
25 # Common AltOS sources
26 #
27 TELESCIENCE_STORAGE= \
28         ao_m25.c \
29         ao_spi_usart.c \
30         ao_storage.c
31
32 TELESCIENCE_LOG= \
33         ao_log_single.c \
34         ao_log_telescience.c
35
36 ALTOS_SRC = \
37         ao_clock.c \
38         ao_cmd.c \
39         ao_mutex.c \
40         ao_panic.c \
41         ao_product.c \
42         ao_stdio.c \
43         ao_task.c \
44         ao_timer.c \
45         ao_led.c \
46         ao_avr_stdio.c \
47         ao_romconfig.c \
48         ao_usb_avr.c \
49         ao_adc_avr.c \
50         ao_science_slave.c \
51         ao_spi_slave.c \
52         ao_pwmin.c \
53         $(TELESCIENCE_STORAGE)\
54         $(TELESCIENCE_LOG)
55
56 PRODUCT=TeleScience-PWM
57 MCU=atmega32u4
58 PRODUCT_DEF=-DTELESCIENCE -DTELESCIENCE_PWM
59 IDPRODUCT=0x0011
60 CFLAGS = $(PRODUCT_DEF) -I. -I../avr -I../kernel -I..
61 CFLAGS += -g -mmcu=$(MCU) -Wall -Wstrict-prototypes -O3 -mcall-prologues -DAVR
62
63 NICKLE=nickle
64
65 PROG=telescience-pwm
66
67 SRC=$(ALTOS_SRC) ao_telescience.c
68 OBJ=$(SRC:.c=.o)
69
70 V=0
71 # The user has explicitly enabled quiet compilation.
72 ifeq ($(V),0)
73 quiet = @printf "  $1 $2 $@\n"; $($1)
74 endif
75 # Otherwise, print the full command line.
76 quiet ?= $($1)
77
78 all: $(PROG)
79
80 CHECK=sh ../util/check-avr-mem
81
82 $(PROG): Makefile $(OBJ)
83         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ)
84         $(call quiet,CHECK) $(PROG) || ($(RM) -f $(PROG); exit 1)
85
86 $(PROG).hex: $(PROG)
87         avr-size $(PROG)
88         $(OBJCOPY) -R .eeprom -O ihex $(PROG) $@
89
90
91 load: $(PROG).hex
92         $(LOADCMD) $(LOADARG)$(PROG).hex
93
94 ao_product.h: ao-make-product.5c ../Version
95         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
96
97 ao_product.o: ao_product.c ao_product.h
98
99 %.o : %.c $(INC)
100         $(call quiet,CC) -c $(CFLAGS) $<
101
102 distclean:      clean
103
104 clean:
105         rm -f *.o $(PROG) $(PROG).hex
106         rm -f ao_product.h
107
108 install:
109
110 uninstall:
111
112 $(OBJ): ao_product.h $(INC)