# makefile, written by guido socher Target=atmega32 MCU=atmega32 F_CPU=14745600 CC=avr-gcc OBJCOPY=avr-objcopy LINKER=avr-ld # optimize for size: CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues #------------------- all: eltel.hex #------------------- eltel.hex : eltel.out $(OBJCOPY) -R .eeprom -O ihex eltel.out eltel.hex avr-strip eltel.out eltel.out : eltel.o $(CC) $(CFLAGS) -o eltel.out -Wl,-Map,eltel.map,-L/opt/cdk4avr/avr/lib/avr5 eltel.o -lm eltel.o : eltel.c $(CC) $(CFLAGS) -Os -c eltel.c eltel.asm: eltel.c $(CC) -msize $(CFLAGS) -S eltel.c # you need to erase first before loading the program. # load (program) the software into the eeprom: load: eltel.hex uisp -dlpt=/dev/parport0 --erase -dprog=dapa uisp -dlpt=/dev/parport0 --upload if=eltel.hex -dprog=dapa -v=3 --hash=32 #------------------- clean: rm -f *.o *.map *.out *.s *.hex #-------------------