all : program.hex burn program.lst CC = avr-gcc #just a random note: use this to benchmark #curl -s -w "\nResponse time:\t%{time_total}s\n" -o /dev/null http://192.168.0.142/png.png SRCS = example.c \ avr_print.c \ enc424j600.c \ iparpetc.c \ enc424j600_asm.S \ tcp.c \ util10.c \ http.c \ mfs.c \ max5556.c \ myfiles.c # ../microsd/microsd.c \ # ../microsd/basicfat.c \ mfsmaker : mfsmaker.c gcc -o $@ $^ myfiles.c : page mfsmaker ./mfsmaker $< $@ PROCESSOR=atmega328 PROGRAMCODE=m328 COMMON_FLAGS= -mmcu=$(PROCESSOR) -I. -I.. -I../http -I../microsd -I../libs -I../ipcore -I../dumbcraft -I../mfs CFLAGS = -std=gnu99 -Os $(COMMON_FLAGS) -DF_CPU=28636000UL -DMUTE_PRINTF #-DNO_HTTP #-Wall AS = avr-gcc ASFLAGS = $(COMMON_FLAGS) -c EXTRA_LD_FLAGS=-Wl,--relax -Wa,-a,-ad -mcall-prologues program.elf : $(SRCS) avr-gcc --combine -fwhole-program -I -mmcu=$(PROCESSOR) $(CFLAGS) -o $@ $^ -L /usr/lib64/binutils/avr/2.19.1 $(EXTRA_LD_FLAGS) > program.lst avr-size -A $@ avr-objdump program.elf -t > program.map program.hex : program.elf avr-objcopy -j .text -j .data -O ihex program.elf program.hex burn : program.hex avrdude -c usbtiny -p $(PROGRAMCODE) -V -U flash:w:program.hex #-V 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:0xA6:m -U hfuse:w:0xDF:m burnfuses_slow : avrdude -c usbtiny -p $(PROGRAMCODE) -U lfuse:w:0x62:m -U hfuse:w:0xD9:m clean : rm -f *~ high.txt low.txt program.hex program.map program.elf $(OBJS) *.o usbdrv/*.o usbdrv/*~ program.lst