summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-08-21 20:43:56 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-08-21 20:43:56 +0900
commit7845ab1bc9e92fa8e5db06bea8928a4646a19976 (patch)
treebee5244ed9be7b40bd8f329358e06269e1216c99
parent6ab591f80aa19d63ecd1e1df3c09c391efb318a6 (diff)
[Bug #20687] Exclude just built ruby as baseruby
On Windows, an executable file in the current directory has the priority to the PATH environment variable always.
-rw-r--r--win32/Makefile.sub7
1 files changed, 5 insertions, 2 deletions
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 46df464232..aad64ca8f1 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -18,8 +18,11 @@ MFLAGS=-l
!endif
!if "$(BASERUBY)" == ""
-! if [ruby $(tooldir)/missing-baseruby.bat 2> nul]
-! else if [for %I in (ruby.exe) do @echo BASERUBY = %~s$$PATH:I > baseruby.mk]
+# After `nmake`, just built `ruby.exe` exists in the build directory,
+# and is searched first prior to $PATH. Assume that no ruby
+# executable in $(tooldir).
+! if [cd $(tooldir) && ruby missing-baseruby.bat 2> nul]
+! else if [(cd $(tooldir) && for %I in (ruby.exe) do @echo BASERUBY = %~s$$PATH:I) > baseruby.mk]
! else
! include baseruby.mk
! endif