[deutsch] [english] PHP version

Skript file: /~heha/Mikrocontroller/Sternhimmel/Schnecke.zip[Download]/Makefile

Show line numbers
# Tabsize = 8, Encoding = UTF-8, LineEnds = LF
PROJECT = Schnecke
DEVICE = atmega16
AVRDUDE = avrdude -c pony-stk200 -P lpt1 -p $(DEVICE) -E noreset

COMPILE = avr-gcc -Wall -Os -I$(USBDRV) -I. -mmcu=$(DEVICE) -D F_CPU=8000000

OBJECTS = PWM32.o Schnecke.o

# Symbolic targets:
all:	PWM32.hex PWM32.lst

# Fuse high byte:
 HFUSE = 0xC1
# 1 1 0 0  0 0 0 1
# ↑ ↑ ↑ ↑  ↑ └┬┘ └─── BOOTRST
# │ │ │ │  │  └────── BOOTSZ
# │ │ │ │  └───────── EESAVE	(preserve EEPROM over chip erase: YES)
# │ │ │ └──────────── CKOPT	(Oszillator-Option: Hohe Treiberstärke)
# │ │ └────────────── SPIEN	(Serial Programming enable: YES)
# │ └──────────────── JTAGEN	(JTAG Enable: NO)
# └────────────────── OCDEN	(OCD Enable: NO)
# Fuse low byte:
 LFUSE = 0xEF
# 1 1 1 0  1 1 1 1
# ↑ ↑ └┬┘  └──┬──┘
# │ │  │      └────── CKSEL	(Oszillator: Quarz 16 MHz)
# │ │  └───────────── SUT	(Start-up-Zeit: 5 ms (mit CKSEL0!))
# │ └──────────────── BODEN	(Brown-out Enable: NO)
# └────────────────── BODLEVEL	(Brown-out detection level)
# Lock byte:
 LOCK = 0x2F
# x x 1 0  1 1 1 1
#     └┬┘  └┬┘ └┬┘ 
#      │    │   └──── LB
#      │    └──────── BLB0
#      └───────────── BLB1	(Schreibschutz für Bootloader)

program:
	$(AVRDUDE) -U flash:w:PWM32.hex:i -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m

flash: all
	$(AVRDUDE) -U flash:w:PWM32.hex:i

clean:
	rm -f PWM32.lst PWM32.elf $(OBJECTS)

# File targets:
PWM32.o: PWM32.S PWM32.h Makefile
	$(COMPILE) -c $< -o $@

Schnecke.o: Schnecke.c PWM32.h Makefile
	$(COMPILE) -c $< -o $@

PWM32.elf: $(OBJECTS) Makefile
	$(COMPILE) -o $@ $(OBJECTS)

PWM32.hex: PWM32.elf Makefile
	rm -f $@
	avr-objcopy -j .text -j .data -O ihex $< $@
	avr-size $<

PWM32.lst: PWM32.elf Makefile
	avr-objdump -d $< > $@
Detected encoding: UTF-80