1 vpath % $(TOPDIR)/stm:$(TOPDIR)/product:$(TOPDIR)/drivers:$(TOPDIR)/kernel:$(TOPDIR)/util:$(TOPDIR)
2 vpath ao-make-product.5c $(TOPDIR)/util
7 objcopy -O ihex $*.elf $@
10 include $(TOPDIR)/Version
12 include $(TOPDIR)/Makedefs
15 LIBS=-L$(NEWLIB_NANO)/arm-none-eabi/lib/thumb/v7-m -lc -lm -lgcc
17 AO_CFLAGS=-I. -I$(TOPDIR)/stm -I$(TOPDIR)/kernel -I$(TOPDIR)/drivers \
18 -DNEWLIB_INTEGER_PRINTF_SCANF \
19 -I$(TOPDIR)/product -I$(TOPDIR) -isystem $(NEWLIB_NANO)/arm-none-eabi/include
21 STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb \
22 -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS)
24 LDFLAGS=-L$(TOPDIR)/stm -Wl,-Taltos-loader.ld
29 # The user has explicitly enabled quiet compilation.
31 quiet = @printf " $1 $2 $@\n"; $($1)
33 # Otherwise, print the full command line.
37 $(call quiet,CC) -c $(CFLAGS) -o $@ $<
51 # Common AltOS sources
69 PRODUCT_DEF=-DALTOS_FLASH
72 CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) -g -Os
75 PROG=$(HARDWARE)-$(PROGNAME)-$(VERSION).elf
77 $(PROG): Makefile $(OBJ) altos-loader.ld
78 $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS)
80 ao_product.h: ao-make-product.5c $(TOPDIR)/Version
81 $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
90 rm -f *.o $(HARDWARE)-$(PROGNAME)-*.elf