From cf8f0be00d29b5ac6216ec71716bee38eab3283e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 13 May 2013 09:05:15 -0700 Subject: Make silent make optional Backport of Thiago's commit 612a6ee2f793 ("Make the "silent mode" compilation be optional only.") from the Qt branch. Requested-by: Cristian Ionescu-Idbohrn Signed-off-by: Thiago Macieira Signed-off-by: Dirk Hohndel --- Makefile | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c87b957c2..7a1eaef1a 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,16 @@ PRODVERSION_STRING := $(shell [ -d .git ] && \ $(GET_VERSION) win $(VERSION_STRING) || \ echo "$(VERSION).0.0") +# 'pretty' output (easy to spot warnings) by default +# 'verbose' output (all the details) by calling with "make V=1" +ifeq ($(V),1) + PRETTYECHO=true + COMPILE_PREFIX= +else + PRETTYECHO=echo + COMPILE_PREFIX=@ +endif + # find libdivecomputer # First deal with the cross compile environment and with Mac. # For the native case, Linus doesn't want to trust pkg-config given @@ -178,7 +188,8 @@ DEPS = $(wildcard .dep/*.dep) all: $(NAME) $(NAME): gen_version_file $(OBJS) $(MSGOBJS) $(INFOPLIST) - $(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS) + @$(PRETTYECHO) ' LINK' $(NAME) + $(COMPILE_PREFIX)$(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS) gen_version_file: ifneq ($(STORED_VERSION_STRING),$(VERSION_STRING)) @@ -282,9 +293,9 @@ EXTRA_FLAGS = $(GTKCFLAGS) $(GLIB2CFLAGS) $(XML2CFLAGS) \ $(LIBSOUPCFLAGS) $(OSMGPSMAPFLAGS) $(GCONF2CFLAGS) %.o: %.c - @echo ' CC' $< + @$(PRETTYECHO) ' CC' $< @mkdir -p .dep - @$(CC) $(CFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $< + $(COMPILE_PREFIX)$(CC) $(CFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $< share/locale/%.UTF-8/LC_MESSAGES/subsurface.mo: po/%.po po/%.aliases mkdir -p $(dir $@) @@ -305,8 +316,8 @@ satellite.png: satellite.svg # The following creates the pixbuf data in .h files with the basename followed by '_pixmap' # as name of the data structure %.h: %.png - @echo ' gdk-pixbuf-csource' $< - @gdk-pixbuf-csource --struct --name `echo $* | sed 's/-/_/g'`_pixbuf $< > $@ + @$(PRETTYECHO) ' gdk-pixbuf-csource' $< + $(COMPILE_PREFIX)gdk-pixbuf-csource --struct --name `echo $* | sed 's/-/_/g'`_pixbuf $< > $@ doc: $(MAKE) -C Documentation doc -- cgit v1.2.3-70-g09d2