X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2FMakefile.proto;h=c79638acfbd30c62a6047739677979369a9d58b7;hp=958b7572ac783ed1487ceaea0f5911fb69bac78e;hb=9f7296b3feab872bf51fc369ade69cc1e7cf7a3f;hpb=84c93bb2fc4558a5e4654794ba90e730a84eaf67 diff --git a/src/Makefile.proto b/src/Makefile.proto index 958b7572..c79638ac 100644 --- a/src/Makefile.proto +++ b/src/Makefile.proto @@ -10,7 +10,7 @@ vpath ao-make-product.5c .. CC=sdcc ifndef VERSION -VERSION=$(shell git describe) +include ../Version endif CFLAGS=--model-small --debug --opt-code-speed @@ -35,6 +35,7 @@ ALTOS_SRC = \ ao_panic.c \ ao_task.c \ ao_timer.c \ + ao_romconfig.c \ _bp.c # @@ -70,6 +71,12 @@ TELE_DRIVER_SRC = \ ao_convert.c \ ao_serial.c +# +# Spi bus driver +# +SPI_DRIVER_SRC = \ + ao_spi.c + # # Debug dongle driver (only on TI) # @@ -174,6 +181,11 @@ TD_SRC = \ include Makefile.defs +CFLAGS += $(PRODUCT_DEF) -I. + +NICKLE=nickle +CHECK_STACK=sh ../check-stack + REL=$(SRC:.c=.rel) ao_product.rel ADB=$(REL:.rel=.adb) ASM=$(REL:.rel=.asm) @@ -188,29 +200,39 @@ PMAP=$(PROG:.ihx=.map) PMEM=$(PROG:.ihx=.mem) PAOM=$(PROG:.ihx=) +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) + %.rel : %.c $(INC) - $(CC) -c $(CFLAGS) -o$@ $< + $(call quiet,CC,$(PRODUCT_DEF)) $(CFLAGS) -c -o$@ $< -all: $(PROG) +all: ../$(PROG) -$(PROG): $(REL) Makefile Makefile.defs ../Makefile.proto - $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(REL) +../$(PROG): $(REL) Makefile Makefile.defs ../Makefile.proto + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) .. + $(call quiet,CHECK_STACK) ../ao.h $(PMEM) ../altitude.h: make-altitude nickle $< > $@ -ao_product.h: ao-make-product.5c - nickle $< -m altusmetrum.org -p $(PRODUCT) -v $(VERSION) > $@ +ao_product.h: ao-make-product.5c ../Version + $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ ao_product.rel: ao_product.c ao_product.h - $(CC) -c $(CFLAGS) -D PRODUCT_DEFS='\"ao_product.h\"' -o$@ $< + $(call quiet,CC) -c $(CFLAGS) -D PRODUCT_DEFS='\"ao_product.h\"' -o$@ $< distclean: clean clean: rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM) - rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM) + rm -f $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM) rm -f ao_product.h + rm -f ../$(PROG) install: