Skript file: /~heha/Mikrocontroller/Sprache/sprich.zip/Makefile

# Makefile für ATmega32U4-Firmware auf Arduino-Nachbauboard „Pro Micro“
# Die 24-K-Datenmenge für 2 Minuten Gesang sind hier in einer Binärdatei.
P = TomsDiner
D = atmega32u4
F = 16000000

PATH := c:\programme\winavr\gcc1010\bin;$(PATH)

# Compiler und Linker:
C = avr-gcc -Wall -Wno-parentheses -Os -mmcu=$D -std=c++11 -D F_CPU=$F
# -D DEBUG
#no-parentheses: Ich weiß selbst wo Klammern nötig sind

all: $P.lst

spDINER.o: TomsDiner.lpc
	avr-objcopy -I binary -O elf32-avr \
--rename-section .data=.progmem.1,contents \
--redefine-sym _binary_$(subst .,_,$<)_start=$(@:.o=) \
-N _binary_$(subst .,_,$<)_end \
-N _binary_$(subst .,_,$<)_size \
$< $@

# Alle C++-Dateien sind (der Einfachheit halber) von allen Kopfdateien abhängig
$P.elf: *.cpp *.S *.h makefile
	$C -o $@ $(filter %.cpp %S,$^)
	avr-size -G $@

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

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

# 512-Byte-Urlader ubaboot
flash: $P.elf
	uba $<
Detected encoding: UTF-80