Hi mike,
2016/9/5 Mon 10:07:00 UTC+9 Michael Soyka wrote:
> The makefile testdir/Make_ming.mak contains statements of the form:
>
> if exist test.ok $(DEL) test.ok
>
> which can only be executed by one of the DOS/Windows command shells such
> as command.com or cmd.exe
>
> My version of make, gnu 3.82.90, sets the SHELL make variable to the
> value "C:/MinGW/msys/1.0/sh.exe", a unix shell, and so all such
> if-statements fail.
>
> This can be sidestepped by setting SHELL=cmd.exe on the make command
> line but then unix utilities such as "rm" are used instead of "del" and
> DIRSLASH is set to "/" instead of "\" and so vim.exe cannot be launched
> to run the test (cmd.exe does not accept forward slashes in paths).
> This new problem is caused by an incorrectly constructed if-test in the
> makefile:
>
> ifneq(sh.exe,$(SHELL))
>
> followed by unix-style definitions. I think that the author had
> intended this
>
> ifeq(sh.exe, $(SHELL))
No, this is confusing but intended. Please try the following Makefile:
all:
echo $(SHELL)
If you run mingw32-make.exe (not make.exe) on cmd.exe, you will see the
following result:
C:\tmp>\msys32\mingw32\bin\mingw32-make.exe
echo sh.exe
sh.exe
Other results are...
make.exe on cmd.exe:
C:\tmp>\msys32\usr\bin\make.exe
echo /bin/sh
make: echo: Command not found
make: *** [Makefile.mingw:2: all] Error 127
This doesn't work as expected.
mingw32-make.exe on bash.exe:
$ mingw32-make
echo C:/msys32/usr/bin/sh.exe
C:/msys32/usr/bin/sh.exe
make.exe on bash.exe:
$ make
echo /bin/sh
/bin/sh
Normally, mingw32-make should be used when the shell is cmd.exe.
(I don't know when the shell is bash.exe.)
> but this won't work either because the value of SHELL will include a
> full path, if make is allowed to define it.
>
> The correct construct is this:
>
> ifeq(sh.exe, $(notdir $(SHELL)))
>
> which strips the path information from SHELL before the comparison.
>
> This is all interesting but mostly irrelevant. The bottom line is that
> a DOS shell must be used and so my suggestion is:
>
> 1. remove the if-block that defines the unix utilities and retain
> the else-block, and
>
> 2. define SHELL=cmd.exe in the makefile.
I haven't tried this yet.
Does this work both on cmd.exe and bash.exe?
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.