shithub: openh264

Download patch

ref: 856d770af57bad965483ad4da018301dd35392cf
parent: 1e744b1933ffe37c15d1ce426f923083124cdd5b
parent: 8ecdcc717202f6f0bb9485f61f767f811c00da59
author: ekr <ekr@rtfm.com>
date: Wed Jan 29 23:14:36 EST 2014

Merge pull request #260 from mstorsjo/quiet-make

Add a make option for silencing the commands run

--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@
 CFLAGS_M32=-m32
 CFLAGS_M64=-m64
 BUILDTYPE=Release
+V=Yes
 
 ifeq (, $(ENABLE64BIT))
 ifeq ($(ARCH), x86_64)
@@ -60,6 +61,14 @@
 
 
 #### No user-serviceable parts below this line
+ifneq ($(V),Yes)
+    QUIET_CXX = @printf "CXX\t$@\n";
+    QUIET_ASM = @printf "ASM\t$@\n";
+    QUIET_AR  = @printf "AR\t$@\n";
+    QUIET     = @
+endif
+
+
 INCLUDES = -Icodec/api/svc -Icodec/common
 #ASM_INCLUDES = -Iprocessing/src/asm/
 ASM_INCLUDES = -Icodec/common/
@@ -99,7 +108,7 @@
 all:	libraries binaries
 
 clean:
-	rm -f $(OBJS) $(OBJS:.o=.d) $(LIBRARIES) $(BINARIES)
+	$(QUIET)rm -f $(OBJS) $(OBJS:.o=.d) $(LIBRARIES) $(BINARIES)
 
 gtest-bootstrap:
 	svn co https://googletest.googlecode.com/svn/trunk/ gtest
--- a/README.md
+++ b/README.md
@@ -75,6 +75,7 @@
 'make' for automatically detecting 32/64bit and building accordingly
 'make ENABLE64BIT=No' for 32bit builds
 'make ENABLE64BIT=Yes' for 64bit builds
+'make V=No' for a silent build (not showing the actual compiler commands)
 
 The command line programs h264enc and h264dec will appear in the main project directory.
 
--- a/build/gtest-targets.mk
+++ b/build/gtest-targets.mk
@@ -5,11 +5,11 @@
 GTEST_OBJS += $(GTEST_CPP_SRCS:.cc=.o)
 OBJS += $(GTEST_OBJS)
 $(GTEST_SRCDIR)/%.o: $(GTEST_SRCDIR)/%.cc
-	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(GTEST_CFLAGS) $(GTEST_INCLUDES) -c $(CXX_O) $<
+	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(GTEST_CFLAGS) $(GTEST_INCLUDES) -c $(CXX_O) $<
 
 $(LIBPREFIX)gtest.$(LIBSUFFIX): $(GTEST_OBJS)
-	rm -f $@
-	$(AR) $(AR_OPTS) $+
+	$(QUIET)rm -f $@
+	$(QUIET_AR)$(AR) $(AR_OPTS) $+
 
 libraries: $(LIBPREFIX)gtest.$(LIBSUFFIX)
 LIBRARIES += $(LIBPREFIX)gtest.$(LIBSUFFIX)
--- a/build/mktargets.py
+++ b/build/mktargets.py
@@ -27,7 +27,7 @@
     dst = "$(%s_SRCDIR)/%%.o"%(PREFIX)
 
     f.write("%s: %s\n"%(dst, src))
-    f.write('\t$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(' + PREFIX + '_CFLAGS) $(' + PREFIX + '_INCLUDES) -c $(CXX_O) $<\n')
+    f.write('\t$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(' + PREFIX + '_CFLAGS) $(' + PREFIX + '_INCLUDES) -c $(CXX_O) $<\n')
     f.write("\n")
 
 def write_asm_rule_pattern(f):
@@ -35,7 +35,7 @@
     dst = "$(%s_SRCDIR)/%%.o"%(PREFIX)
 
     f.write("%s: %s\n"%(dst, src))
-    f.write('\t$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(' + PREFIX + '_ASMFLAGS) $(' + PREFIX + '_ASM_INCLUDES) -o $@ $<\n')
+    f.write('\t$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(' + PREFIX + '_ASMFLAGS) $(' + PREFIX + '_ASM_INCLUDES) -o $@ $<\n')
     f.write("\n")
 
 
@@ -111,8 +111,8 @@
 
 if args.library is not None:
     f.write("$(LIBPREFIX)%s.$(LIBSUFFIX): $(%s_OBJS)\n"%(args.library, PREFIX))
