SIP Makefile fail (gnuwin and mingw)

2019-07-09 12:57发布

I have downloaded the Sip module for python 2.7, created a makefile and tried the make command on the directory with the makefile, but I get this error:

Makefile:3: recipe for target 'all' failed
mingw32-make[10]: *** [all] Error 2
mingw32-make[10]: Leaving directory 'D:/Users/myLogin/Downloads/python/sip-4.14.5'

I get this error with both Gnuwin and mingw32. So I'm at a loss at what to do now. Any idea?

1条回答
祖国的老花朵
2楼-- · 2019-07-09 13:28

If you use python configure.py, the generated Makefiles are actually nmake makefiles. nmake is Microsoft's equivalent to make. You can run it by invoking nmake in a Visual Studio command prompt, if you have that installed.

For building with mingw, you have to indicate that you want to use that particular platform when creating the makefiles, as follows:

python configure.py --platform win32-g++

After that, invoking make works fine.


A few details about what happens to you when running make on the nmake makefile. The generated nmake file starts with the following lines:

all:
    cd sipgen
    $(MAKE)
    @cd ..
    cd siplib
    $(MAKE)
    @cd ..

Because each command on each line is executed in a new shell, the result of cd sipgen is actually void. Then, make is invoked again, in the current directory -- this results in an infinite recursive loop of make invocations. The [10] in your error message indicates that it was at the 10th level of recursion. I guess that was the moment that you pressed Ctrl-C :-)

查看更多
登录 后发表回答