Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
DEVICE=attiny24F_CPU=8000000HFUSE=0xdfLFUSE=0xe2HDUSE=0xdf # Default fuses for deviceLDUSE=0x62PROGTYPE=avrispmkiiPROGPORT=usbINCLUDES=-I. -I./lib/VALUES=-DF_CPU=$(F_CPU)AVRDUDE = avrdude -c $(PROGTYPE) -P $(PROGPORT) -p $(DEVICE)#COMPILE = avr-gcc -Wall -Os -DDEBUG_LEVEL=0 -mmcu=$(DEVICE) $(INCLUDES) $(VALUES)# Use this one to trip out unused functionsCOMPILE = avr-gcc -mtiny-stack -Wall -Wl,-gc-section -fdata-sections -ffunction-sections -Os -DDEBUG_LEVEL=0 -mmcu=$(DEVICE) $(INCLUDES) $(VALUES)OBJECTS = main.oOBJECTS += lib/avrutil.oOBJECTS += lib/hc595.oOBJECTS += lib/usiTwiSlave.oOBJECTS += lib/twires.o#OBJECTS += lib/uart.o#OBJECTS += lib/twi.o#OBJECTS += lib/wire.o#OBJECTS += lib/lcd.o#OBJECTS += lib/e2p.o#OBJECTS += lib/mio.o#OBJECTS += lib/oled.o#OBJECTS += lib/gfx.o#OBJECTS += lib/dht.o#OBJECTS += lib/lmd.o# Compiling:all: main.hex.c.o:$(COMPILE) -c $< -o $@.S.o:$(COMPILE) -x assembler-with-cpp -c $< -o $@.c.s:$(COMPILE) -S $< -o $@main.bin: $(OBJECTS)$(COMPILE) -o main.bin $(OBJECTS) -lmmain.hex: main.binrm -f main.hex main.eep.hexavr-objcopy -j .text -j .data -O ihex main.bin main.hex./checksize main.bin 4096 256# do the checksize script as our last action to allow successful compilation# on Windows with WinAVR where the Unix commands will fail.disasm: main.binavr-objdump -d main.binclean:rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex main.bin *.o lib/*.o main.s# Functions interfacing to the deviceflash: allsudo $(AVRDUDE) -U flash:w:main.hex:ifuse:sudo $(AVRDUDE) -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):mfusedef:sudo $(AVRDUDE) -U hfuse:w:$(HDUSE):m -U lfuse:w:$(LDUSE):mreadcal:sudo $(AVRDUDE) -U calibration:r:/dev/stdout:i | head -1readfuse:sudo $(AVRDUDE) -U lfuse:r:-:h -U hfuse:r:-:h -U efuse:r:-:h -U lock:r:-:h