Directory change error with mingw32-make

谁都会走 提交于 2021-01-28 03:26:18

问题


I'm building POCO library 1.6.0 under MinGW32, environment: Windows 7 Ultimate 32-bit, shell: MSYS. Successfully executed ./configure.

$ ./configure
Configured for MinGW

Contents of config.make:

POCO_CONFIG = MinGW
POCO_BASE = /c/dev/poco
POCO_BUILD = /c/dev/poco
POCO_PREFIX = /usr/local
POCO_FLAGS = 
OMIT = 
export POCO_CONFIG
export POCO_BASE
export POCO_BUILD
export POCO_PREFIX
export POCO_FLAGS

After launching mingw32-make I'm getting:

$ mingw32-make --debug -w
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
 File `poco' does not exist.
   File `libexecs' does not exist.
     File `Foundation-libexec' does not exist.
    Must remake target `Foundation-libexec'.
Invoking recipe from Makefile:69 to update target `Foundation-libexec'.
mingw32-make: Entering directory `c:/dev/poco'
C:/app/MinGW/bin/mingw32-make -d -C /c/dev/poco/Foundation
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
mingw32-make: Entering an unknown directory
mingw32-make: *** /c/dev/poco/Foundation: No such file or directory.  Stop.
mingw32-make: Leaving an unknown directory
mingw32-make: *** [Foundation-libexec] Error 2
mingw32-make: Leaving directory `c:/dev/poco'

The problem is in

mingw32-make: Entering an unknown directory
mingw32-make: *** /c/dev/poco/Foundation: No such file or directory.  Stop.

because /c/dev/poco/Foundation does exist:

$ ls
CHANGELOG       LICENSE   VERSION                  build_vs110.cmd  config.make
CMakeLists.txt  MANIFEST  XML                      build_vs120.cmd  configure
CONTRIBUTORS    Makefile  build                    build_vs90.cmd   contrib
CppUnit         NEWS      build_CE_vs90.cmd        buildwin.cmd     doc
DLLVersion.rc   Net       build_vcexpress2008.cmd  cmake            libversion
Foundation      README    build_vcexpress2010.cmd  components       patches
JSON            Util      build_vs100.cmd          config.build

I was modifying makefile to change directory to other sub-folders, no joy. It seems like something prevents mingw32-make from changing directory. Also can confirm that

cd /c/dev/poco/Foundation

works fine.

Tried with make, result is the same:

$ make --debug -w
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
 File `poco' does not exist.
   File `libexecs' does not exist.
     File `Foundation-libexec' does not exist.
    Must remake target `Foundation-libexec'.
Invoking recipe from Makefile:69 to update target `Foundation-libexec'.
make: Entering directory `c:/dev/poco'
C:/app/MinGW/msys/1.0/bin/make -d -C /c/dev/poco/Foundation
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
make: Entering an unknown directory
make: *** /c/dev/poco/Foundation: No such file or directory.  Stop.
make: Leaving an unknown directory
make: *** [Foundation-libexec] Error 2
make: Leaving directory `c:/dev/poco'

There are no obvious reasons for mingw32-make to fail as path does not have spaces.

What I have missed? Any suggestions welcome.


回答1:


The path /c/dev/poco/Foundation does not mean what you seem to think, in the context of mingw32-make.exe. See, mingw32-make.exe is a native Windows application, so it definitely will not understand an MSYS specific path such as /c/dev/poco/Foundation; rather, it will interpret it "as is", as c:/c/dev/poco/Foundation, (assuming your current working drive is c:), which I'm sure is not what you intended.

You do seem to be using MSYS as your shell, so why are you using mingw32-make.exe anyway? Use the make.exe that MSYS itself provides; it does understand MSYS paths.

Do note that, if you run make --version from the MSYS shell, you should see, (at this time of writing):

$ make --version
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-msys

In your updated question, you show an example of running make.exe, which clearly is not this MSYS version; it appears that you have placed an alternative version of make.exe -- perhaps even a copy of mingw32-make.exe itself, for the output is identical -- in some directory which precedes the MSYS version in your $PATH. You should delete this non-MSYS version of make.exe; the entire purpose in calling the MinGW version mingw32-make.exe is to avoid this very conflict. When you run make from the MSYS shell, you want the MSYS version, and not some mingw32-make.exe clone.



来源:https://stackoverflow.com/questions/31293526/directory-change-error-with-mingw32-make

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!