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=$(PDCLIB_LIBS_M3) -lgcc
17 AO_CFLAGS=-I. -I$(TOPDIR)/stm -I$(TOPDIR)/kernel -I$(TOPDIR)/drivers -I$(TOPDIR)/product -I$(TOPDIR) $(PDCLIB_INCLUDES)
18 STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS)
20 LDFLAGS=-L$(TOPDIR)/stm -Wl,-Taltos-loader.ld
25 # The user has explicitly enabled quiet compilation.
27 quiet = @printf " $1 $2 $@\n"; $($1)
29 # Otherwise, print the full command line.
33 $(call quiet,CC) -c $(CFLAGS) -o $@ $<
47 # Common AltOS sources
65 PRODUCT_DEF=-DALTOS_FLASH
68 CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) -g -Os
71 PROG=$(HARDWARE)-$(PROGNAME)-$(VERSION).elf
73 $(PROG): Makefile $(OBJ) altos-loader.ld
74 $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS)
76 ao_product.h: ao-make-product.5c $(TOPDIR)/Version
77 $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
86 rm -f *.o $(HARDWARE)-$(PROGNAME)-*.elf