X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/16f09ab50a6a931f0d8ec22a191288641e937eb1..55aadf97d5d2bd86f2a0c3a53d4608c0cf96471e:/LUFA/CodeTemplates/makefile_template.uc3 diff --git a/LUFA/CodeTemplates/makefile_template.uc3 b/LUFA/CodeTemplates/makefile_template.uc3 index 390c73176..2077ca187 100644 --- a/LUFA/CodeTemplates/makefile_template.uc3 +++ b/LUFA/CodeTemplates/makefile_template.uc3 @@ -52,7 +52,7 @@ ARCH = UC3 # Target board (see library "Board Types" documentation, NONE for projects not requiring -# LUFA board drivers). If USER is selected, put custom board drivers in a directory called +# LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. BOARD = ### INSERT NAME OF BOARD HERE, OR NONE IF NO BOARD DRIVERS USED ### @@ -68,7 +68,7 @@ BOARD = ### INSERT NAME OF BOARD HERE, OR NONE IF NO BOARD DRIVERS USED ### F_CPU = ### INSERT PRESCALED SYSTEM CLOCK SPEED HERE, IN HZ ### -# Input clock frequency. +# USB controller master clock frequency. # This will define a symbol, F_USB, in all source code files equal to the # input clock frequency (before any prescaling is performed) in Hz. This value may # differ from F_CPU, as the USB clock is often sourced from the same oscillator as @@ -76,7 +76,7 @@ F_CPU = ### INSERT PRESCALED SYSTEM CLOCK SPEED HERE, IN HZ ### # clock rate. # # For the UC3 chips, this should be equal to 48MHz or 96MHz. -F_USB = 48000000 +F_USB = ### INSERT CLOCK TO USB MODULE HERE, IN HZ ### # Output format. (can be srec, ihex, binary) @@ -97,8 +97,8 @@ OBJDIR = . LUFA_PATH = ### INSERT PATH TO LUFA LIBRARY RELATIVE TO PROJECT DIRECTORY HERE ### -# LUFA library compile-time options and predefined tokens -LUFA_OPTS = ### INSERT LUFA COMPILE TIME TOKES HERE ### +# LUFA library compile-time options and predefined tokens (add '-D' before each token) +LUFA_OPTS = ### INSERT LUFA COMPILE TIME TOKES HERE ### # Create the LUFA source path variables by including the LUFA root makefile @@ -113,7 +113,7 @@ SRC = $(TARGET).c \ # List C++ source files here. (C dependencies are automatically generated.) -CPPSRC = +CPPSRC = # List Assembler source files here. @@ -123,17 +123,13 @@ CPPSRC = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = Exception.S +ASRC = -# Optimization level, can be [0, 1, 2, 3, s]. +# Optimization level, can be [0, 1, 2, 3, s]. # 0 = turn off optimization. s = optimize for size. # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) -OPT = 0 - - -# Debugging level. -DEBUG = 3 +OPT = s # List any extra directories to look for include files here. @@ -172,10 +168,11 @@ CPPDEFS += -DF_USB=$(F_USB)UL CPPDEFS += -DBOARD=BOARD_$(BOARD) CPPDEFS += -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) -#CPPDEFS += -D__STDC_LIMIT_MACROS -#CPPDEFS += -D__STDC_CONSTANT_MACROS +# Debugging level. +DEBUG = 3 + #---------------- Compiler Options C ---------------- # -g*: generate debugging information @@ -191,9 +188,9 @@ CFLAGS += -funsigned-char CFLAGS += -funsigned-bitfields CFLAGS += -ffunction-sections CFLAGS += -fno-strict-aliasing -CFLAGS += -masm-addr-pseudos CFLAGS += -Wall CFLAGS += -Wstrict-prototypes +CFLAGS += -masm-addr-pseudos CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) CFLAGS += $(CSTANDARD) @@ -229,9 +226,9 @@ CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) # for use in COFF files, additional information about filenames # and function names needs to be present in the assembler source # files -- see avr-libc docs [FIXME: not yet described there] -# -listing-cont-lines: Sets the maximum number of continuation lines of hex +# -listing-cont-lines: Sets the maximum number of continuation lines of hex # dump that will be displayed for a given single line of source input. -ASFLAGS = -g3 $(ADEFS) +ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100 #---------------- Linker Options ---------------- @@ -241,7 +238,7 @@ ASFLAGS = -g3 $(ADEFS) LDFLAGS = -Wl,-Map=$(TARGET).map,--cref LDFLAGS += -Wl,--gc-sections --rodata-writable LDFLAGS += -Wl,--direct-data -#LDFLAGS += -T avr32elf_uc3b0256.x +#LDFLAGS += -T linker_script.x #============================================================================ @@ -266,7 +263,7 @@ WINSHELL = cmd MSG_ERRORS_NONE = Errors: none MSG_BEGIN = -------- begin -------- MSG_END = -------- end -------- -MSG_SIZE_BEFORE = Size before: +MSG_SIZE_BEFORE = Size before: MSG_SIZE_AFTER = Size after: MSG_COFF = Converting to AVR COFF: MSG_FLASH = Creating load file for Flash: @@ -284,10 +281,10 @@ MSG_CREATING_LIBRARY = Creating library: # Define all object files. -OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) # Define all listing files. -LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) +LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) # Compiler flags to generate dependency files. @@ -351,11 +348,11 @@ sizeafter: # Display compiler version information. -gccversion : +gccversion : @$(CC) --version -# Program the device. +# Program the device. flip: $(TARGET).hex batchisp -hardware usb -device $(MCU) -operation erase f batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program @@ -377,7 +374,7 @@ dfu: $(TARGET).hex %.lss: %.elf @echo @echo $(MSG_EXTENDED_LISTING) $@ - $(OBJDUMP) -h -S $< > $@ + $(OBJDUMP) -h -S -z $< > $@ # Create a symbol table from ELF output file. %.sym: %.elf @@ -409,14 +406,14 @@ dfu: $(TARGET).hex $(OBJDIR)/%.o : %.c @echo @echo $(MSG_COMPILING) $< - $(CC) -c $(ALL_CFLAGS) $< -o $@ + $(CC) -c $(ALL_CFLAGS) $< -o $@ # Compile: create object files from C++ source files. $(OBJDIR)/%.o : %.cpp @echo @echo $(MSG_COMPILING_CPP) $< - $(CC) -c $(ALL_CPPFLAGS) $< -o $@ + $(CC) -c $(ALL_CPPFLAGS) $< -o $@ # Compile: create assembler files from C source files. @@ -438,7 +435,7 @@ $(OBJDIR)/%.o : %.S # Create preprocessed source for use in sending a bug report. %.i : %.c - $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ + $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ # Target: clean project. @@ -468,6 +465,15 @@ doxygen: clean_doxygen: rm -rf Documentation +checksource: + @for f in $(SRC) $(CPPSRC) $(ASRC); do \ + if [ -f $$f ]; then \ + echo "Found Source File: $$f" ; \ + else \ + echo "Source File Not Found: $$f" ; \ + fi; done + + # Create object files directory $(shell mkdir $(OBJDIR) 2>/dev/null) @@ -479,5 +485,5 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) # Listing of phony targets. .PHONY : all begin finish end sizebefore sizeafter gccversion \ build elf hex lss sym doxygen clean clean_list clean_doxygen \ -dfu flip +dfu flip checksource