I'm trying to recompile an application already having a windows port (so it's supposed to work)
Of course, you still need to run ./configure
so you need MSYS or MSYS2.
The configure part worked well. Now when I run make -n
(so it shows which rules are executed) I get:
$ make -n
if test ! -f config.h; then \
rm -f stamp-h1; \
make stamp-h1; \
else :; fi
! was unexpected
make: *** [config.h] Error 255
! was unexpected
is the approximate translation of a french message (so it may be slightly different) but reminded me very much of the cryptic Windows batch file messages. So I suppose that make
runs its command lines using windows native shell (which isn't an issue for most simple commands, but not when it relies on a bash-like shell), assumption which was confirmed by using make debug mode:
$ make -d
GNU Make 3.82
Built for i686-pc-mingw32
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
<I'll spare you that boring part then:>
Invoking recipe from Makefile:164 to update target `config.h'.
Creating temporary batch file C:\msys64\tmp\make11752-1.bat
Batch file contents:
@echo off
if test ! -f config.h; then rm -f stamp-h1; make stamp-h1; else :; fi
From the make documentation, make
takes the SHELL
env. variable into account.
SHELL
is set to a unix-style path, but I've tried to change it with $ export SHELL="C:/msys64/usr/bin/bash.exe"
to reflect native windows path (make
may not be MSYS2 aware) but to no avail)
So how to tell make
to use bash
shell instead of the Windows shell ?
make SHELL=bash
- you don't need the full path if it can be found on$PATH
.