summaryrefslogtreecommitdiff
path: root/src/microsplash
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2019-02-18 12:59:05 -0800
committerKeith Packard <keithp@keithp.com>2019-02-18 13:08:23 -0800
commit7a89aa1ea7e1b02b5cd310986adf4239ec0ce91d (patch)
tree74e5fe54f95ab21e513a1c9a14b8a02c1c8cffea /src/microsplash
parent889518aeee080b0f8bb954db86d08105898d8161 (diff)
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 <keithp@keithp.com>
Diffstat (limited to 'src/microsplash')
-rw-r--r--src/microsplash/Makefile47
1 files changed, 7 insertions, 40 deletions
diff --git a/src/microsplash/Makefile b/src/microsplash/Makefile
index 0342838e..4850ef14 100644
--- a/src/microsplash/Makefile
+++ b/src/microsplash/Makefile
@@ -2,11 +2,8 @@
# Tiny AltOS build
#
#
-vpath % ../attiny:../drivers:../kernel:../product:..
-vpath ao-make-product.5c ../util
-vpath make-altitude-pa ../util
-
-include ../avr/Makefile.defs
+TOPDIR=..
+include $(TOPDIR)/attiny/Makefile.defs
PROGNAME=microsplash-v1.0
PROG=$(PROGNAME)-$(VERSION).elf
@@ -18,14 +15,6 @@ PUBLISH_DIR=$(HOME)/altusmetrumllc/Binaries
PUBLISH_HEX=$(PUBLISH_DIR)/$(HEX)
PUBLISH_SCRIPT=$(PUBLISH_DIR)/$(SCRIPT)
-MCU=attiny85
-DUDECPUTYPE=t85
-#PROGRAMMER=stk500v2 -P usb
-LOADSLOW=-i 32 -B 32
-LOADARG=-p $(DUDECPUTYPE) -c $(PROGRAMMER) -e -U flash:w:
-
-#LDFLAGS=-L$(LDSCRIPTS) -Tavr25.x
-
ALTOS_SRC = \
ao_micropeak.c \
ao_spi_attiny.c \
@@ -52,27 +41,17 @@ INC=\
ao_ms5607.h \
ao_log_micro.h \
ao_micropeak.h \
+ ao_product.h \
altitude-pa.h
IDPRODUCT=0
PRODUCT=MicroSplash-v1.0
PRODUCT_DEF=-DMICROPEAK
-CFLAGS = $(PRODUCT_DEF) -I. -I../attiny -I../kernel -I.. -I../drivers -I../product
-CFLAGS += -g -mmcu=$(MCU) -Wall -Wstrict-prototypes -O2 -mcall-prologues -DATTINY
-
-NICKLE=nickle
+CFLAGS = $(PRODUCT_DEF) $(ATTINY_CFLAGS)
SRC=$(ALTOS_SRC)
OBJ=$(SRC:.c=.o)
-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)
-
all: $(PROG) $(HEX) $(SCRIPT)
CHECK=sh ../util/check-avr-mem
@@ -85,25 +64,16 @@ $(HEX): $(PROG)
avr-size $(PROG)
$(OBJCOPY) -R .eeprom -O ihex $(PROG) $@
-
load: $(HEX)
$(LOADCMD) $(LOADARG)$(HEX)
load-slow: $(HEX)
$(LOADCMD) $(LOADSLOW) $(LOADARG)$(HEX)
-ao_product.h: ao-make-product.5c ../Version
- $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
-
-ao_product.o: ao_product.c ao_product.h
-
-%.o : %.c $(INC)
- $(call quiet,CC) -c $(CFLAGS) $<
-
distclean: clean
clean:
- rm -f *.o $(PROG) $(HEX) $(SCRIPT)
+ rm -f *.o *.elf *.ihx $(SCRIPT)
rm -f ao_product.h
publish: $(PUBLISH_HEX) $(PUBLISH_SCRIPT)
@@ -120,10 +90,7 @@ load-product:
load-product-slow:
./$(SCRIPT) slow
-../altitude-pa.h: make-altitude-pa
- nickle $< > $@
-
-$(SCRIPT): $(SCRIPT).tmpl Makefile ../Version
+$(SCRIPT): $(SCRIPT).tmpl Makefile $(TOPDIR)/Makedefs
sed -e 's/%HEX%/$(HEX)/' -e 's/%LOADCMD%/$(LOADCMD)/' -e 's/%LOADARG%/$(LOADARG)/' -e 's/%LOADSLOW%/$(LOADSLOW)/' $(SCRIPT).tmpl > $@ || (rm $@ && exit 1)
chmod +x $@
@@ -131,4 +98,4 @@ install:
uninstall:
-$(OBJ): ao_product.h $(INC)
+$(OBJ): $(INC)