首页 > 解决方案 > 没有规则来制作目标“libpython2.6.a”

问题描述

我正在尝试从其源代码编译Python2.6,并采取以下步骤,并遇到错误消息:

./configure
...
[root@KuGouIdc Python-2.6.6]# ls
config.log                                 Demo        Makefile.pre                       Objects                                     Python
config.status                              Doc         Makefile.pre.in                    Parser                                      README
configure                                  Grammar     Makefile.pre.in.cflags             PC                                          RISCOS
configure.in                               Include     Makefile.pre.in.fix-parallel-make  PCbuild                                     setup.py
configure.in.check-for-XML_SetHashSalt     install-sh  Makefile.pre.in.lib64              pyconfig.h                                  setup.py.add-RPATH-to-pyexpat
configure.in.disable-pymalloc-on-valgrind  Lib         Makefile.pre.in.no-static-lib      pyconfig.h.in                               setup.py.expat
configure.in.expat                         LICENSE     Makefile.pre.in.systemtap          pyconfig.h.in.disable-pymalloc-on-valgrind  setup.py.lib64
configure.in.rpath                         Mac         Misc                               pyconfig.h.in.systemtap                     systemtap-example.stp
configure.in.systemtap                     Makefile    Modules                            pyfuntop.stp                                Tools
[root@KuGouIdc Python-2.6.6]# make -n all
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
make: *** No rule to make target `libpython2.6.a', needed by `python'.  Stop.

我查看了 Makefile 详细信息,确实找不到任何规则来制作目标“libpythonXXX.a”。我google了一下,好像没有人遇到过和我一样的问题?

在 Makefile 中,它确实有一个规则来制作目标“libpythonXXX.so”。

标签: python

解决方案


为我工作

$ docker run --rm -it debian:stretch
# mkdir /src
# cd /src
# apt update
# apt install wget build-essential
# wget https://www.python.org/ftp/python/2.6/Python-2.6.tgz
# tar xzf Python-2.6.tgz
# cd Python-2.6
# ./configure
...
# make -n all
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Parser/acceler.o Parser/acceler.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Parser/grammar1.o Parser/grammar1.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Parser/listnode.o Parser/listnode.c
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Parser/node.o Parser/node.c
...

推荐阅读