Skip to content
Snippets Groups Projects
Commit 84fadb25 authored by Dean Camera's avatar Dean Camera
Browse files

Clean up BUILD module info output formatting, remove explicit gcc-version...

Clean up BUILD module info output formatting, remove explicit gcc-version target and add ability to generate assembly listings of compiled source files for debug purposes.
parent 1ba60b4a
No related branches found
No related tags found
No related merge requests found
......@@ -129,6 +129,7 @@ else
endif
# Output Messages
MSG_INFO_MESSAGE := ' [INFO] :'
MSG_COMPILE_CMD := ' [GCC] :'
MSG_ASSEMBLE_CMD := ' [GAS] :'
MSG_NM_CMD := ' [NM] :'
......@@ -206,18 +207,13 @@ endif
size: SIZE_MCU_FLAG := $(shell $(CROSS)-size --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
size: SIZE_FORMAT_FLAG := $(shell $(CROSS)-size --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
build_begin:
@echo $(MSG_INFO_MESSAGE) Begin compilation of project \"$(TARGET)\"...
@echo ""
@echo Begin compilation of project \"$(TARGET)\"...
@echo ""
@$(CROSS)-gcc --version
build_end:
@echo Finished building project \"$(TARGET)\".
@echo ""
gcc-version:
@$(CROSS)-gcc --version
@echo $(MSG_INFO_MESSAGE) Finished building project \"$(TARGET)\".
check-source:
@for f in $(SRC); do \
......@@ -246,7 +242,7 @@ clean: mostlyclean
@echo $(MSG_REMOVE_CMD) Removing output files of \"$(TARGET)\"
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).map $(TARGET).lss $(TARGET).sym $(TARGET).a
all: build_begin check-source gcc-version elf hex lss sym size build_end
all: build_begin check-source elf hex lss sym size build_end
lib: lib$(TARGET).a
elf: $(TARGET).elf
......@@ -254,6 +250,14 @@ hex: $(TARGET).hex $(TARGET).eep
lss: $(TARGET).lss
sym: $(TARGET).sym
%.s: %.c $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Generating assembly from C file \"$(notdir $<)\"
$(CROSS)-gcc -S $(BASE_CC_FLAGS) $(BASE_C_FLAGS) $(CC_FLAGS) $(C_FLAGS) $< -o $@
%.s: %.cpp $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Generating assembly from C++ file \"$(notdir $<)\"
$(CROSS)-gcc -S $(BASE_CC_FLAGS) $(BASE_CPP_FLAGS) $(CC_FLAGS) $(CPP_FLAGS) $< -o $@
$(OBJDIR)/%.o: %.c $(MAKEFILE_LIST)
@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 $@
......@@ -298,4 +302,4 @@ $(OBJDIR)/%.o: %.S $(MAKEFILE_LIST)
-include $(DEPENDENCY_FILES)
# Phony build targets for this module
.PHONY: build_begin build_end gcc-version check-source size symbol-sizes lib elf hex lss clean mostlyclean
.PHONY: build_begin build_end check-source size symbol-sizes lib elf hex lss clean mostlyclean
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment