AVR tests
[mirrors/Programs.git] / avr / blink / Makefile
CommitLineData
1375f65d
H
1#MCU=at90s2313
2MCU=attiny2313
40e02009 3#FUSES=-U lfuse:w:0x64:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
88e0a543 4PORT=/dev/ttyUSB0
1375f65d
H
5CC=avr-gcc
6OBJCOPY=avr-objcopy
40e02009 7PROJECT=helloworld2
88e0a543 8RESET=false
1375f65d
H
9# optimize for size:
10CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues
11#-------------------
12all: $(PROJECT).hex
13#-------------------
14$(PROJECT).hex : $(PROJECT).out
15 $(OBJCOPY) -R .eeprom -O ihex $(PROJECT).out $(PROJECT).hex
16$(PROJECT).out : $(PROJECT).o
17 $(CC) $(CFLAGS) -o $(PROJECT).out -Wl,-Map,$(PROJECT).map $(PROJECT).o
18$(PROJECT).o : $(PROJECT).c
19 $(CC) $(CFLAGS) -Os -c $(PROJECT).c
20asm : $(PROJECT).c
21 $(CC) $(CFLAGS) -O -S $(PROJECT).c
22# you need to erase first before loading the program.
23# load (program) the software into the eeprom:
24load: $(PROJECT).hex
88e0a543 25 $(RESET) && stty -F $(PORT) 19200 hupcl && sleep 2 && stty -F $(PORT) 19200 -hupcl && sleep 2 || true
40e02009 26 avrdude -cstk500v1 -P$(PORT) -b19200 -p $(MCU) -Uflash:w:$(PROJECT).hex:i $(FUSES) || $(MAKE) RESET=true MAKE=true load
1375f65d
H
27 # uisp -dlpt=/dev/parport0 --erase --upload --verify if=$(PROJECT).hex -dprog=dapa -v=3 --hash=12
28#-------------------
29clean:
30 rm -f *.o *.map *.out *.hex
31#-------------------
This page took 0.153562 seconds and 4 git commands to generate.