all : cleancurtime curtime.h program.hex burn program.lst CC = avr-gcc OBJS = main.o ../lib/lid.o ../lib/avr_print.o ../lib/clocketc.o ../lib/densitron.o ../lib/simpstrings.o ../lib/mma7660.o SRCS = main.c ../lib/lid.c ../lib/avr_print.c ../lib/clocketc.c ../lib/densitron.c ../lib/simpstrings.c ../lib/mma7660.c PROCESSOR=atmega168 PROGRAMCODE=m168 CFLAGS = -Wall -std=gnu99 -Os -mmcu=$(PROCESSOR) -DF_CPU=1000000UL -I. -I../lib ASFLAGS = $(CFLAGS) -x assembler-with-cpp cleancurtime : rm -rf curtime.h main.o curtime.h : $(SRCS) makecurtime ./makecurtime > curtime.h makecurtime : makecurtime.c gcc -o $@ $^ program.elf : $(OBJS) avr-gcc -I -mmcu=$(PROCESSOR) $(CFLAGS) -Wl,-Map,program.map -o $@ $^ -L /usr/lib64/binutils/avr/2.19.1 program.hex : program.elf avr-objcopy -j .text -j .data -O ihex program.elf program.hex program.lst : $(SRCS) avr-gcc -c -g -Wa,-a,-ad $(CFLAGS) $^ > $@ burn : program.hex avrdude -c usbtiny -i 1 -p $(PROGRAMCODE) -U flash:w:program.hex readfuses : avrdude -c usbtiny -p $(PROGRAMCODE) -U hfuse:r:high.txt:b -U lfuse:r:low.txt:b #careful here... #burnfuses : # avrdude -c usbtiny -p $(PROGRAMCODE) -U lfuse:w:0xE6:m -U hfuse:w:0xDF:m clean : rm -f *~ high.txt low.txt program.hex program.map program.elf $(OBJS) *.o usbdrv/*.o usbdrv/*~ program.lst makecurtime curtime.h serial : stty -F /dev/ttyUSB0 4800 -parenb -echo -cstopb