altos: Move common build definitions to src/Makefile.defs
[fw/altos] / src / fox1ihu / 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         ao_product.h \
14         ao_watchdog.h \
15         ao_storage.h \
16         ao_task.h \
17         stm32l.h \
18         ao_sdcard.h \
19         ao_bufio.h \
20         ao_fat.h \
21         Makefile
22
23 #PROFILE=ao_profile.c
24 #PROFILE_DEF=-DAO_PROFILE=1
25
26 #SAMPLE_PROFILE=ao_sample_profile.c \
27 #       ao_sample_profile_timer.c
28 #SAMPLE_PROFILE_DEF=-DHAS_SAMPLE_PROFILE=1
29
30 #STACK_GUARD=ao_mpu_stm.c
31 #STACK_GUARD_DEF=-DHAS_STACK_GUARD=1
32
33 ALTOS_SRC = \
34         ao_boot_chain.c \
35         ao_interrupt.c \
36         ao_product.c \
37         ao_romconfig.c \
38         ao_cmd.c \
39         ao_task.c \
40         ao_led_stm.c \
41         ao_stdio.c \
42         ao_panic.c \
43         ao_timer.c \
44         ao_mutex.c \
45         ao_dma_stm.c \
46         ao_spi_stm.c \
47         ao_usb_stm.c \
48         ao_exti_stm.c \
49         ao_adc_stm.c \
50         ao_data.c \
51         ao_storage.c \
52         ao_mr25.c \
53         ao_sdcard.c \
54         ao_bufio.c \
55         ao_fat.c \
56         ao_watchdog.c
57
58 PRODUCT=Fox1IHU-v2
59 PRODUCT_DEF=-DFOX
60 IDPRODUCT=0x0024
61
62 CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STACK_GUARD_DEF)
63
64 PROGNAME=fox1ihu-v0.1
65 PROG=$(PROGNAME)-$(VERSION).elf
66 HEX=$(PROGNAME)-$(VERSION).ihx
67
68 SRC=$(ALTOS_SRC) ao_fox1ihu.c
69 OBJ=$(SRC:.c=.o)
70
71 all: $(PROG) $(HEX)
72
73 $(PROG): Makefile $(OBJ) altos.ld
74         $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS)
75
76 $(OBJ): $(INC)
77
78 ao_product.h: ao-make-product.5c ../Version
79         $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
80
81 distclean:      clean
82
83 clean:
84         rm -f *.o $(PROGNAME)-*.elf
85         rm -f ao_product.h
86
87 install:
88
89 uninstall: