[x264-devel] [PATCH 2/9] cosmetic: Make .depend generation foreach loop more readable

Diego Biurrun diego at biurrun.de
Sun Apr 27 20:18:49 CEST 2014


On Sat, Apr 26, 2014 at 05:45:16PM -0400, Stephen Hutchinson wrote:
> --- a/Makefile
> +++ b/Makefile
> @@ -201,7 +201,9 @@ $(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK): .depend
>  
>  .depend: config.mak
>  	@rm -f .depend
> -	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS) $(SRCCLI) $(SRCSO)), $(DEPCC) $(CFLAGS) $(SRC) $(DEPMT) $(SRC:$(SRCPATH)/%.c=%.o) $(DEPMM) 1>> .depend;)
> +	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS) $(SRCCLI) $(SRCSO)), \
> +                $(DEPCC) $(CFLAGS) $(SRC) $(DEPMT) \
> +                $(SRC:$(SRCPATH)/%.c=%.o) $(DEPMM) 1>> .depend;)

This should not be made more readable, it should be eliminated.
It's much better to generate dependency information as a sideeffect
of normal compilation, which all modern compilers allow.

Diego


More information about the x264-devel mailing list