All pastes #674569 Raw Edit

Miscellany

public text v1 · immutable
#674569 ·published 2007-08-29 11:16 UTC
rendered paste body
TOOLCHAIN=/opt/local/bin

CC = $(TOOLCHAIN)/avr-gcc
OBJCOPY = $(TOOLCHAIN)/avr-objcopy
AVRDUDE = /usr/local/bin/avrdude

APP=blink

all:
	$(CC) $(APP).c -o $(APP).elf -mmcu=atmega8
	$(OBJCOPY) -j .text -j .data -O ihex $(APP).elf $(APP).hex
	$(AVRDUDE) -c avr910 -p atmega8 -P /dev/tty.SLAB_USBtoUART -e -U lfuse:w:0xb4:m -U hfuse:w:0xd9:m -U flash:w:$(APP).hex

erase: 
	$(AVRDUDE) -c avr910 -p atmega8 -P /dev/tty.SLAB_USBtoUART -e
	
hex:
	$(CC) $(APP).c -o $(APP).elf -mmcu=atmega8
	$(OBJCOPY) -j .text -j .data -O ihex $(APP).elf $(APP).hex
	
program:
	$(AVRDUDE) -c avr910 -p atmega8 -P /dev/tty.SLAB_USBtoUART -e -U lfuse:w:0xb4:m -U hfuse:w:0xd9:m -U flash:w:$(APP).hex
	
clean:
	rm -f  $(APP).elf $(APP).hex