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