First experiments with AVR (AtTiny2313)
[mirrors/Programs.git] / avr / blink / Makefile
CommitLineData
1375f65d
H
1#MCU=at90s2313
2MCU=attiny2313
3CC=avr-gcc
4OBJCOPY=avr-objcopy
5PROJECT=helloworld
6# optimize for size:
7CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues
8#-------------------
9all: $(PROJECT).hex
10#-------------------
11$(PROJECT).hex : $(PROJECT).out
12 $(OBJCOPY) -R .eeprom -O ihex $(PROJECT).out $(PROJECT).hex
13$(PROJECT).out : $(PROJECT).o
14 $(CC) $(CFLAGS) -o $(PROJECT).out -Wl,-Map,$(PROJECT).map $(PROJECT).o
15$(PROJECT).o : $(PROJECT).c
16 $(CC) $(CFLAGS) -Os -c $(PROJECT).c
17asm : $(PROJECT).c
18 $(CC) $(CFLAGS) -O -S $(PROJECT).c
19# you need to erase first before loading the program.
20# load (program) the software into the eeprom:
21load: $(PROJECT).hex
22 avrdude -cstk500v1 -P/dev/ttyUSB0 -b19200 -p $(MCU) -Uflash:w:$(PROJECT).hex:i
23 # uisp -dlpt=/dev/parport0 --erase --upload --verify if=$(PROJECT).hex -dprog=dapa -v=3 --hash=12
24#-------------------
25clean:
26 rm -f *.o *.map *.out *.hex
27#-------------------
This page took 0.092901 seconds and 4 git commands to generate.