Extend build verbosity control

Apply verbosity control for mkdir, cp, srec_cat, objcopy, objdump
This commit is contained in:
George Oikonomou 2018-10-13 22:26:22 +01:00
parent 1841aadf6a
commit ab5d5ba33c
2 changed files with 28 additions and 6 deletions

View File

@ -77,7 +77,8 @@ PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFI
# Provide way to create $(OBJECTDIR) if it has been removed by make clean
$(OBJECTDIR):
mkdir $@
$(TRACE_MKDIR)
$(Q)mkdir $@
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
@ -241,12 +242,20 @@ ifeq ($(V),1)
TRACE_LD =
TRACE_AR =
TRACE_AS =
TRACE_OBJCOPY =
TRACE_OBJDUMP =
TRACE_MKDIR =
TRACE_CP =
Q=
else
TRACE_CC = @echo " CC " $<
TRACE_LD = @echo " LD " $@
TRACE_AR = @echo " AR " $@
TRACE_AS = @echo " AS " $<
TRACE_OBJCOPY = @echo " OBJCOPY " $< "-->" $@
TRACE_OBJDUMP = @echo " OBJDUMP " $< "-->" $@
TRACE_MKDIR = @echo " MKDIR " $@
TRACE_CP = @echo " CP " $< "-->" $@
Q=@
endif

View File

@ -1,3 +1,11 @@
### Verbosity control. Use make V=1 to get verbose builds.
### Extends what we already have in the top-level Makefile
ifeq ($(V),1)
TRACE_SREC_CAT =
else
TRACE_SREC_CAT = @echo " SREC_CAT " $< "-->" $@
endif
CC = arm-none-eabi-gcc
CPP = arm-none-eabi-cpp
LD = arm-none-eabi-gcc
@ -47,18 +55,23 @@ CLEAN += *.elf *.bin *.lst *.hex *.i16hex
.PRECIOUS: %.elf %.hex %.bin
%.i16hex: %.elf
$(OBJCOPY) -O ihex $< $@
$(TRACE_OBJCOPY)
$(Q)$(OBJCOPY) -O ihex $< $@
%.hex: %.i16hex
$(SREC_CAT) $< -intel -o $@ -intel
$(TRACE_SREC_CAT)
$(Q)$(SREC_CAT) $< -intel -o $@ -intel
%.bin: %.elf
$(OBJCOPY) -O binary $(OBJCOPY_FLAGS) $< $@
$(TRACE_OBJCOPY)
$(Q)$(OBJCOPY) -O binary $(OBJCOPY_FLAGS) $< $@
%.lst: %.elf
$(OBJDUMP) $(OBJDUMP_FLAGS) $< > $@
$(TRACE_OBJDUMP)
$(Q)$(OBJDUMP) $(OBJDUMP_FLAGS) $< > $@
### We don't really need the .hex and .bin for the .$(TARGET) but let's make
### sure they get built
%.$(TARGET): %.elf %.hex %.bin
cp $< $@
$(TRACE_CP)
$(Q)cp $< $@