Solving "non-cygwin compatible Make program" Issue with NDK
For folks trying to build NDK based AndroidOS projects this can be a show-stopper. It's most often caused by having spaces in the NDK path (the $PATH to ndk-build) and/or your AOS project.
This is in reference to the git.kernel.org posting covering the matter which mis-diagnoses the underlying issue.
With the latest version of cygwin installed and the gnu make as the first make in the search path, the ndk-build script fails.
bash-3.2$ which makeIt fails because of "spaces" in windows directory paths. If somebody puts the ndk under "C:\Program Files\ it will fail with the "non-gnu-compatible make failure":
/usr/bin/make
bash-3.2$ make -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i686-pc-cygwin
bash-3.2$ echo $NDKPATHWhen ndk-build runs it evaluates as follows:
/cygdrive/c/Program Files/android-sdk-windows/android-ndk-r4b
bash-3.2$ PROGDIR=$NDKPATH;export PROGDIRand
bash-3.2$ echo $PROGDIR
/cygdrive/c/Program Files/android-sdk-windows/android-ndk-r4b
bash-3.2$ echo $OSTYPE
cygwin
bash-3.2$ cygpath -m $PROGDIR
C:/Program Files/android-sdk-windows/android-ndk-r4b
bash-3.2$ $NDKPATH/tndk-buildThe ndk-build script never gets a chance to report that error. By adding the following it does and would save a lot of forum questions. Change line:
GNUMAKE = (/usr/bin/make)
PROGDIR_MIXED = (C:/Program Files/android-sdk-windows/android-ndk-r4b)
CYGWIN_GNUMAKE= (make: C:/Program: No such file or directory
make: *** No rule to make target `C:/Program'. Stop.)
GMAKETRES = (0)
toCYGWIN_GNUMAKE=`$GNUMAKE -f $PROGDIR_MIXED/build/core/check-cygwin-make.mk 2>&1`
CYGWIN_GNUMAKE=`$GNUMAKE -f "$PROGDIR_MIXED/build/core/check-cygwin-make.mk" 2>&1`
(just add the double-quotes)
Even putting a SYMLINK in for "Program Files" to "Program_Files" did not help because cygpath breaks it.
With the above changes, when you run the ndk-build it will identify this problem properly. You need to move your ndk to a folder that does not have spaces in the path as well as your project.
Good luck.