-    f.write("\trm -f $@\n")
-    f.write("\t$(AR) $(AR_OPTS) $+\n")
+    f.write("\t$(QUIET)rm -f $@\n")
+    f.write("\t$(QUIET_AR)$(AR) $(AR_OPTS) $+\n")
     f.write("\n")
     f.write("libraries: $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library)
     f.write("LIBRARIES += $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library)
@@ -119,7 +119,7 @@
 
 if args.binary is not None:
     f.write("%s$(EXEEXT): $(%s_OBJS) $(LIBS) $(%s_LIBS) $(%s_DEPS)\n"%(args.binary, PREFIX, PREFIX, PREFIX))
-    f.write("\t$(CXX) $(CXX_LINK_O)  $(%s_OBJS) $(%s_LDFLAGS) $(%s_LIBS) $(LDFLAGS) $(LIBS)\n\n"%(PREFIX, PREFIX, PREFIX))
+    f.write("\t$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $(%s_OBJS) $(%s_LDFLAGS) $(%s_LIBS) $(LDFLAGS) $(LIBS)\n\n"%(PREFIX, PREFIX, PREFIX))
     f.write("binaries: %s$(EXEEXT)\n"%args.binary)
     f.write("BINARIES += %s$(EXEEXT)\n"%args.binary)
 
--- a/codec/common/targets.mk
+++ b/codec/common/targets.mk
@@ -24,14 +24,14 @@
 
 OBJS += $(COMMON_OBJS)
 $(COMMON_SRCDIR)/%.o: $(COMMON_SRCDIR)/%.cpp
-	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c $(CXX_O) $<
+	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c $(CXX_O) $<
 
 $(COMMON_SRCDIR)/%.o: $(COMMON_SRCDIR)/%.asm
-	$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(COMMON_ASMFLAGS) $(COMMON_ASM_INCLUDES) -o $@ $<
+	$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(COMMON_ASMFLAGS) $(COMMON_ASM_INCLUDES) -o $@ $<
 
 $(LIBPREFIX)common.$(LIBSUFFIX): $(COMMON_OBJS)
-	rm -f $@
-	$(AR) $(AR_OPTS) $+
+	$(QUIET)rm -f $@
+	$(QUIET_AR)$(AR) $(AR_OPTS) $+
 
 libraries: $(LIBPREFIX)common.$(LIBSUFFIX)
 LIBRARIES += $(LIBPREFIX)common.$(LIBSUFFIX)
--- a/codec/console/dec/targets.mk
+++ b/codec/console/dec/targets.mk
@@ -7,10 +7,10 @@
 H264DEC_OBJS += $(H264DEC_CPP_SRCS:.cpp=.o)
 OBJS += $(H264DEC_OBJS)
 $(H264DEC_SRCDIR)/%.o: $(H264DEC_SRCDIR)/%.cpp
-	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c $(CXX_O) $<
+	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c $(CXX_O) $<
 
 h264dec$(EXEEXT): $(H264DEC_OBJS) $(LIBS) $(H264DEC_LIBS) $(H264DEC_DEPS)
-	$(CXX) $(CXX_LINK_O)  $(H264DEC_OBJS) $(H264DEC_LDFLAGS) $(H264DEC_LIBS) $(LDFLAGS) $(LIBS)
+	$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $(H264DEC_OBJS) $(H264DEC_LDFLAGS) $(H264DEC_LIBS) $(LDFLAGS) $(LIBS)
 
 binaries: h264dec$(EXEEXT)
 BINARIES += h264dec$(EXEEXT)
--- a/codec/console/enc/targets.mk
+++ b/codec/console/enc/targets.mk
@@ -6,10 +6,10 @@
 H264ENC_OBJS += $(H264ENC_CPP_SRCS:.cpp=.o)
 OBJS += $(H264ENC_OBJS)
 $(H264ENC_SRCDIR)/%.o: $(H264ENC_SRCDIR)/%.cpp
-	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264ENC_CFLAGS) $(H264ENC_INCLUDES) -c $(CXX_O) $<
+	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264ENC_CFLAGS) $(H264ENC_INCLUDES) -c $(CXX_O) $<
 
 h264enc$(EXEEXT): $(H264ENC_OBJS) $(LIBS) $(H264ENC_LIBS) $(H264ENC_DEPS)
-	$(CXX) $(CXX_LINK_O)  $(H264ENC_OBJS) $(H264ENC_LDFLAGS) $(H264ENC_LIBS) $(LDFLAGS) $(LIBS)
+	$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $(H264ENC_OBJS) $(H264ENC_LDFLAGS) $(H264ENC_LIBS) $(LDFLAGS) $(LIBS)
 
 binaries: h264enc$(EXEEXT)
 BINARIES += h264enc$(EXEEXT)
--- a/codec/decoder/targets.mk
+++ b/codec/decoder/targets.mk
@@ -35,14 +35,14 @@
 
 OBJS += $(DECODER_OBJS)
 $(DECODER_SRCDIR)/%.o: $(DECODER_SRCDIR)/%.cpp
