Difference in details between “make install” and “make altinstall”

Let’s take a look at the generated Makefile!

First, the install target:

install:         altinstall bininstall maninstall

It does everything altinstall does, along with bininstall and maninstall

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)

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 skips creating the python link and the manual pages links, install will hide the system binaries and manual pages.

Leave a Comment