From 5a4a2cdeaff3804484a3404179dd309c43040bf6 Mon Sep 17 00:00:00 2001 Message-Id: <5a4a2cdeaff3804484a3404179dd309c43040bf6.1717764896.git.mdw@distorted.org.uk> From: Mark Wooding Date: Tue, 31 May 2011 21:44:41 +0100 Subject: [PATCH] Makefie: Give the main build the silent treatment. Organization: Straylight/Edgeware From: Mark Wooding --- Makefile | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7fff00d..242bbfd 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,30 @@ SCRIPTS = default: all .PHONY: default +###-------------------------------------------------------------------------- +### Clever silent-rules stuff. + +## Verbosity switch. +V = 0 + +## Suppressing command output. +V_AT = $(V_AT_$V) +V_AT_0 = @ +V_AT_1 = + +## Replacing them with messages. +v_echo = $(call v_echo_$V,$1) +v_echo_0 = @printf " %-6s %s\n" "$1" "$@"; +v_echo_1 = + +## Hacking. +empty = +space = $(empty) $(empty) + +## Specific commands. +V_M4 = $(call v_echo,M4)m4 -P$(space) +V_GEN = $(call v_echo,GEN) + ###-------------------------------------------------------------------------- ### Local configuration. @@ -70,9 +94,8 @@ all: $(TARGETS) .PHONY: all %.sh: %.m4 $(M4_SOURCES) - m4 -P base.m4 $*.m4 $(MAIN_M4_SOURCES) >$@.new - chmod +x $@.new - mv $@.new $@ + $(V_M4)base.m4 $*.m4 $(MAIN_M4_SOURCES) >$@.new + $(V_AT)chmod +x $@.new && mv $@.new $@ clean:; rm -f $(TARGETS) *.new .PHONY: clean -- [mdw]