MCU=atmega8535 CC=avr-gcc OBJCOPY=avr-objcopy CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues # CFLAGS=-g -mmcu=$(MCU) -fno-loop-optimize -Wall -Wstrict-prototypes -mcall-prologues all: lndk_avr006.hex help: @echo "Usage avrprg: make help|all|load|load_pre|loadavrdude|loadavrdude_pre" @echo "Usage prgfuses: make help|rdfuses|wrfuses" lndk_avr006.hex : lndk_avr006.out $(OBJCOPY) -R .eeprom -O ihex lndk_avr006.out lndk_avr006.hex lndk_avr006.out : lndk_avr006.o $(CC) $(CFLAGS) -o lndk_avr006.out -Wl,-Map,lndk_avr006.map lndk_avr006.o -lm avr-size lndk_avr006.out lndk_avr006.o : lndk_avr006.c lndk_avr006.h $(CC) $(CFLAGS) -Os -c lndk_avr006.c check: @echo "Loading kernel modules ...." @echo "" @/sbin/modprobe parport @/sbin/modprobe parport_pc @/sbin/modprobe ppdev @uisp -dlpt=/dev/parport0 -dprog=ett @echo "" load: avrdude -c futurlec -p m8535 -U flash:w:lndk_avr006.hex rdfuses: uisp -dlpt=/dev/parport0 --rd_fuses -dprog=ett @echo " " wrfuses: uisp -dlpt=/dev/parport0 -dprog=dapa --wr_fuse_l=0xe2 clean: rm -f *.o *.map *.out *.hex *~