X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/16f09ab50a6a931f0d8ec22a191288641e937eb1..3309c00a99cca6d4a903aed9ecd092346b767ea0:/LUFA/CodeTemplates/makefile_template.avr8 diff --git a/LUFA/CodeTemplates/makefile_template.avr8 b/LUFA/CodeTemplates/makefile_template.avr8 index 5cfacb4a2..26a3b1445 100644 --- a/LUFA/CodeTemplates/makefile_template.avr8 +++ b/LUFA/CodeTemplates/makefile_template.avr8 @@ -63,7 +63,7 @@ MCU = ### INSERT NAME OF MICROCONTROLLER MODEL HERE ### -# Target architecture (see library "Board Types" documentation). +# Targeted chip architecture (see library "Architectures" documentation) ARCH = AVR8 @@ -133,6 +133,7 @@ SRC = $(TARGET).c \ $(LUFA_SRC_USBCLASS) ### INSERT ADDITIONAL PROJECT SOURCE FILENAMES OR LUFA MODULE NAMES HERE ### + # List C++ source files here. (C dependencies are automatically generated.) CPPSRC = @@ -153,13 +154,6 @@ ASRC = OPT = s -# Debugging format. -# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. -# AVR Studio 4.10 requires dwarf-2. -# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run. -DEBUG = dwarf-2 - - # List any extra directories to look for include files here. # Each directory must be seperated by a space. # Use forward slashes for directory separators. @@ -172,31 +166,38 @@ EXTRAINCDIRS = $(LUFA_PATH)/ # gnu89 = c89 plus GCC extensions # c99 = ISO C99 standard (not yet fully implemented) # gnu99 = c99 plus GCC extensions -CSTANDARD = -std=c99 +CSTANDARD = -std=gnu99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL -CDEFS += -DF_CLOCK=$(F_CLOCK)UL +CDEFS += -DF_USB=$(F_USB)UL CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) -ADEFS += -DF_CLOCK=$(F_CLOCK)UL +ADEFS += -DF_USB=$(F_USB)UL ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL -CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL +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 format. +# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. +# AVR Studio 4.10 requires dwarf-2. +# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run. +DEBUG = dwarf-2 + #---------------- Compiler Options C ---------------- # -g*: generate debugging information @@ -217,11 +218,6 @@ CFLAGS += -fshort-enums CFLAGS += -fno-strict-aliasing CFLAGS += -Wall CFLAGS += -Wstrict-prototypes -#CFLAGS += -mshort-calls -#CFLAGS += -fno-unit-at-a-time -#CFLAGS += -Wundef -#CFLAGS += -Wunreachable-code -#CFLAGS += -Wsign-compare CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) CFLAGS += $(CSTANDARD) @@ -241,14 +237,11 @@ CPPFLAGS += -funsigned-char CPPFLAGS += -funsigned-bitfields CPPFLAGS += -fpack-struct CPPFLAGS += -fshort-enums +CPPFLAGS += -ffunction-sections +CPPFLAGS += -fno-strict-aliasing CPPFLAGS += -fno-exceptions CPPFLAGS += -Wall CPPFLAGS += -Wundef -#CPPFLAGS += -mshort-calls -#CPPFLAGS += -fno-unit-at-a-time -#CPPFLAGS += -Wstrict-prototypes -#CPPFLAGS += -Wunreachable-code -#CPPFLAGS += -Wsign-compare CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst) CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) #CPPFLAGS += $(CSTANDARD) @@ -592,7 +585,7 @@ extcoff: $(TARGET).elf %.hex: %.elf @echo @echo $(MSG_FLASH) $@ - $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@ %.eep: %.elf @echo @@ -696,6 +689,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) @@ -708,4 +710,4 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) .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 +debug gdb-config checksource