[22/24] bin-wrappers: append `.exe` to target paths if necessary
diff mbox series

Message ID 971247e32056a564161e10d05237c41d041e7ff8.1563455939.git.gitgitgadget@gmail.com
State New
Headers show
Series
  • Reinstate support for Visual Studio
Related show

Commit Message

Johannes Schindelin via GitGitGadget July 18, 2019, 1:19 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

When compiling with Visual Studio, the projects' names are identical to
the executables modulo the extensions. Read: there will exist both a
directory called `git` as well as an executable called `git.exe` in the
end. Which means that the bin-wrappers *need* to target the `.exe` files
lest they try to execute directories.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/Makefile b/Makefile
index 98a0588416..3716dadc08 100644
--- a/Makefile
+++ b/Makefile
@@ -2717,7 +2717,7 @@  bin-wrappers/%: wrap-for-bin.sh
 	@mkdir -p bin-wrappers
 	$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
 	     -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
-	     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \
+	     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
 	chmod +x $@
 
 # GNU make supports exporting all variables by "export" without parameters.