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

[PATCH] Makefile: use backticks rather than $() notation to support ancient shells

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Aug 5, 2008, 23:22 UTC
Message-ID
<K5bb057jTokXyOIU_aDE4vMr3jT4DOgSPRcIktfus6QMVq6dszrgGw@cipher.nrlssc.navy.mil>

Since make is using /bin/sh to execute shell code, avoid the newish shell construct $() so older (ancient) shells can execute the shell code in the Makefile.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---

I know that $() is preferred in the main scripts, but the Makefile is using /bin/sh to execute shell code and there are already a few places in the Makefile using back-ticks, so it doesn't seem like going against the flow too much.

Otherwise, should we set the SHELL variable to the configured SHELL_PATH at some point in the Makefile?

-brandon
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 608a185..421af24 100644
--- a/Makefile
+++ b/Makefile
@@ -1366,8 +1366,8 @@ endif
 ifneq (,$X)
 	$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
 endif
-	bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
-	execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
+	bindir=`cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd` && \
+	execdir=`cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd` && \
 	if test "z$$bindir" != "z$$execdir"; \
 	then \
 		ln -f "$$bindir/git$X" "$$execdir/git$X" || \
-- 
1.6.0.rc1.87.g56c9f.dirty
Next: Johannes Schindelin
Message 1 of 5 in “Makefile: use backticks rather than $() notation to support ancient shells”
  1. Makefile: use backticks rather than $() notation to support ancient shellsBrandon Casey, Aug 5, 2008
  2. Johannes SchindelinAug 6, 2008
  3. Makefile: set SHELL to value of SHELL_PATHBrandon Casey, Aug 7, 2008
  4. Makefile: add a target which will abort compilation with ancient shellsBrandon Casey, Aug 7, 2008
  5. Junio C HamanoAug 8, 2008

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.