X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/blobdiff_plain/13894a8b1ba8938b9b5c5d0177f10a4e90b3ef9d..ffcfec0c629a193f43ca5dfaf6b137fd972803ed:/firmware/Makefile diff --git a/firmware/Makefile b/firmware/Makefile index 5792da9..36b9cae 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -2,10 +2,11 @@ # Project: USBaspLoader # Author: Christian Starkjohann # Creation Date: 2007-12-10 +# Author: Stephan Bärwolf +# Improvement Date: 2012-07-31 # Tabsize: 4 # Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH # License: GNU GPL v2 (see License.txt) -# This Revision: $Id: Makefile 798 2010-07-27 17:29:28Z cs $ ############################################################################### # Configure the following variables according to your AVR. @@ -15,16 +16,24 @@ # make lock # to protect the boot loader from overwriting F_CPU = 16000000 -DEVICE = atmega168 +DEVICE = atmega8 + # BOOTLOADER_ADDRESS is 1800 for 8k devices, 3800 for 16k and 7800 for 32k. -BOOTLOADER_ADDRESS = 3800 -FUSEOPT = $(FUSEOPT_168) -LOCKOPT = -U lock:w:0x2f:m +BOOTLOADER_ADDRESS = 1800 -PROGRAMMER = -c stk500v2 -P avrdoper # PROGRAMMER contains AVRDUDE options to address your programmer +# PROGRAMMER = -c pony-stk200 +PROGRAMMER = -c usbasp + +# since USBaspLoader supports HAVE_BLB11_SOFTW_LOCKBIT... +LOCKOPT = -U lock:w:0x3f:m +FUSEOPT = $(FUSEOPT_8) + + +# standard atmega8 needs BODLEVEL to be programed, since it is a 5V device +# you may also want to UNprogram SUT1 to get a SLOWER bootup (lfuse then would be 0x3f) +FUSEOPT_8 = -U hfuse:w:0xc0:m -U lfuse:w:0x1f:m -FUSEOPT_8 = -U hfuse:w:0xc0:m -U lfuse:w:0x9f:m FUSEOPT_88 = -U hfuse:w:0xd6:m -U lfuse:w:0xdf:m -U efuse:w:0x00:m FUSEOPT_168 = -U hfuse:w:0xd6:m -U lfuse:w:0xdf:m -U efuse:w:0x00:m FUSEOPT_328 = -U lfuse:w:0xf7:m -U hfuse:w:0xda:m -U efuse:w:0x03:m @@ -100,13 +109,13 @@ FUSEOPT_328 = -U lfuse:w:0xf7:m -U hfuse:w:0xda:m -U efuse:w:0x03:m ############################################################################### # Tools: -AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) +AVRDUDE = @echo avrdude $(PROGRAMMER) -p $(DEVICE) CC = avr-gcc # Options: DEFINES = #-DDEBUG_LEVEL=2 # Remove the -fno-* options when you use gcc 3, it does not understand them -CFLAGS = -Wall -Os -fno-move-loop-invariants -fno-tree-scev-cprop -fno-inline-small-functions -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) $(DEFINES) +CFLAGS = -Wall -Os -fno-move-loop-invariants -fno-tree-scev-cprop -fno-inline-small-functions -I. -mmcu=$(DEVICE) -DBOOTLOADER_ADDRESS=0x$(BOOTLOADER_ADDRESS) -DF_CPU=$(F_CPU) $(DEFINES) LDFLAGS = -Wl,--relax,--gc-sections -Wl,--section-start=.text=$(BOOTLOADER_ADDRESS) OBJECTS = usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o @@ -114,6 +123,9 @@ OBJECTS = usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o # symbolic targets: all: main.hex +install: main.hex + cp -Rvp main.hex ./hexfiles/usbasploader.hex + .c.o: $(CC) $(CFLAGS) -c $< -o $@ @@ -142,6 +154,9 @@ lock: read_fuses: $(UISP) --rd_fuses +deepclean: clean + rm -f *~ + clean: rm -f main.hex main.bin *.o usbdrv/*.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s @@ -152,7 +167,7 @@ main.bin: $(OBJECTS) main.hex: main.bin rm -f main.hex main.eep.hex avr-objcopy -j .text -j .data -O ihex main.bin main.hex - avr-size main.hex + avr-size main.bin disasm: main.bin avr-objdump -d main.bin