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