Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos] / src / easymega-v2.0 / Makefile
1 #
2 # AltOS build
3 #
4 #
5
6 include ../stm/Makefile.defs
7
8 INC = \
9         ao.h \
10         ao_arch.h \
11         ao_arch_funcs.h \
12         ao_boot.h \
13         ao_companion.h \
14         ao_data.h \
15         ao_sample.h \
16         ao_pins.h \
17         altitude-pa.h \
18         ao_kalman.h \
19         ao_product.h \
20         ao_ms5607.h \
21         ao_mpu9250.h \
22         ao_adxl375.h \
23         ao_profile.h \
24         ao_task.h \
25         ao_whiten.h \
26         ao_sample_profile.h \
27         ao_quaternion.h \
28         ao_mpu.h \
29         stm32l.h \
30         Makefile
31
32 #
33 # Common AltOS sources
34 #
35
36 #PROFILE=ao_profile.c
37 #PROFILE_DEF=-DAO_PROFILE=1
38
39 #SAMPLE_PROFILE=ao_sample_profile.c \
40 #       ao_sample_profile_timer.c
41 #SAMPLE_PROFILE_DEF=-DHAS_SAMPLE_PROFILE=1
42
43 #STACK_GUARD=ao_mpu_stm.c
44 #STACK_GUARD_DEF=-DHAS_STACK_GUARD=1
45
46 ALTOS_SRC = \
47         ao_boot_chain.c \
48         ao_interrupt.c \
49         ao_product.c \
50         ao_romconfig.c \
51         ao_cmd.c \
52         ao_config.c \
53         ao_task.c \
54         ao_led_stm.c \
55         ao_stdio.c \
56         ao_panic.c \
57         ao_timer.c \
58         ao_mutex.c \
59         ao_ignite.c \
60         ao_freq.c \
61         ao_dma_stm.c \
62         ao_spi_stm.c \
63         ao_data.c \
64         ao_ms5607.c \
65         ao_mpu9250.c \
66         ao_adxl375.c \
67         ao_adc_stm.c \
68         ao_beep_stm.c \
69         ao_eeprom_stm.c \
70         ao_storage.c \
71         ao_m25.c \
72         ao_usb_stm.c \
73         ao_exti_stm.c \
74         ao_report.c \
75         ao_i2c_stm.c \
76         ao_convert_pa.c \
77         ao_convert_volt.c \
78         ao_log.c \
79         ao_log_mega.c \
80         ao_sample.c \
81         ao_kalman.c \
82         ao_flight.c \
83         ao_companion.c \
84         ao_pyro.c \
85         $(PROFILE) \
86         $(SAMPLE_PROFILE) \
87         $(STACK_GUARD)
88
89 PRODUCT=EasyMega-v2.0
90 PRODUCT_DEF=-DEASYMEGA
91 IDPRODUCT=0x0028
92
93 CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STACK_GUARD_DEF) -Os -g
94
95 PROGNAME=easymega-v2.0
96 PROG=$(PROGNAME)-$(VERSION).elf
97 HEX=$(PROGNAME)-$(VERSION).ihx
98
99 SRC=$(ALTOS_SRC) ao_easymega.c
100 OBJ=$(SRC:.c=.o)
101
102 all: $(PROG) $(HEX)
103
104 $(PROG): Makefile $(OBJ) altos.ld
105         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS)
106
107 ../altitude-pa.h: make-altitude-pa
108         nickle $< > $@
109
110 $(OBJ): $(INC)
111
112 ao_product.h: ao-make-product.5c ../Version
113         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
114
115 distclean:      clean
116
117 clean:
118         rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx
119         rm -f ao_product.h
120
121 install:
122
123 uninstall: