8e5_hello_world.make 481 Bytes
Newer Older
Grace Copplestone's avatar
Grace Copplestone committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
PROJECT=8e5_hello_world
SOURCES=$(PROJECT).c
MMCU=atxmega8e5
F_CPU = 32000000
TARGET = x8e5
PROGRAMMER= atmelice_pdi

CFLAGS=-mmcu=$(MMCU) -Wall -Os -DF_CPU=$(F_CPU)

$(PROJECT).hex: $(PROJECT).out
	avr-objcopy -O ihex $(PROJECT).out $(PROJECT).c.hex;\
	avr-size --mcu=$(MMCU) --format=avr $(PROJECT).out
 
$(PROJECT).out: $(SOURCES)
	avr-gcc $(CFLAGS) -I./ -o $(PROJECT).out $(SOURCES)
 
program: $(PROJECT).hex
	avrdude -p $(TARGET) -c $(PROGRAMMER) -U flash:w:$(PROJECT).c.hex