使用mingw32-make进行目录更改错误

And*_*riy 2 mingw makefile mingw32 poco-libraries

我正在MinGW32下构建POCO库1.6.0,环境:Windows 7 Ultimate 32位,shell:MSYS.成功执行./configure.

$ ./configure
Configured for MinGW
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

启动mingw32-make之后我得到了:

$ 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'
Run Code Online (Sandbox Code Playgroud)

问题在于

mingw32-make: Entering an unknown directory
mingw32-make: *** /c/dev/poco/Foundation: No such file or directory.  Stop.
Run Code Online (Sandbox Code Playgroud)

因为/ c/dev/poco/Foundation确实存在:

$ 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
Run Code Online (Sandbox Code Playgroud)

我正在修改makefile以将目录更改为其他子文件夹,没有任何乐趣.似乎有些事情会阻止mingw32-make改变目录.也可以确认一下

cd /c/dev/poco/Foundation
Run Code Online (Sandbox Code Playgroud)

工作良好.

试着用make,结果是一样的:

$ 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'
Run Code Online (Sandbox Code Playgroud)

没有明显的理由让mingw32-make失败,因为路径没有空格.

我错过了什么?欢迎任何建议.

Kei*_*all 5

/c/dev/poco/Foundation在这种情况下,这条道路并不意味着你的想法mingw32-make.exe.看,mingw32-make.exe是一个原生的Windows应用程序,所以它肯定理解一个MSYS特定的路径,例如/c/dev/poco/Foundation; 相反,它会"按原样"解释它,因为c:/c/dev/poco/Foundation(假设你当前正在工作的驱动器c:),我确信这不是你想要的.

你好像用它MSYS作为你的shell,所以为什么你mingw32-make.exe还在用?使用make.exeMSYS本身提供; 它确实理解MSYS路径.

请注意,如果make --version从MSYS shell 运行,您应该看到(在撰写本文时):

$ 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
Run Code Online (Sandbox Code Playgroud)

在您更新的问题中,您将显示一个运行示例make.exe,这显然不是此MSYS版本; 看来已经放置了一个替代版本make.exe- 或许甚至是mingw32-make.exe它自己的副本,因为输出是相同的 - 在你的MSYS版本之前的某个目录中$PATH.你应该删除这个非MSYS版本make.exe; 调用MinGW版本的全部目的mingw32-make.exe是避免这种冲突.当您make从MSYS shell 运行时,您需要MSYS版本,而不是某些mingw32-make.exe克隆.