Skript file: /~heha/basteln/m/Kram/dccrail-avrgcc.zip/binärgleich/Makefile

#Makefile für binärkompatiblen DCC-Wagendekoder
#Aufruf: make (avr-gcc und make muss installiert und im Pfad sein)
#heha 210602
P = DCC_Decoder
D = atmega8
F = 8000000

all: $P.lst $P.hex $P.eep

$P.elf: *.S *.h *.inc Makefile
	avr-gcc -Wall -mmcu=$D -nostartfiles -DF_CPU=$F -Ddebug=0 -o $@ interrupt.S init_m8wagdec.S Eprom.S LoadEEdaten.S DCC_Decode.S Programmierung.S Funktionsbefehle.S Fahrbefehle.S Out_set.S analog.S $P.S
#Die Reihenfolge der *.S-Dateien ist wichtig für Binärgleichheit!
	avr-size -C --mcu=$D $@

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

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

$P.eep: $P.elf
	avr-objcopy -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@
Detected encoding: UTF-80