aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.common37
-rwxr-xr-xconfigure8
-rw-r--r--rules.mk12
-rw-r--r--test/module.mk2
-rw-r--r--tools/module.mk12
-rw-r--r--tools/skycpt/Makefile6
6 files changed, 50 insertions, 27 deletions
diff --git a/Makefile.common b/Makefile.common
index caf5ba22fa..2b00605318 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -62,9 +62,24 @@ DEPFILES =
# the build date in gScummVMBuildDate is correct.
base/version.o: $(filter-out base/libbase.a,$(OBJS))
+# Replace regular output with quiet messages
+ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifneq ($(VERBOSE_BUILD),1)
+ifneq ($(VERBOSE_BUILD),yes)
+QUIET_CXX = @echo ' ' C++ ' ' $@;
+QUIET_NASM = @echo ' ' NASM ' ' $@;
+QUIET_AR = @echo ' ' AR ' ' $@;
+QUIET_RANLIB = @echo ' ' RANLIB ' ' $@;
+QUIET_PLUGIN = @echo ' ' PLUGIN ' ' $@;
+QUIET_LINK = @echo ' ' LINK ' ' $@;
+QUIET = @
+endif
+endif
+endif
+
# The build rule for the ScummVM executable
$(EXECUTABLE): $(OBJS)
- $(CXX) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@
+ $(QUIET_LINK)$(CXX) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@
distclean: clean
$(RM) config.h config.mk config.log
@@ -83,27 +98,27 @@ ifndef HAVE_GCC3
# If you use GCC, disable the above and enable this for intelligent
# dependency tracking.
%.o: %.cpp
- $(MKDIR) $(*D)/$(DEPDIR)
- $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
- $(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
- $(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
- $(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
+ $(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
+ $(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+ $(QUIET)$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
+ $(QUIET)$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
+ $(QUIET)$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
else
# If you even have GCC 3.x, you can use this build rule, which is safer; the above
# rule can get you into a bad state if you Ctrl-C at the wrong moment.
# Also, with this GCC inserts additional dummy rules for the involved headers,
# which ensures a smooth compilation even if said headers become obsolete.
%.o: %.cpp
- $(MKDIR) $(*D)/$(DEPDIR)
- $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+ $(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
+ $(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
%.o: %.m
- $(MKDIR) $(*D)/$(DEPDIR)
- $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(OBJCFLAGS) -c $(<) -o $*.o
+ $(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
+ $(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(OBJCFLAGS) -c $(<) -o $*.o
endif
ifdef HAVE_NASM
%.o: %.asm
- $(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
+ $(QUIET_NASM)$(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
endif
# Include the dependency tracking files.
diff --git a/configure b/configure
index 09a214ca59..d7b43f05cc 100755
--- a/configure
+++ b/configure
@@ -125,6 +125,7 @@ _backend=sdl
_endian=unknown
_need_memalign=no
_have_x86=no
+_verbose_build=no
_dynamic_modules=no
_plugins_default=static
_nasm=auto
@@ -660,6 +661,7 @@ for ac_option in $@; do
--disable-fluidsynth) _fluidsynth=no ;;
--enable-readline) _readline=yes ;;
--disable-readline) _readline=no ;;
+ --enable-verbose-build) _verbose_build=yes ;;
--enable-plugins) _dynamic_modules=yes ;;
--default-dynamic) _plugins_default=dynamic ;;
--enable-mt32emu) _mt32emu=yes ;;
@@ -1532,6 +1534,12 @@ add_to_config_h_if_yes $_have_x86 '#define HAVE_X86'
add_to_config_h_if_yes $_need_memalign '#define SCUMM_NEED_ALIGNMENT'
+#
+# Check whether to enable a verbose build
+#
+echo_n "Checking whether to have a verbose build... "
+echo "$_verbose_build"
+add_to_config_mk_if_yes "$_verbose_build" 'VERBOSE_BUILD = 1'
#
# Check whether plugin support is requested and possible
diff --git a/rules.mk b/rules.mk
index f2365f8928..0687644e02 100644
--- a/rules.mk
+++ b/rules.mk
@@ -23,7 +23,7 @@ ifdef TOOL_EXECUTABLE
################################################
TOOL-$(MODULE) := $(MODULE)/$(TOOL_EXECUTABLE)$(EXEEXT)
$(TOOL-$(MODULE)): $(MODULE_OBJS-$(MODULE))
- $(CXX) $(LDFLAGS) $+ -o $@
+ $(QUIET_CXX)$(CXX) $(LDFLAGS) $+ -o $@
# Reset TOOL_EXECUTABLE var
TOOL_EXECUTABLE:=
@@ -42,8 +42,8 @@ ifdef PLUGIN
################################################
PLUGIN-$(MODULE) := plugins/$(PLUGIN_PREFIX)$(notdir $(MODULE))$(PLUGIN_SUFFIX)
$(PLUGIN-$(MODULE)): $(MODULE_OBJS-$(MODULE)) $(PLUGIN_EXTRA_DEPS)
- $(MKDIR) plugins
- $(CXX) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) -o $@
+ $(QUIET)$(MKDIR) plugins
+ $(QUIET_PLUGIN)$(CXX) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) -o $@
# Reset PLUGIN var
PLUGIN:=
@@ -69,9 +69,9 @@ OBJS += $(MODULE_LIB-$(MODULE))
# Convenience library target
$(MODULE_LIB-$(MODULE)): $(MODULE_OBJS-$(MODULE))
- -$(RM) $@
- $(AR) $@ $+
- $(RANLIB) $@
+ $(QUIET)-$(RM) $@
+ $(QUIET_AR)$(AR) $@ $+
+ $(QUIET_RANLIB)$(RANLIB) $@
# Pseudo target for comfort, allows for "make common", "make gui" etc.
$(MODULE): $(MODULE_LIB-$(MODULE))
diff --git a/test/module.mk b/test/module.mk
index 64cb34c7ac..79a1a12023 100644
--- a/test/module.mk
+++ b/test/module.mk
@@ -22,7 +22,7 @@ TEST_LDFLAGS :=
test: test/runner
./test/runner
test/runner: test/runner.cpp $(TEST_LIBS)
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TEST_LDFLAGS) $(TEST_CFLAGS) -o $@ $+
+ $(QUIET_LINK)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TEST_LDFLAGS) $(TEST_CFLAGS) -o $@ $+
test/runner.cpp: $(TESTS)
@mkdir -p test
$(srcdir)/test/cxxtest/cxxtestgen.py $(TEST_FLAGS) -o $@ $+
diff --git a/tools/module.mk b/tools/module.mk
index 9ad972f477..4c1ea57da6 100644
--- a/tools/module.mk
+++ b/tools/module.mk
@@ -33,16 +33,16 @@ clean-tools:
#
tools/convbdf$(EXEEXT): $(srcdir)/tools/convbdf.c
- $(MKDIR) tools/$(DEPDIR)
- $(CC) $(CFLAGS) -Wall -o $@ $<
+ $(QUIET)$(MKDIR) tools/$(DEPDIR)
+ $(QUIET_LINK)$(CC) $(CFLAGS) -Wall -o $@ $<
tools/md5table$(EXEEXT): $(srcdir)/tools/md5table.c
- $(MKDIR) tools/$(DEPDIR)
- $(CC) $(CFLAGS) -Wall -o $@ $<
+ $(QUIET)$(MKDIR) tools/$(DEPDIR)
+ $(QUIET_LINK)$(CC) $(CFLAGS) -Wall -o $@ $<
tools/make-scumm-fontdata$(EXEEXT): $(srcdir)/tools/make-scumm-fontdata.c
- $(MKDIR) tools/$(DEPDIR)
- $(CC) $(CFLAGS) -Wall -o $@ $<
+ $(QUIET)$(MKDIR) tools/$(DEPDIR)
+ $(QUIET_LINK)$(CC) $(CFLAGS) -Wall -o $@ $<
#
# Rules to explicitly rebuild the credits / MD5 tables.
diff --git a/tools/skycpt/Makefile b/tools/skycpt/Makefile
index bfa9937519..b907e6782d 100644
--- a/tools/skycpt/Makefile
+++ b/tools/skycpt/Makefile
@@ -9,10 +9,10 @@ OBJS=AsciiCptCompile.o cptcompiler.o cpthelp.o idFinder.o KmpSearch.o stdafx.o T
all: $(TARGET)
clean:
- rm -f $(TARGET) $(OBJS)
+ $(QUIET)$(RM) $(TARGET) $(OBJS)
$(TARGET): $(OBJS)
- $(CC) $(OBJS) $(LDFLAGS) -o $(TARGET)
+ $(QUIET_CXX)$(CXX) $(OBJS) $(LDFLAGS) -o $(TARGET)
%.o: %.cpp
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ \ No newline at end of file
+ $(QUIET_CXX)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@