-	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c $(CXX_O) $<
+	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c $(CXX_O) $<
 
 $(DECODER_SRCDIR)/%.o: $(DECODER_SRCDIR)/%.asm
-	$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(DECODER_ASMFLAGS) $(DECODER_ASM_INCLUDES) -o $@ $<
+	$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(DECODER_ASMFLAGS) $(DECODER_ASM_INCLUDES) -o $@ $<
 
 $(LIBPREFIX)decoder.$(LIBSUFFIX): $(DECODER_OBJS)
-	rm -f $@
-	$(AR) $(AR_OPTS) $+
+	$(QUIET)rm -f $@
+	$(QUIET_AR)$(AR) $(AR_OPTS) $+
 
 libraries: $(LIBPREFIX)decoder.$(LIBSUFFIX)
 LIBRARIES += $(LIBPREFIX)decoder.$(LIBSUFFIX)
--- a/codec/encoder/targets.mk
+++ b/codec/encoder/targets.mk
@@ -48,14 +48,14 @@
 
 OBJS += $(ENCODER_OBJS)
 $(ENCODER_SRCDIR)/%.o: $(ENCODER_SRCDIR)/%.cpp
-	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c $(CXX_O) $<
+	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c $(CXX_O) $<
 
 $(ENCODER_SRCDIR)/%.o: $(ENCODER_SRCDIR)/%.asm
-	$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(ENCODER_ASMFLAGS) $(ENCODER_ASM_INCLUDES) -o $@ $<
+	$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(ENCODER_ASMFLAGS) $(ENCODER_ASM_INCLUDES) -o $@ $<
 
 $(LIBPREFIX)encoder.$(LIBSUFFIX): $(ENCODER_OBJS)
-	rm -f $@
-	$(AR) $(AR_OPTS) $+
+	$(QUIET)rm -f $@
+	$(QUIET_AR)$(AR) $(AR_OPTS) $+
 
 libraries: $(LIBPREFIX)encoder.$(LIBSUFFIX)
 LIBRARIES += $(LIBPREFIX)encoder.$(LIBSUFFIX)
--- a/codec/processing/targets.mk
+++ b/codec/processing/targets.mk
@@ -30,14 +30,14 @@
 
 OBJS += $(PROCESSING_OBJS)
 $(PROCESSING_SRCDIR)/%.o: $(PROCESSING_SRCDIR)/%.cpp
-	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c $(CXX_O) $<
+	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c $(CXX_O) $<
 
 $(PROCESSING_SRCDIR)/%.o: $(PROCESSING_SRCDIR)/%.asm
-	$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(PROCESSING_ASMFLAGS) $(PROCESSING_ASM_INCLUDES) -o $@ $<
+	$(QUIET_ASM)$(ASM) $(ASMFLAGS) $(ASM_INCLUDES) $(PROCESSING_ASMFLAGS) $(PROCESSING_ASM_INCLUDES) -o $@ $<
 
 $(LIBPREFIX)processing.$(LIBSUFFIX): $(PROCESSING_OBJS)
-	rm -f $@
-	$(AR) $(AR_OPTS) $+
+	$(QUIET)rm -f $@
+	$(QUIET_AR)$(AR) $(AR_OPTS) $+
 
 libraries: $(LIBPREFIX)processing.$(LIBSUFFIX)
 LIBRARIES += $(LIBPREFIX)processing.$(LIBSUFFIX)
--- a/test/targets.mk
+++ b/test/targets.mk
@@ -7,10 +7,10 @@
 CODEC_UNITTEST_OBJS += $(CODEC_UNITTEST_CPP_SRCS:.cpp=.o)
 OBJS += $(CODEC_UNITTEST_OBJS)
 $(CODEC_UNITTEST_SRCDIR)/%.o: $(CODEC_UNITTEST_SRCDIR)/%.cpp
-	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(CODEC_UNITTEST_CFLAGS) $(CODEC_UNITTEST_INCLUDES) -c $(CXX_O) $<
+	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(CODEC_UNITTEST_CFLAGS) $(CODEC_UNITTEST_INCLUDES) -c $(CXX_O) $<
 
 codec_unittest$(EXEEXT): $(CODEC_UNITTEST_OBJS) $(LIBS) $(CODEC_UNITTEST_LIBS) $(CODEC_UNITTEST_DEPS)
-	$(CXX) $(CXX_LINK_O)  $(CODEC_UNITTEST_OBJS) $(CODEC_UNITTEST_LDFLAGS) $(CODEC_UNITTEST_LIBS) $(LDFLAGS) $(LIBS)
+	$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $(CODEC_UNITTEST_OBJS) $(CODEC_UNITTEST_LDFLAGS) $(CODEC_UNITTEST_LIBS) $(LDFLAGS) $(LIBS)
 
 binaries: codec_unittest$(EXEEXT)
 BINARIES += codec_unittest$(EXEEXT)