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