# 2011-05-18 EW SHELL=/bin/bash STATIONID=7F # default TARGET=main AMFORTH=~/Forth/amforth/releases/4.4/core #AMFORTH=~/Forth/amforth/trunk/core MCU=atmega32 # external quarz at 11.0592 MHz LFUSE=0xee HFUSE=0x89 SP12=-c sp12 -i 10 -P /dev/parport0 MKII=-c avrispmkII -P usb DRAGON=-c dragon_isp -P usb BURNER=$(DRAGON) AVRDUDE=sudo avrdude AVRDUDE_FLAGS=-q $(BURNER) -p $(MCU) DIR_ATMEL=~/wine/AvrAssembler2 AVRA=avra AVRA_FLAGS=-I ./devices/$(MCU) -I $(DIR_ATMEL)/Appnotes ASM=wine $(DIR_ATMEL)/avrasm2.exe ASM_FLAGS=-I $(AMFORTH) -I . -I $(AMFORTH)/devices/$(MCU) -fI INCLUDE=-I $(AMFORTH) -I $(AMFORTH)/devices/$(MCU) CONSOLE=/dev/ttyUSB0 all: $(TARGET).hex erase: $(AVRDUDE) $(AVRDUDE_FLAGS) -e marker: # amforth-upload.py -t ${CONSOLE} lib/ans94/marker.frt amforth-upload.py -t ${CONSOLE} lib/misc.frt lib/bitnames.frt lib/ans94/marker.frt $(AMFORTH)/devices/$(MCU)/$(MCU).frt upload_file: cat $(TARGET).fs | unfold_fs > $(TARGET).fs.unfold trim_fs $(TARGET).fs.unfold > $(TARGET).fs.upload upload: upload_file amforth-upload.py -t ${CONSOLE} $(TARGET).fs.upload config: amforth-upload.py -t $(CONSOLE) config-$(STATIONID).fs install: $(TARGET).hex $(AVRDUDE) $(AVRDUDE_FLAGS) -e -U flash:w:$(TARGET).hex:i -U eeprom:w:$(TARGET).eep.hex:i $(TARGET).hex: $(TARGET).asm $(AMFORTH)/devices/$(MCU)/*.asm $(AMFORTH)/drivers/*.asm words/*.asm $(AMFORTH)/*.asm $(AMFORTH)/words/*.asm $(AMFORTH)/devices/$(MCU)/*.asm dict_appl.inc dict_appl_core.inc $(ASM) $(ASM_FLAGS) -l $(TARGET).lst -m $(TARGET).map -e $(TARGET).eep.hex $(TARGET).asm # $(AVRA) $(AVRA_FLAGS) $(INCLUDE) --listmac -l $(TARGET).lst -m $(TARGET).map $(TARGET).asm $(TARGET).back: $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:r:$(TARGET).hex:i -U eeprom:r:$(TARGET).eep.hex:i clean: rm -f *.{hex,eep.hex,lst,map,cof,obj,fs.upload,fs.unfold} write-fuse: $(AVRDUDE) $(AVRDUDE_FLAGS) -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m read-fuse: $(AVRDUDE) $(AVRDUDE_FLAGS) -U hfuse:r:-:h -U lfuse:r:-:h -U efuse:r:-:h -U lock:r:-:h