From 4646801181a6e12e36352fa874089ffeb9474eb3 Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Wed, 8 Jan 2014 10:15:39 -0800 Subject: [PATCH] Make build output quieter. Use make V=1e make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity. This should fix issue #117 --- py/py.mk | 45 ++++++++++++++++++++++++++++++++++++++------- stm/Makefile | 31 ++++++++++++++++++++----------- teensy/Makefile | 29 +++++++++++++++++++---------- unix-cpy/Makefile | 11 +++++++---- unix/Makefile | 11 +++++++---- 5 files changed, 91 insertions(+), 36 deletions(-) diff --git a/py/py.mk b/py/py.mk index be32bc5fb3..c6c4e97058 100644 --- a/py/py.mk +++ b/py/py.mk @@ -1,3 +1,28 @@ +########## +# The following should eventually go into a more central location +# when a reorg is done. +# +# Turn on increased build verbosity by defining BUILD_VERBOSE in your main +# Makefile or in your environment. You can also use V=1 on the make command +# line. +ifeq ("$(origin V)", "command line") +BUILD_VERBOSE=$(V) +endif +ifndef BUILD_VERBOSE +BUILD_VERBOSE = 0 +endif +ifeq ($(BUILD_VERBOSE),0) +Q = @ +else +Q = +endif +# Since this is a new feature, advertise it +ifeq ($(BUILD_VERBOSE),0) +$(info Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.) +endif +# +######### + # default settings; can be overriden in main Makefile ifndef PY_SRC @@ -11,7 +36,7 @@ endif # to create the build directory $(BUILD): - mkdir -p $@ + $(Q)mkdir -p $@ # where py object files go (they have a name prefix to prevent filename clashes) @@ -80,24 +105,30 @@ PY_O_BASENAME = \ PY_O = $(addprefix $(PY_BUILD), $(PY_O_BASENAME)) $(PY_BUILD)emitnx64.o: $(PY_SRC)/emitnative.c $(PY_SRC)/emit.h mpconfigport.h - $(CC) $(CFLAGS) -DN_X64 -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -DN_X64 -c -o $@ $< $(PY_BUILD)emitnthumb.o: $(PY_SRC)/emitnative.c $(PY_SRC)/emit.h mpconfigport.h - $(CC) $(CFLAGS) -DN_THUMB -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -DN_THUMB -c -o $@ $< $(PY_BUILD)%.o: $(PY_SRC)/%.S - $(CC) $(CFLAGS) -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -c -o $@ $< $(PY_BUILD)%.o: $(PY_SRC)/%.c mpconfigport.h - $(CC) $(CFLAGS) -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -c -o $@ $< # optimising gc for speed; 5ms down to 4ms on pybv2 $(PY_BUILD)gc.o: $(PY_SRC)/gc.c - $(CC) $(CFLAGS) -O3 -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -O3 -c -o $@ $< # optimising vm for speed, adds only a small amount to code size but makes a huge difference to speed (20% faster) $(PY_BUILD)vm.o: $(PY_SRC)/vm.c - $(CC) $(CFLAGS) -O3 -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -O3 -c -o $@ $< # header dependencies diff --git a/stm/Makefile b/stm/Makefile index 26b4baf614..644a64c479 100644 --- a/stm/Makefile +++ b/stm/Makefile @@ -6,6 +6,7 @@ include ../py/py.mk # program for deletion RM = /bin/rm +ECHO = @echo STMSRC=lib #STMOTGSRC=lib-otg @@ -115,35 +116,43 @@ OBJ = $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(SRC_S:.s=.o) $(SRC_FATFS:.c=.o) $( all2: $(BUILD) $(BUILD)/flash.dfu $(BUILD)/flash.dfu: $(BUILD)/flash0.bin $(BUILD)/flash1.bin - python $(DFU) -b 0x08000000:$(BUILD)/flash0.bin -b 0x08020000:$(BUILD)/flash1.bin $@ + $(ECHO) "Create $@" + $(Q)python $(DFU) -b 0x08000000:$(BUILD)/flash0.bin -b 0x08020000:$(BUILD)/flash1.bin $@ $(BUILD)/flash0.bin: $(BUILD)/flash.elf - $(OBJCOPY) -O binary -j .isr_vector $^ $@ + $(Q)$(OBJCOPY) -O binary -j .isr_vector $^ $@ $(BUILD)/flash1.bin: $(BUILD)/flash.elf - $(OBJCOPY) -O binary -j .text -j .data $^ $@ + $(Q)$(OBJCOPY) -O binary -j .text -j .data $^ $@ $(BUILD)/flash.elf: $(OBJ) - $(LD) $(LDFLAGS) -o $@ $(OBJ) - $(SIZE) $@ + $(ECHO) "LINK $@" + $(Q)$(LD) $(LDFLAGS) -o $@ $(OBJ) + $(Q)$(SIZE) $@ $(BUILD)/%.o: %.s - $(AS) -o $@ $< + $(ECHO) "AS $<" + $(Q)$(AS) -o $@ $< $(BUILD)/%.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -c -o $@ $< $(BUILD)/%.o: $(FATFSSRC)/%.c - $(CC) $(CFLAGS) -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -c -o $@ $< $(BUILD)/%.o: $(STMSRC)/%.c - $(CC) $(CFLAGS) -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -c -o $@ $< #$(BUILD)/%.o: $(STMOTGSRC)/%.c -# $(CC) $(CFLAGS) -c -o $@ $< +# $(ECHO) "CC $<" +# $(Q)$(CC) $(CFLAGS) -c -o $@ $< $(BUILD)/%.o: $(CC3KSRC)/%.c - $(CC) $(CFLAGS) -c -o $@ $< + $(ECHO) "CC $<" + $(Q)$(CC) $(CFLAGS) -c -o $@ $< clean: $(RM) -rf $(BUILD) diff --git a/teensy/Makefile b/teensy/Makefile index fa1ec63e8f..ade9b37040 100644 --- a/teensy/Makefile +++ b/teensy/Makefile @@ -6,6 +6,7 @@ include ../py/py.mk # program for deletion RM = /bin/rm +ECHO = @echo ifeq ($(ARDUINO),) $(error Please define ARDUINO (where TeensyDuino is installed)) @@ -62,35 +63,43 @@ all2: $(BUILD) hex hex: $(BUILD)/flash.hex post_compile: $(BUILD)/flash.hex - $(TOOLS_PATH)/teensy_post_compile -file="$(basename $<)" -path="$(BUILD)" -tools="$(TOOLS_PATH)" + $(ECHO) "Preparing $@ for upload" + $(Q)$(TOOLS_PATH)/teensy_post_compile -file="$(basename $(