Add ability to generate SYM files in the BUILD module. Clean up build system output to be slightly more human readable.

pull/1469/head
Dean Camera 13 years ago
parent 2351c46f0b
commit 3d39cbe94b

@ -178,13 +178,12 @@ SIZE_MCU_FLAG := $(shell $(CROSS)size --help | grep -- --mcu > /dev/null && e
SIZE_FORMAT_FLAG := $(shell $(CROSS)size --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) SIZE_FORMAT_FLAG := $(shell $(CROSS)size --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
begin: build_begin:
@echo "" @echo ""
@echo $(MSG_BUILD_BEGIN) @echo $(MSG_BUILD_BEGIN)
@echo "" @echo ""
end: build_end:
@echo ""
@echo $(MSG_BUILD_END) @echo $(MSG_BUILD_END)
@echo "" @echo ""
@ -201,9 +200,8 @@ check_source:
size: $(TARGET).elf size: $(TARGET).elf
@echo $(MSG_SIZE_CMD) Determining size of \"$<\" @echo $(MSG_SIZE_CMD) Determining size of \"$<\"
@if test -f $(TARGET).elf; then \ @echo ""
$(CROSS)size $(SIZE_MCU_FLAG) $(SIZE_FORMAT_FLAG) $< ; 2>/dev/null; \ $(CROSS)size $(SIZE_MCU_FLAG) $(SIZE_FORMAT_FLAG) $< ; 2>/dev/null;
fi
symbol-sizes: $(TARGET).elf symbol-sizes: $(TARGET).elf
@echo $(MSG_NM_CMD) Extracting \"$<\" symbols with decimal byte sizes @echo $(MSG_NM_CMD) Extracting \"$<\" symbols with decimal byte sizes
@ -215,27 +213,29 @@ clean:
@echo $(MSG_REMOVE_CMD) Removing dependency files of \"$(TARGET)\" @echo $(MSG_REMOVE_CMD) Removing dependency files of \"$(TARGET)\"
rm -f $(DEPENDENCY_FILES) rm -f $(DEPENDENCY_FILES)
@echo $(MSG_REMOVE_CMD) Removing output files of \"$(TARGET)\" @echo $(MSG_REMOVE_CMD) Removing output files of \"$(TARGET)\"
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).map $(TARGET).lss rm -f $(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).map $(TARGET).lss $(TARGET).sym
all: begin check_source gcc_version elf hex lss size end all: build_begin check_source gcc_version elf hex lss sym size build_end
elf: $(TARGET).elf elf: $(TARGET).elf
hex: $(TARGET).hex $(TARGET).eep hex: $(TARGET).hex $(TARGET).eep
lss: $(TARGET).lss lss: $(TARGET).lss
sym: $(TARGET).sym
$(OBJDIR)/%.o: %.c $(MAKEFILE_LIST) $(OBJDIR)/%.o: %.c $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Compiling C file \"$<\" @echo $(MSG_COMPILE_CMD) Compiling C file \"$(notdir $<)\"
$(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_C_FLAGS) $(CC_FLAGS) $(C_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@ $(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_C_FLAGS) $(CC_FLAGS) $(C_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
$(OBJDIR)/%.o: %.cpp $(MAKEFILE_LIST) $(OBJDIR)/%.o: %.cpp $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Compiling C++ file \"$<\" @echo $(MSG_COMPILE_CMD) Compiling C++ file \"$(notdir $<)\"
$(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_CPP_FLAGS) $(CC_FLAGS) $(CPP_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@ $(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_CPP_FLAGS) $(CC_FLAGS) $(CPP_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
$(OBJDIR)/%.o: %.S $(MAKEFILE_LIST) $(OBJDIR)/%.o: %.S $(MAKEFILE_LIST)
@echo $(MSG_ASSEMBLE_CMD) Assembling \"$<\" @echo $(MSG_ASSEMBLE_CMD) Assembling \"$(notdir $<)\"
$(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_ASM_FLAGS) $(CC_FLAGS) $(ASM_FLAGS) $< -o $@ $(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_ASM_FLAGS) $(CC_FLAGS) $(ASM_FLAGS) $< -o $@
.PRECIOUS : $(OBJECT_FILES) .PRECIOUS : $(OBJECT_FILES)
.SECONDARY : %.elf
%.elf: $(OBJECT_FILES) %.elf: $(OBJECT_FILES)
@echo $(MSG_LINKER_CMD) Linking object files into \"$@\" @echo $(MSG_LINKER_CMD) Linking object files into \"$@\"
$(CROSS)gcc $(BASE_CC_FLAGS) $(BASE_LD_FLAGS) $(CC_FLAGS) $(LD_FLAGS) $^ -o $@ $(CROSS)gcc $(BASE_CC_FLAGS) $(BASE_LD_FLAGS) $(CC_FLAGS) $(LD_FLAGS) $^ -o $@
@ -252,8 +252,12 @@ $(OBJDIR)/%.o: %.S $(MAKEFILE_LIST)
@echo $(MSG_OBJDMP_CMD) Extracting LSS file data from \"$<\" @echo $(MSG_OBJDMP_CMD) Extracting LSS file data from \"$<\"
$(CROSS)objdump -h -S -z $< > $@ $(CROSS)objdump -h -S -z $< > $@
%.sym: %.elf
@echo $(MSG_NM_CMD) Extracting SYM file data from \"$<\"
$(CROSS)nm -n $< > $@
# Include build dependency files # Include build dependency files
-include $(DEPENDENCY_FILES) -include $(DEPENDENCY_FILES)
# Phony build targets for this module # Phony build targets for this module
.PHONY: begin end gcc_version check_source size symbol-sizes elf hex lss clean .PHONY: build_begin build_end gcc_version check_source size symbol-sizes elf hex lss clean

@ -90,6 +90,7 @@ help:
@echo " invoked commands and show only the friendly command output, run " @echo " invoked commands and show only the friendly command output, run "
@echo " make with the \"-s\" switch added before the target(s). " @echo " make with the \"-s\" switch added before the target(s). "
@echo "===================================================================" @echo "==================================================================="
@echo " "
@echo " Currently used build system modules in this application: " @echo " Currently used build system modules in this application: "
@echo " " @echo " "
@printf " %b" "$(PRINTABLE_LUFA_BUILD_MODULES:%= - %\n)" @printf " %b" "$(PRINTABLE_LUFA_BUILD_MODULES:%= - %\n)"

@ -95,7 +95,7 @@ cppcheck-config:
cppcheck $(BASE_CPPCHECK_FLAGS) --check-config $(CPPCHECK_FLAGS) $(SRC) cppcheck $(BASE_CPPCHECK_FLAGS) --check-config $(CPPCHECK_FLAGS) $(SRC)
cppcheck: cppcheck:
@echo $(MSG_CPPCHECK_CMD) Performing cppcheck analysis on source files @echo $(MSG_CPPCHECK_CMD) Performing static analysis on source files
cppcheck $(BASE_CPPCHECK_FLAGS) --enable=$(CPPCHECK_ENABLE) $(CPPCHECK_SUPPRESS:%=--suppress=%) $(CPPCHECK_FLAGS) $(SRC) cppcheck $(BASE_CPPCHECK_FLAGS) --enable=$(CPPCHECK_ENABLE) $(CPPCHECK_SUPPRESS:%=--suppress=%) $(CPPCHECK_FLAGS) $(SRC)
# Phony build targets for this module # Phony build targets for this module

@ -29,6 +29,9 @@ ifneq ($(LUFA_PATH),)
include $(LUFA_PATH)/LUFA/Build/lufa.sources.in include $(LUFA_PATH)/LUFA/Build/lufa.sources.in
else else
LUFA_BUILD_MODULES += MASTER
LUFA_BUILD_TARGETS += export_tar version
LUFA_PATH = . LUFA_PATH = .
ARCH = {AVR8,UC3,XMEGA} ARCH = {AVR8,UC3,XMEGA}
DOXYGEN_OVERRIDE_PARAMS = QUIET=YES PROJECT_NUMBER=$(LUFA_VERSION_NUM) DOXYGEN_OVERRIDE_PARAMS = QUIET=YES PROJECT_NUMBER=$(LUFA_VERSION_NUM)

Loading…
Cancel
Save