diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-07-19 14:00:44 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-07-19 14:00:44 +0000 |
commit | 6b5e684c77e5fa855b609d01e9a07fec296e9257 (patch) | |
tree | 9ad7cfb13b684d5cdd0ed90703159b015f119734 /Projects/Incomplete | |
parent | 42ac34b484b677ae1004c3d0215b27911a100a71 (diff) | |
download | lufa-6b5e684c77e5fa855b609d01e9a07fec296e9257.tar.gz lufa-6b5e684c77e5fa855b609d01e9a07fec296e9257.tar.bz2 lufa-6b5e684c77e5fa855b609d01e9a07fec296e9257.zip |
Update makefiles to use the latest WinAVR/Atmel toolchain makefile template.
Add new module source variables to the library core makefile, so that module sources can be added to a project's makefile on a per-module rather than per-file basis.
Diffstat (limited to 'Projects/Incomplete')
-rw-r--r-- | Projects/Incomplete/MIDIToneGenerator/makefile | 98 | ||||
-rw-r--r-- | Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c | 10 | ||||
-rw-r--r-- | Projects/Incomplete/StandaloneProgrammer/makefile | 102 |
3 files changed, 84 insertions, 126 deletions
diff --git a/Projects/Incomplete/MIDIToneGenerator/makefile b/Projects/Incomplete/MIDIToneGenerator/makefile index 6b81f58b6..3360a4e8b 100644 --- a/Projects/Incomplete/MIDIToneGenerator/makefile +++ b/Projects/Incomplete/MIDIToneGenerator/makefile @@ -115,29 +115,26 @@ OBJDIR = . LUFA_PATH = ../../.. -# LUFA library compile-time options +# LUFA library compile-time options and predefined tokens LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" +LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 +LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP +LUFA_OPTS += -D NO_DEVICE_SELF_POWER + + +# Create the LUFA source path variables by including the LUFA root makefile +include $(LUFA_PATH)/LUFA/makefile # List C source files here. (C dependencies are automatically generated.) SRC = $(TARGET).c \ Descriptors.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.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/LowLevel/USBInterrupt.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/MIDI.c \ + $(LUFA_SRC_USB) \ + $(LUFA_SRC_USBCLASS) # List C++ source files here. (C dependencies are automatically generated.) @@ -183,15 +180,23 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources -CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS) +CDEFS = -DF_CPU=$(F_CPU)UL +CDEFS += -DF_CLOCK=$(F_CLOCK)UL +CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources -ADEFS = -DF_CPU=$(F_CPU) - +ADEFS = -DF_CPU=$(F_CPU) +ADEFS += -DF_CLOCK=$(F_CLOCK)UL +ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources -CPPDEFS = -DF_CPU=$(F_CPU)UL +CPPDEFS = -DF_CPU=$(F_CPU)UL +CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL +CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS @@ -216,8 +221,9 @@ CFLAGS += -fshort-enums CFLAGS += -fno-strict-aliasing CFLAGS += -Wall CFLAGS += -Wstrict-prototypes -CFLAGS += -Wundef +#CFLAGS += -mshort-calls #CFLAGS += -fno-unit-at-a-time +#CFLAGS += -Wundef #CFLAGS += -Wunreachable-code #CFLAGS += -Wsign-compare CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) @@ -241,7 +247,7 @@ CPPFLAGS += -fpack-struct CPPFLAGS += -fshort-enums CPPFLAGS += -fno-exceptions CPPFLAGS += -Wall -CFLAGS += -Wundef +CPPFLAGS += -Wundef #CPPFLAGS += -mshort-calls #CPPFLAGS += -fno-unit-at-a-time #CPPFLAGS += -Wstrict-prototypes @@ -318,7 +324,7 @@ EXTMEMOPTS = # -Wl,...: tell GCC to pass this to linker. # -Map: create map file # --cref: add cross reference to map file -LDFLAGS = -Wl,-Map=$(TARGET).map,--cref +LDFLAGS = -Wl,-Map=$(TARGET).map,--cref LDFLAGS += -Wl,--relax LDFLAGS += -Wl,--gc-sections LDFLAGS += $(EXTMEMOPTS) @@ -330,9 +336,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) #---------------- Programming Options (avrdude) ---------------- -# Programming hardware: alf avr910 avrisp bascom bsd -# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 -# +# Programming hardware # Type: avrdude -c ? # to get a full listing. # @@ -412,6 +416,7 @@ REMOVEDIR = rm -rf COPY = cp WINSHELL = cmd + # Define Messages # English MSG_ERRORS_NONE = Errors: none @@ -457,7 +462,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) # Default target. -all: begin gccversion sizebefore build showliboptions showtarget sizeafter end +all: begin gccversion sizebefore build sizeafter end # Change the build target to build a HEX file or a library. build: elf hex eep lss sym @@ -488,9 +493,7 @@ end: # Display size of file. HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex -ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf -MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) -FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) +ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf sizebefore: @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \ @@ -500,22 +503,7 @@ sizeafter: @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ 2>/dev/null; echo; fi -showliboptions: - @echo - @echo ---- Compile Time Library Options ---- - @for i in $(LUFA_OPTS:-D%=%); do \ - echo $$i; \ - done - @echo -------------------------------------- -showtarget: - @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 : @@ -605,7 +593,7 @@ extcoff: $(TARGET).elf %.hex: %.elf @echo @echo $(MSG_FLASH) $@ - $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@ %.eep: %.elf @echo @@ -617,7 +605,7 @@ extcoff: $(TARGET).elf %.lss: %.elf @echo @echo $(MSG_EXTENDED_LISTING) $@ - $(OBJDUMP) -h -z -S $< > $@ + $(OBJDUMP) -h -S -z $< > $@ # Create a symbol table from ELF output file. %.sym: %.elf @@ -679,18 +667,16 @@ $(OBJDIR)/%.o : %.S # Create preprocessed source for use in sending a bug report. %.i : %.c $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ - + # Target: clean project. -clean: begin clean_list clean_binary end +clean: begin clean_list end -clean_binary: - $(REMOVE) $(TARGET).hex - -clean_list: +clean_list : + @echo @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex $(REMOVE) $(TARGET).eep - $(REMOVE) $(TARGET)eep.hex $(REMOVE) $(TARGET).cof $(REMOVE) $(TARGET).elf $(REMOVE) $(TARGET).map @@ -701,7 +687,6 @@ clean_list: $(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.i) - $(REMOVE) InvalidEvents.tmp $(REMOVEDIR) .dep doxygen: @@ -721,8 +706,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) # Listing of phony targets. -.PHONY : all showliboptions showtarget begin \ -finish end sizebefore sizeafter gccversion build \ -elf hex eep lss sym coff extcoff program dfu flip \ -flip-ee dfu-ee clean debug clean_list clean_binary \ -clean_doxygen gdb-config doxygen
\ No newline at end of file +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex eep lss sym coff extcoff doxygen clean \ +clean_list clean_doxygen program dfu flip flip-ee dfu-ee \ +debug gdb-config diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c b/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c index f69ab649b..74f6811ad 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c +++ b/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c @@ -250,14 +250,8 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInte */ static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead) { - uint32_t BlockAddress; - uint16_t TotalBlocks; - - /* Load in the 32-bit block address (SCSI uses big-endian, so have to reverse the byte order) */ - BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]); - - /* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */ - TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]); + uint32_t BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]); + uint16_t TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]); /* Check if the block address is outside the maximum allowable value for the LUN */ if (BlockAddress >= VIRTUAL_MEMORY_BLOCKS) diff --git a/Projects/Incomplete/StandaloneProgrammer/makefile b/Projects/Incomplete/StandaloneProgrammer/makefile index 5c2d96a8a..6bf5f056c 100644 --- a/Projects/Incomplete/StandaloneProgrammer/makefile +++ b/Projects/Incomplete/StandaloneProgrammer/makefile @@ -112,10 +112,10 @@ OBJDIR = . # Path to the LUFA library -LUFA_PATH = ../../../ +LUFA_PATH = ../../.. -# LUFA library compile-time options +# LUFA library compile-time options and predefined tokens LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS @@ -123,6 +123,10 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB LUFA_OPTS += -D INTERRUPT_CONTROL_ENDPOINT +# Create the LUFA source path variables by including the LUFA root makefile +include $(LUFA_PATH)/LUFA/makefile + + # List C source files here. (C dependencies are automatically generated.) SRC = $(TARGET).c \ Descriptors.c \ @@ -133,21 +137,10 @@ SRC = $(TARGET).c \ Lib/ProgrammerConfig.c \ Lib/PetiteFATFs/diskio.c \ Lib/PetiteFATFs/pff.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c \ - $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.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/LowLevel/USBInterrupt.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/MassStorage.c \ - $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/MassStorage.c \ + $(LUFA_SRC_USB) \ + $(LUFA_SRC_USBCLASS) \ + $(LUFA_SRC_SERIAL) \ + $(LUFA_SRC_SERIALSTREAM) # List C++ source files here. (C dependencies are automatically generated.) @@ -193,15 +186,23 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources -CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS) +CDEFS = -DF_CPU=$(F_CPU)UL +CDEFS += -DF_CLOCK=$(F_CLOCK)UL +CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources -ADEFS = -DF_CPU=$(F_CPU) - +ADEFS = -DF_CPU=$(F_CPU) +ADEFS += -DF_CLOCK=$(F_CLOCK)UL +ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources -CPPDEFS = -DF_CPU=$(F_CPU)UL +CPPDEFS = -DF_CPU=$(F_CPU)UL +CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL +CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS @@ -226,8 +227,9 @@ CFLAGS += -fshort-enums CFLAGS += -fno-strict-aliasing CFLAGS += -Wall CFLAGS += -Wstrict-prototypes -CFLAGS += -Wundef +#CFLAGS += -mshort-calls #CFLAGS += -fno-unit-at-a-time +#CFLAGS += -Wundef #CFLAGS += -Wunreachable-code #CFLAGS += -Wsign-compare CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) @@ -251,7 +253,7 @@ CPPFLAGS += -fpack-struct CPPFLAGS += -fshort-enums CPPFLAGS += -fno-exceptions CPPFLAGS += -Wall -CFLAGS += -Wundef +CPPFLAGS += -Wundef #CPPFLAGS += -mshort-calls #CPPFLAGS += -fno-unit-at-a-time #CPPFLAGS += -Wstrict-prototypes @@ -328,7 +330,7 @@ EXTMEMOPTS = # -Wl,...: tell GCC to pass this to linker. # -Map: create map file # --cref: add cross reference to map file -LDFLAGS = -Wl,-Map=$(TARGET).map,--cref +LDFLAGS = -Wl,-Map=$(TARGET).map,--cref LDFLAGS += -Wl,--relax LDFLAGS += -Wl,--gc-sections LDFLAGS += $(EXTMEMOPTS) @@ -340,9 +342,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) #---------------- Programming Options (avrdude) ---------------- -# Programming hardware: alf avr910 avrisp bascom bsd -# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 -# +# Programming hardware # Type: avrdude -c ? # to get a full listing. # @@ -422,6 +422,7 @@ REMOVEDIR = rm -rf COPY = cp WINSHELL = cmd + # Define Messages # English MSG_ERRORS_NONE = Errors: none @@ -467,7 +468,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) # Default target. -all: begin gccversion sizebefore build showliboptions showtarget sizeafter end +all: begin gccversion sizebefore build sizeafter end # Change the build target to build a HEX file or a library. build: elf hex eep lss sym @@ -498,9 +499,7 @@ end: # Display size of file. HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex -ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf -MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) -FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) +ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf sizebefore: @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \ @@ -510,22 +509,7 @@ sizeafter: @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ 2>/dev/null; echo; fi -showliboptions: - @echo - @echo ---- Compile Time Library Options ---- - @for i in $(LUFA_OPTS:-D%=%); do \ - echo $$i; \ - done - @echo -------------------------------------- -showtarget: - @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 : @@ -615,7 +599,7 @@ extcoff: $(TARGET).elf %.hex: %.elf @echo @echo $(MSG_FLASH) $@ - $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@ %.eep: %.elf @echo @@ -627,7 +611,7 @@ extcoff: $(TARGET).elf %.lss: %.elf @echo @echo $(MSG_EXTENDED_LISTING) $@ - $(OBJDUMP) -h -z -S $< > $@ + $(OBJDUMP) -h -S -z $< > $@ # Create a symbol table from ELF output file. %.sym: %.elf @@ -689,18 +673,16 @@ $(OBJDIR)/%.o : %.S # Create preprocessed source for use in sending a bug report. %.i : %.c $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ - + # Target: clean project. -clean: begin clean_list clean_binary end +clean: begin clean_list end -clean_binary: - $(REMOVE) $(TARGET).hex - -clean_list: +clean_list : + @echo @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex $(REMOVE) $(TARGET).eep - $(REMOVE) $(TARGET)eep.hex $(REMOVE) $(TARGET).cof $(REMOVE) $(TARGET).elf $(REMOVE) $(TARGET).map @@ -711,7 +693,6 @@ clean_list: $(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.i) - $(REMOVE) InvalidEvents.tmp $(REMOVEDIR) .dep doxygen: @@ -731,8 +712,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) # Listing of phony targets. -.PHONY : all showliboptions showtarget begin \ -finish end sizebefore sizeafter gccversion build \ -elf hex eep lss sym coff extcoff program dfu flip \ -flip-ee dfu-ee clean debug clean_list clean_binary \ -clean_doxygen gdb-config doxygen
\ No newline at end of file +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex eep lss sym coff extcoff doxygen clean \ +clean_list clean_doxygen program dfu flip flip-ee dfu-ee \ +debug gdb-config |