5 vpath % ../attiny:../drivers:../kernel:../product:..
6 vpath ao-make-product.5c ../util
7 vpath make-altitude-pa ../util
9 include ../avr/Makefile.defs
11 PROGNAME=micropeak-v0.1
12 PROG=$(PROGNAME)-$(VERSION).elf
13 HEX=$(PROGNAME)-$(VERSION).ihx
17 PUBLISH_DIR=$(HOME)/altusmetrumllc/Binaries
18 PUBLISH_HEX=$(PUBLISH_DIR)/$(HEX)
19 PUBLISH_SCRIPT=$(PUBLISH_DIR)/$(SCRIPT)
23 #PROGRAMMER=stk500v2 -P usb
25 LOADARG=-p $(DUDECPUTYPE) -c $(PROGRAMMER) -e -U flash:w:
27 #LDFLAGS=-L$(LDSCRIPTS) -Tavr25.x
58 PRODUCT=MicroPeak-v0.1
59 PRODUCT_DEF=-DMICROPEAK
60 CFLAGS = $(PRODUCT_DEF) -I. -I../attiny -I../kernel -I.. -I../drivers -I../product
61 CFLAGS += -g -mmcu=$(MCU) -Wall -Wstrict-prototypes -O2 -mcall-prologues -DATTINY
69 # The user has explicitly enabled quiet compilation.
71 quiet = @printf " $1 $2 $@\n"; $($1)
73 # Otherwise, print the full command line.
76 all: $(PROG) $(HEX) micropeak-load
78 CHECK=sh ../util/check-avr-mem
80 $(PROG): Makefile $(OBJ)
81 $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ)
82 $(call quiet,CHECK) $(PROG) || ($(RM) -f $(PROG); exit 1)
86 $(OBJCOPY) -R .eeprom -O ihex $(PROG) $@
90 $(LOADCMD) $(LOADARG)$(HEX)
93 $(LOADCMD) $(LOADSLOW) $(LOADARG)$(HEX)
95 ao_product.h: ao-make-product.5c ../Version
96 $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
98 ao_product.o: ao_product.c ao_product.h
101 $(call quiet,CC) -c $(CFLAGS) $<
106 rm -f *.o $(PROG) $(HEX) $(SCRIPT)
109 publish: $(PUBLISH_HEX) $(PUBLISH_SCRIPT)
111 $(PUBLISH_HEX): $(HEX)
114 $(PUBLISH_SCRIPT): $(SCRIPT)
123 ../altitude-pa.h: make-altitude-pa
126 $(SCRIPT): $(SCRIPT).tmpl Makefile ../Version
127 sed -e 's/%HEX%/$(HEX)/' -e 's/%LOADCMD%/$(LOADCMD)/' -e 's/%LOADARG%/$(LOADARG)/' -e 's/%LOADSLOW%/$(LOADSLOW)/' $(SCRIPT).tmpl > $@ || (rm $@ && exit 1)
134 $(OBJ): ao_product.h $(INC)