[x264-devel] [PATCH 1/2] Add FFmpeg-style silent build rules

Diego Biurrun diego at biurrun.de
Fri Apr 4 19:32:01 CEST 2014


This was written by Mans back in the day, so you should not set yourself
as author.  Also, the idea of silencing the build comes from autotools,
śo these are autotools-style silent build rules, not FFmpeg-style.

On Fri, Apr 04, 2014 at 09:41:53AM -0400, Stephen Hutchinson wrote:
> Similar to autotools, the V variable can be passed directly to
> make in order to enable or disable the silent rules. V=0 (the
> default) turns them on, anything other than zero turns them off.
> 
> The --verbose-build-rules option has been added for those that
> want to disable them through configure instead.

I'm skeptical of the usefulness of the configure option.

> --- a/Makefile
> +++ b/Makefile
> @@ -2,6 +2,18 @@
>  
>  include config.mak
>  
> +# Silent make rules, adapted from FFmpeg's common.mak
> +ifeq ($(V), 0)
> +ECHO   = printf "$(1)\t%s\n" $(2)
> +BRIEF  = CC AS YASM AR LD STRIP CP RC RANLIB
> +
> +MSG    = $@
> +M      = @$(call ECHO,$(TAG),$@);
> +$(foreach VAR,$(BRIEF), \
> +    $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
> +endif

Why did you leave out SILENT?

> +# End of main silent make rules definition

Redundant comment is redundant.

> @@ -199,9 +211,17 @@ $(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK): .depend
>  
> +# Force a newline after generating each .depend, or else we get spammed with
> +# '@printf: not found' errors when the silent build rules are enabled. The
> +# define is necessary in order to actually use typical newline \n notation.
> +define \n
> +
> +
> +endef

This looks suspiciously like a hack to paper over some other problem.

>  .depend: config.mak
>  	@rm -f .depend
> -	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS) $(SRCCLI) $(SRCSO)), $(CC) $(CFLAGS) $(SRC) $(DEPMT) $(SRC:$(SRCPATH)/%.c=%.o) $(DEPMM) 1>> .depend;)
> +	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS) $(SRCCLI) $(SRCSO)), $(CC_SILENT) $(CFLAGS) $(SRC) $(DEPMT) $(SRC:$(SRCPATH)/%.c=%.o) $(DEPMM) 1>> .depend;${\n})
>  
> @@ -259,7 +279,7 @@ install-lib-dev:
>  
>  install-lib-static: lib-static install-lib-dev
>  	$(INSTALL) -m 644 $(LIBX264) $(DESTDIR)$(libdir)
> -	$(if $(RANLIB), $(RANLIB) $(DESTDIR)$(libdir)/$(LIBX264))
> +	$(if $(RANLIB), $(RANLIB_VERBOSE) $(DESTDIR)$(libdir)/$(LIBX264))

Why do you manually silence these two?

Diego


More information about the x264-devel mailing list