Subject: Re: [PATCH 5/7] Makefile: add 'check-sort' target

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Wed, 17 Mar 2021 18:42:11 +0100

On Wed, Mar 17 2021, Jeff King wrote:

>  SCRIPT_SH += git-bisect.sh
>  SCRIPT_SH += git-difftool--helper.sh
>  SCRIPT_SH += git-filter-branch.sh
> @@ -1037,6 +1047,7 @@ LIB_OBJS += ws.o
>  LIB_OBJS += wt-status.o
>  LIB_OBJS += xdiff-interface.o
>  LIB_OBJS += zlib.o
> +$(call check-sort,LIB_OBJS)
>  
>  BUILTIN_OBJS += builtin/add.o
>  BUILTIN_OBJS += builtin/am.o
>
> And then it's just a single-liner for each block that should be checked.
> We haven't used $(call) or $(eval) yet in our Makefile, but past
> discussions have reached the conclusion that they should be safe
> (they're both in GNU make 3.80, which is the oldest version worth caring
> about).

...also this sort of thing can be guarded by "ifdef DEVELOPER" or
something, which AFAICT (from trying to introduce syntax errors etc.)
will get parsed first, before "make" even tries to parse what's within
the ifdef.

So if we have bells & whistles in that sort of setup it can be less
portable than the Makefile in general..