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

Re: Questions about Git-Gui Makefile and GNU File Name and Text Functions

From
Paul Smith <paul@mad-scientist.net>
Date
Jun 3, 2020, 14:34 UTC
Message-ID
<c931a1a5bf041057fa75febf6c05b7435ce27881.camel@mad-scientist.net>
In-Reply-To
<CAGiZ90kHSZEjw2ApU4kyGqCCH0KJS2Fe1mbvkJy4W2YKXs_-=w@mail.gmail.com>
On Wed, 2020-06-03 at 02:56 -0500, Edua Vioz wrote:
> Would the outcome of $(dir C:/Program
> Files/Git/mingw64/libexec/git-core) be "C:/Program
> Files/Git/mingw64/libexec/" or "C:/ Files/Git/mingw64/libexec/"?

I'm not super-familiar with the Git build system so maybe there are mitigations for this there but: GNU make always treats whitespace as a word separator so it will apply the "dir" function to each word. So:

  $(dir C:/Program Files/Git/mingw64/libexec/git-core)
is equivalent to writing:
  $(dir C:/Program) $(dir Files/Git/mingw64/libexec/git-core)
and the expected result is:
  C:/ Files/Git/mingw64/libexec
> If the latter, is there no way for the $(dir) File Name function to
> be told to respect white-spaces in files' directories?

No. Make in general, and GNU make in particular, doesn't expect to be given paths with whitespace in them.

Again I'm not an expert in the Git build system but my understanding is that the install can be relocatable: in that case I recommend you build it into a location where there is no whitespace in the path, then move it wherever you like after building.

> Additionally, would $(notdir C:/Program
> Files/Git/mingw64/libexec/git-core) result in "Program git-core"?
Yes.  All GNU make functions work the same way.
Previous: Edua Vioz
Message 2 of 2 in “Questions about Git-Gui Makefile and GNU File Name and Text Functions”
  1. Edua ViozJun 3, 2020
  2. Paul SmithJun 3, 2020

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.