[FFmpeg-devel] [PATCH] Buildsystem verbosity suppression

Matti Hamalainen mhamalai
Sun Aug 9 02:32:42 CEST 2009


On Sat, 8 Aug 2009, William R. Zwicky wrote:

> Matti Hamalainen wrote:
> > Attached patch suppresses most of the build system noise by default.
> >   
> I can't apply this patch.  The common.mak I got from svn at ffmpeg.org (trunk)
> is missing the last four of the % rules, and the three that are present don't
> match what the patch expects.
> 
> If the patch is partially applied (everything but common.mak) then it won't
> build.  It complains about some .o files missing (I forgot to copy the
> message, sorry.)

Oops, seems that mr. Rullg?rd had sneaked in some changes in trunk while 
I cleaned up this patch for posting. Here's an updated version.

-- 
] ccr/TNSP^DKD^pWp  :: ccr tnsp org ::  http://ccr.tnsp.org/
] PGP key: 0466 95ED 96DF 3701 C71D D62D 10A6 28A6 1374 C112
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 19609)
+++ configure	(working copy)
@@ -223,6 +223,7 @@
   echo "  --disable-yasm           disable use of yasm assembler"
   echo
   echo "Developer options (useful when working on FFmpeg itself):"
+  echo "  --enable-verbose-build   do not suppress certain build system output"
   echo "  --disable-debug          disable debugging symbols"
   echo "  --enable-debug=LEVEL     set the debug level [$debuglevel]"
   echo "  --enable-gprof           enable profiling with gprof [$gprof]"
@@ -991,6 +992,7 @@
     optimizations
     stripping
     yasm
+    verbose_build
 "
 
 PATHS_LIST='
@@ -2632,6 +2634,7 @@
 echo "HOSTLIBS=$host_libs" >> config.mak
 echo "TARGET_EXEC=$target_exec" >> config.mak
 echo "TARGET_PATH=$target_path" >> config.mak
+echo "VERBOSE_BUILD=$verbose_build" >> config.mak
 
 if enabled sdl; then
     echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak
Index: subdir.mak
===================================================================
--- subdir.mak	(revision 19609)
+++ subdir.mak	(working copy)
@@ -22,19 +22,19 @@
 
 define RULES
 $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
-	$(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
+	$(call build_cmd,LD,$<, $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) )
 
 $(SUBDIR)%-test.o: $(SUBDIR)%.c
-	$(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
+	$(call build_cmd,CC-TEST,$<, $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^ )
 
 $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
-	$(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
+	$(call build_cmd,CC-TEST,$<, $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^ )
 
 $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
-	$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
+	$(call build_cmd,YASM,$<, $(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$< )
 
 $(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
-	$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
+	$(call build_cmd,DEPEND,$< $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@ )
 
 clean::
 	rm -f $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
Index: common.mak
===================================================================
--- common.mak	(revision 19609)
+++ common.mak	(working copy)
@@ -20,16 +20,18 @@
 
 CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
 
+build_cmd = @if test "x$(VERBOSE_BUILD)" != "xyes"; then echo "[$1] $2"; else echo "$3"; fi; eval "$3"
+
 %.o: %.c
 	$(CCDEP)
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) $(LIBOBJFLAGS) -c $(CC_O) $<
+	$(call build_cmd,CC,$<, $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -c $(CC_O) $< )
 
 %.o: %.S
 	$(ASDEP)
-	$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
+	$(call build_cmd,AS,$<, $(AS) $(CPPFLAGS) $(ASFLAGS) $(LIBOBJFLAGS) -c -o $@ $< )
 
 %.ho: %.h
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
+	$(call build_cmd,HO,$<, $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $< )
 
 %$(EXESUF): %.c
 



More information about the ffmpeg-devel mailing list