Skript /~heha/ewa/Kram/smfg.zip/Firmware/Makefile

# Makefile für den Schrittmotor-Frequenzgenerator

P = smfg
D = attiny2313
F = 8000000
PATH   := c:\programs\winavr\gcc492\bin;$(PATH)
#Der alte C++-Compiler (WinAVR2010) generiert hier den kürzeren Kode
COMPILE = avr-gcc.exe -Wall -Wno-parentheses -Os -mmcu=$D -DF_CPU=$F
AVRDUDE = avrdude -c pony-stk200 -P lpt1 -p $D -E noreset

all: $P.elf $P.lst

disasm: $P.lst

$P.elf: main.cpp Makefile
	$(COMPILE) -o $@ $(filter %.c %.cpp %.S,$^)
	@avr-size -C --mcu=$D $@

%.hex: $P.elf
	avr-objcopy -j .text -j .data -O ihex $< $@

%.lst: $P.elf
	avr-objdump -d $< > $@
	avr-strip $<

.PHONY: clean program fuse flash
clean:
	-rm -rf $(OBJECTS) $P.elf $P.lst

program: $P.elf
	avrpp -ff -i $<

#program: $P.hex
#	$(AVRDUDE) -U hfuse:w:0x57:m -U lfuse:w:$(LFUSE):m -U flash:w:$<:i

flash: $P.elf
	avrpp -i $<

#flash: $P.elf
#	$(AVRDUDE) -U flash:w:$<:i
Vorgefundene Kodierung: UTF-80