First experiments with AVR (AtTiny2313)
[mirrors/Programs.git] / avr / blink / Makefile
1 #MCU=at90s2313
2 MCU=attiny2313
3 CC=avr-gcc
4 OBJCOPY=avr-objcopy
5 PROJECT=helloworld
6 # optimize for size:
7 CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues
8 #-------------------
9 all: $(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
17 asm : $(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:
21 load: $(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 #-------------------
25 clean:
26 rm -f *.o *.map *.out *.hex
27 #-------------------
This page took 0.309609 seconds and 5 git commands to generate.