Blame | Last modification | View Log | RSS feed
# WinAVR cross-compiler toolchain is used hereCC = avr-gccOBJCOPY = avr-objcopyDUDE = avrdude# If you are not using ATtiny2313 and the USBtiny programmer,# update the lines below to match your configurationCFLAGS = -Wall -Os -I. -mmcu=attiny2313OBJFLAGS = -j .text -j .data -O ihexDUDEFLAGS = -p attiny2313 -P usb -c avrispmkii -v# Object files for the firmware (usbdrv/oddebug.o not strictly needed I think)OBJECTS = main.o# Command-line clientCMDLINE = usbtest# By default, build the firmware and command-line client, but do not flash#all: main.hex $(CMDLINE)all: main.hex# With this, you can flash the firmware by just typing "make flash" on command-lineflash: main.hex$(DUDE) $(DUDEFLAGS) -U flash:w:$<# Housekeeping if you want itclean:$(RM) *.o *.hex *.elf# From .elf file to .hex%.hex: %.elf$(OBJCOPY) $(OBJFLAGS) $< $@# Main.elf requires additional objects to the firmware, not just main.omain.elf: $(OBJECTS)$(CC) $(CFLAGS) $(OBJECTS) -o $@# From C source to .o object file%.o: %.c$(CC) $(CFLAGS) -c $< -o $@# From assembler source to .o object file%.o: %.S$(CC) $(CFLAGS) -x assembler-with-cpp -c $< -o $@