"make install"和"make install"之间的细节差异和"make altinstall" [英] Difference in details between "make install" and "make altinstall"

查看:307
本文介绍了"make install"和"make install"之间的细节差异和"make altinstall"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的情况:

我正在使用 Ubuntu  10.04 (Lucid Lynx) .系统的默认Python是v2.6.5,但我需要Python v2.7.因此,我从python.org下载了源代码并尝试安装它.

I am using Ubuntu 10.04 (Lucid Lynx). The system's default Python is v2.6.5, but I need Python v2.7. So I downloaded the source from python.org and tried to install it.

我第一次安装它,我跑了:

The first time I installed it, I ran:

cd Python2.7.4
./configure --prefix=/usr
make
su root
make install

这会将Python 2.7安装到我的系统中.它将在/usr/bin中创建一个链接"python",并链接到/usr/bin中的python2.7.因此,当我键入>python时,系统将为我启动Python 2.7.4,就像我键入>python2.7时一样.

This installs Python 2.7 to my system. It will create a link, "python", in /usr/bin linking to python2.7 also in /usr/bin. So when I type >python, the system will start Python 2.7.4 for me just like when I type >python2.7.

但是当我以这种方式安装时:

But when I install this way:

cd Python2.7.4
./configure --prefix=/usr
make
su root
make altinstall

/usr/bin中的链接"python"仍然存在,并且链接到默认系统版本的python2.6.当然,我可以删除它并创建一个链接到python2.7的新软链接.

The link "python" in /usr/bin still exists and links to python2.6 which is the default system version. Of course, I can remove it and create a new soft link linking to python2.7.

除了/usr/bin中的链接之外,命令"make install"和"make altinstall"之间有什么区别?

What is the difference between the command "make install" and "make altinstall", except for the link in /usr/bin?

推荐答案

让我们看一下生成的Makefile!

Let's take a look at the generated Makefile!

首先,安装目标:

install:         altinstall bininstall maninstall

它可以完成altinstall的所有工作,以及bininstallmaninstall

It does everything altinstall does, along with bininstall and maninstall

这里是bininstall;只会创建python和其他符号链接.

Here's bininstall; it just creates the python and other symbolic links.

# Install the interpreter by creating a symlink chain:
#  $(PYTHON) -> python2 -> python$(VERSION))
# Also create equivalent chains for other installed files
bininstall:     altbininstall
        -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
        then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
        else true; \
        fi
        (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
        -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
        (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
        ... (More links created)

这是maninstall,它只是创建到Python手册页的未版本化"链接.

And here's maninstall, it just creates "unversioned" links to the Python manual pages.

# Install the unversioned manual pages
maninstall:     altmaninstall
        -rm -f $(DESTDIR)$(MANDIR)/man1/python2.1
        (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python2.1)
        -rm -f $(DESTDIR)$(MANDIR)/man1/python.1
        (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python2.1 python.1)

TLDR:altinstall跳过创建python链接和手册页链接的操作,install将隐藏系统二进制文件和手册页.

TLDR: altinstall skips creating the python link and the manual pages links, install will hide the system binaries and manual pages.

这篇关于"make install"和"make install"之间的细节差异和"make altinstall"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