X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/e611b250c170c9e830f8212ca5d49e505e3f4af1..fa8beef82d1340a69390d4b11ca785ee016789c5:/Bootloaders/CDC/makefile diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile index f9924fe4e..3c79cb649 100644 --- a/Bootloaders/CDC/makefile +++ b/Bootloaders/CDC/makefile @@ -51,7 +51,7 @@ MCU = at90usb1287 -# Target board (see library BoardTypes.h documentation, USER or blank for projects not requiring +# Target board (see library "Board Types" documentation, USER or blank for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. BOARD = USBKEY @@ -89,7 +89,11 @@ F_CPU = 8000000 # # If no clock division is performed on the input clock inside the AVR (via the # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_CLOCK = 8000000 +F_CLOCK = $(F_CPU) + + +# Starting byte address of the bootloader +BOOT_START = 0x1E000 # Output format. (can be srec, ihex, binary) @@ -106,17 +110,36 @@ TARGET = BootloaderCDC OBJDIR = . +# Path to the LUFA library +LUFA_PATH = ../.. + + +# LUFA library compile-time options +LUFA_OPTS = -D USB_DEVICE_ONLY +LUFA_OPTS += -D USE_NONSTANDARD_DESCRIPTOR_NAMES +LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 +LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 +LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 +LUFA_OPTS += -D USE_RAM_DESCRIPTORS +LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" +LUFA_OPTS += -D NO_INTERNAL_SERIAL + + # List C source files here. (C dependencies are automatically generated.) -SRC = $(TARGET).c \ - Descriptors.c \ - ../../LUFA/Drivers/USB/LowLevel/LowLevel.c \ - ../../LUFA/Drivers/USB/LowLevel/Endpoint.c \ - ../../LUFA/Drivers/USB/LowLevel/DevChapter9.c \ - ../../LUFA/Drivers/USB/HighLevel/USBTask.c \ - ../../LUFA/Drivers/USB/HighLevel/USBInterrupt.c \ - ../../LUFA/Drivers/USB/HighLevel/Events.c \ - ../../LUFA/Drivers/USB/HighLevel/StdDescriptors.c \ - +SRC = $(TARGET).c \ + Descriptors.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBInterrupt.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c \ + + # List C++ source files here. (C dependencies are automatically generated.) CPPSRC = @@ -148,7 +171,7 @@ DEBUG = dwarf-2 # Each directory must be seperated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS = ../../ +EXTRAINCDIRS = $(LUFA_PATH)/ # Compiler flag to set the C Standard level. @@ -159,16 +182,9 @@ EXTRAINCDIRS = ../../ CSTANDARD = -std=gnu99 -# Starting byte address of the bootloader -BOOT_START = 0x1E000 - - # Place -D or -U options here for C sources -CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) -CDEFS += -DUSB_DEVICE_ONLY -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -CDEFS += -DSTATIC_ENDPOINT_CONFIGURATION -DFIXED_CONTROL_ENDPOINT_SIZE=8 -CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -CDEFS += -DUSE_RAM_DESCRIPTORS -DBOOT_START_ADDR=$(BOOT_START)UL -DUSE_SINGLE_DEVICE_CONFIGURATION +CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS) +CDEFS += -DBOOT_START_ADDR=$(BOOT_START)UL # Place -D or -U options here for ASM sources @@ -198,10 +214,6 @@ CFLAGS += -ffunction-sections CFLAGS += -fpack-struct CFLAGS += -fshort-enums CFLAGS += -fno-inline-small-functions -CFLAGS += -fno-reorder-blocks -CFLAGS += -fno-reorder-blocks-and-partition -CFLAGS += -fno-reorder-functions -CFLAGS += -fno-toplevel-reorder CFLAGS += -Wall CFLAGS += -Wstrict-prototypes CFLAGS += -Wundef @@ -446,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) # Default target. -all: begin gccversion sizebefore build checkhooks checklibmode checkboard sizeafter end +all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end # Change the build target to build a HEX file or a library. build: elf hex eep lss sym @@ -489,27 +501,29 @@ sizeafter: @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ 2>/dev/null; echo; fi -checkhooks: build +showeventhooks: build @echo - @echo ------- Unhooked LUFA Events ------- - @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \ + @echo -------- Unhooked LUFA Events -------- + @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ echo "(None)" - @echo ------------------------------------ + @echo -------------------------------------- -checklibmode: +showliboptions: @echo - @echo ----------- Library Mode ----------- - @$(shell) ($(CC) $(ALL_CFLAGS) -E -dM - < /dev/null \ - | grep 'USB_\(DEVICE\|HOST\)_ONLY' | cut -d' ' -f2 | grep ".*") \ - || echo "No specific mode (both device and host mode allowable)." - @echo ------------------------------------ + @echo ---- Compile Time Library Options ---- + @for i in $(LUFA_OPTS:-D%=%); do \ + echo $$i; \ + done + @echo -------------------------------------- -checkboard: +showtarget: @echo - @echo ---------- Selected Board ---------- - @echo Selected board model is $(BOARD). - @echo ------------------------------------ + @echo --------- Target Information --------- + @echo AVR Model: $(MCU) + @echo Board: $(BOARD) + @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master + @echo -------------------------------------- # Display compiler version information. gccversion : @@ -695,8 +709,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) # Listing of phony targets. -.PHONY : all checkhooks checklibmode checkboard \ -begin finish end sizebefore sizeafter gccversion \ -build elf hex eep lss sym coff extcoff clean \ -clean_list clean_binary program debug gdb-config \ -doxygen \ No newline at end of file +.PHONY : all showeventhooks showliboptions showtarget \ +begin finish end sizebefore sizeafter gccversion build \ +elf hex eep lss sym coff extcoff program clean debug \ +clean_list clean_binary gdb-config doxygen \ No newline at end of file