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