altos: Make STM clock configuration per-product. Fix 32MHz CPU speed
[fw/altos] / src / megametrum-v0.1 / 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_pins.h \
13         altitude.h \
14         ao_kalman.h \
15         ao_product.h \
16         ao_ms5607.h
17
18 #
19 # Common AltOS sources
20 #
21 ALTOS_SRC = \
22         ao_interrupt.c \
23         ao_product.c \
24         ao_romconfig.c \
25         ao_cmd.c \
26         ao_config.c \
27         ao_task.c \
28         ao_led.c \
29         ao_stdio.c \
30         ao_panic.c \
31         ao_timer.c \
32         ao_mutex.c \
33         ao_serial_stm.c \
34         ao_gps_skytraq.c \
35         ao_cc1120.c \
36         ao_freq.c \
37         ao_dma_stm.c \
38         ao_spi_stm.c \
39         ao_ms5607.c \
40         ao_adc_stm.c \
41         ao_beep_stm.c
42
43 PRODUCT=MegaMetrum-v0.1
44 PRODUCT_DEF=-DMEGAMETRUM
45 IDPRODUCT=0x000a
46
47 CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) -Os -g
48
49 PROG=megametrum-v0.1-$(VERSION).elf
50
51 SRC=$(ALTOS_SRC) ao_megametrum.c
52 OBJ=$(SRC:.c=.o)
53
54 all: $(PROG)
55
56 $(PROG): Makefile $(OBJ)
57         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc
58
59 ../altitude.h: make-altitude
60         nickle $< > $@
61
62 $(OBJ): $(INC)
63
64 ao_product.h: ao-make-product.5c ../Version
65         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
66
67 ao_product.rel: ao_product.c ao_product.h
68         $(call quiet,CC) -c $(CFLAGS) -D PRODUCT_DEFS='\"ao_product.h\"' -o$@ $<
69
70 distclean:      clean
71
72 clean:
73         rm -f $(OBJ)
74         rm -f ao_product.h
75
76 install:
77
78 uninstall: