1 SERIAL
= `echo /dev/tty.USA19QI*`
2 UISP
= uisp
-dprog
=avr910
-dserial
=$(SERIAL
) -dpart
=auto
5 # The two lines above are for "uisp" and the AVR910 serial programmer connected
6 # to a Keyspan USB to serial converter to a Mac running Mac OS X.
7 # Choose your favorite programmer and interface.
9 COMPILE
= avr-gcc
-Wall
-O2
-Iusbdrv
-I.
-mmcu
=$(TARGET
) # -DDEBUG_LEVEL=2
11 OBJECTS
= usbdrv
/usbdrv.o usbdrv
/usbdrvasm.o usbdrv
/oddebug.o isp.o clock.o main.o
18 $(COMPILE
) -c
$< -o
$@
22 $(COMPILE
) -x assembler-with-cpp
-c
$< -o
$@
23 # "-x assembler-with-cpp" should not be necessary since this is the default
24 # file type for the .S (with capital S) extension. However, upper case
25 # characters are not always preserved on Windows. To ensure WinAVR
26 # compatibility define the file type manually.
29 $(COMPILE
) -S
$< -o
$@
32 rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex main.bin
*.o main.s usbdrv.s
36 $(COMPILE
) -o main.bin
$(OBJECTS
) -Wl
,-Map
,main.map
39 rm -f main.hex main.eep.hex
40 avr-objcopy
-j .text
-j .data
-O ihex main.bin main.hex
41 # ./checksize main.bin
42 # do the checksize script as our last action to allow successful compilation
43 # on Windows with WinAVR where the Unix commands will fail.
46 avr-objdump
-d main.bin
52 avrdude
-c butterfly
-p
$(TARGET
) -U flash
:w
:main.hex
56 $(UISP
) --upload
--verify if
=main.hex