From 7a89aa1ea7e1b02b5cd310986adf4239ec0ce91d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 18 Feb 2019 12:59:05 -0800 Subject: altos: Move common build definitions to src/Makefile.defs This cleans up the build process for all architectures, providing a common place to specify vpath, cflags and build rules for various common files. Signed-off-by: Keith Packard --- src/Makefile.defs | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/Makefile.defs (limited to 'src/Makefile.defs') diff --git a/src/Makefile.defs b/src/Makefile.defs new file mode 100644 index 00000000..6df0c3fe --- /dev/null +++ b/src/Makefile.defs @@ -0,0 +1,56 @@ +include $(TOPDIR)/Makedefs + +AO_VPATH=$(TOPDIR)/product:$(TOPDIR)/drivers:$(TOPDIR)/kernel:$(TOPDIR)/util:$(TOPDIR)/kalman:$(TOPDIR)/aes:$(TOPDIR)/math:$(TOPDIR)/draw:$(TOPDIR) +vpath make-altitude $(TOPDIR)/util +vpath make-kalman $(TOPDIR)/util +vpath kalman.5c $(TOPDIR)/kalman +vpath kalman_filter.5c $(TOPDIR)/kalman +vpath load_csv.5c $(TOPDIR)/kalman +vpath matrix.5c $(TOPDIR)/kalman +vpath ao-make-product.5c $(TOPDIR)/util + +WARN_FLAGS=-Wall -Wextra -Werror -Wcast-align \ + -Wpointer-arith \ + -Wstrict-prototypes \ + -Wmissing-prototypes \ + -Wmissing-declarations \ + -Wnested-externs \ + -Wshadow \ + -Warray-bounds=2 + +OPT=-Os + +NEWLIB_CFLAGS= \ + -ffreestanding -nostdlib \ + -DNEWLIB_INTEGER_PRINTF_SCANF \ + -isystem $(NEWLIB_NANO)/arm-none-eabi/include + +AO_CFLAGS=\ + -std=gnu99 \ + -I. -I$(TOPDIR) -I$(TOPDIR)/kernel -I$(TOPDIR)/drivers \ + -I$(TOPDIR)/math -I$(TOPDIR)/draw -I$(TOPDIR)/product $(WARN_FLAGS) $(OPT) -g + +NICKLE=nickle +ELFTOHEX=$(TOPDIR)/../ao-tools/ao-elftohex/ao-elftohex + +.SUFFIXES: .elf .ihx + +.elf.ihx: + $(ELFTOHEX) --output=$@ $*.elf + +V=0 +# The user has explicitly enabled quiet compilation. +ifeq ($(V),0) +quiet = @printf " $1 $2 $@\n"; $($1) +endif +# Otherwise, print the full command line. +quiet ?= $($1) + +.c.o: + $(call quiet,CC) -c $(CFLAGS) -o $@ $< + +.DEFAULT_GOAL=all + +ao_product.h: ao-make-product.5c $(TOPDIR)/Makedefs + $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ + -- cgit v1.2.3