Skript file: /~heha/basteln/PC/Programmiergeräte/Wild GIF12/mtp3.zip/Makefile

# Makefile für ATmega32U4-Firmware auf Arduino-Nachbauboard „Pro Micro“
# Henrik Haftmann, 190520
P = mtp
D = atmega32u4
F = 16000000

PATH := c:\programs\winavr\gcc492\bin;$(PATH)

# Compiler und Linker (Komma ersetzt Leerzeichen in Linker-Optionen!):
C = avr-gcc -Wall -Wno-parentheses -Os -mmcu=$D -mrelax -D F_CPU=$F
# -Wl,-u,vfprintf -lprintf_min
# -D DEBUG
#no-parentheses: Ich weiß selbst wo Klammern nötig sind
#no-array-bounds: Flash-Stringadressen nicht im Flash (0..7FFF)
#no-char-subscripts: Bytes als Array-Indizes sind okay für kleine Arrays

all: $P.lst

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

# Wird nur für avrdude benötigt
$P.hex: $P.elf
	avr-objcopy -j .text -j .data -O ihex $< $@

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

# via 512-Byte-Urlader ubaboot (google: ubaboot chemnitz)
flash: $P.elf
	uba $<
Detected encoding: UTF-80