git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/5] Fixes for ancient versions of GNU make

From
Junio C Hamano <junkio@cox.net>
Date
Feb 18, 2006, 06:50 UTC
Message-ID
<7v1wy1upn3.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0602171522020.24274@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 21 quoted lines
> diff --git a/Makefile b/Makefile
> index d7d79de..b3401ac 100644
> --- a/Makefile
> +++ b/Makefile
> ...
> +# These will be used inside ''
> +SHELL_PATH_QUOTED = $(subst ','\'',$(SHELL_PATH))
> ...
> diff --git a/t/Makefile b/t/Makefile
> index 5c5a620..d78404f 100644
> --- a/t/Makefile
> +++ b/t/Makefile
> @@ -8,17 +8,14 @@ SHELL_PATH ?= $(SHELL)
>  TAR ?= $(TAR)
>  
>  # Shell quote;
> -# Result of this needs to be placed inside ''
> -shq = $(subst ','\'',$(1))
> -# This has surrounding ''
> -shellquote = '$(call shq,$(1))'
> +SHELL_PATH_QUOTED = '$(subst ','\'',$(SHELL_PATH))'

I am not opposed to avoiding $(call), but subst everywhere look ugly ;-).

You inherited this problem, but these two symbols in different Makefiles with the same name mean two completely different things, which confused me quite badly.

So if we were to do this portability fix, how about consistently defining it without surrounding sq pair? Most of the places in the main Makefile you use the symbol with other string, with the whole thing quoted inside a sq pair, so that would make things easier to read.

Then the one that uses it in the t/Makefile in 5/5 becomes:
        $(T):
                @echo "*** $@ ***"; '$(SHELL_PATH_QUOTED)' $@ $(GIT_TEST_OPTS)
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 4 of 5 in “Fixes for ancient versions of GNU make”
  1. 1/5 Fixes for ancient versions of GNU makeJohannes Schindelin, Feb 17, 2006
  2. Jason RiedyFeb 17, 2006
  3. Johannes SchindelinFeb 17, 2006
  4. Junio C HamanoFeb 18, 2006
  5. 1/5 Fixes for ancient versions of GNU makeJohannes Schindelin, Feb 18, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.