cpython/Makefile.in

476 lines
14 KiB
Makefile
Raw Normal View History

########################################################################
# Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
# The Netherlands.
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the names of Stichting Mathematisch
1996-10-25 14:44:06 +00:00
# Centrum or CWI or Corporation for National Research Initiatives or
# CNRI not be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission.
#
# While CWI is the initial source for this software, a modified version
# is made available by the Corporation for National Research Initiatives
# (CNRI) at the Internet address ftp://ftp.python.org.
#
# STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
# CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
########################################################################
1993-12-24 10:39:16 +00:00
# Top-level Makefile for Python
#
# As distributed, this file is called Makefile.in; it is processed
# into the real Makefile by running the script ./configure, which
# replaces things like @spam@ with values appropriate for your system.
# This means that if you edit Makefile, your changes get lost the next
# time you run the configure script. Ideally, you can do:
#
# ./configure
# make
# make test
# make install
#
# The top-level Makefile invokes make recursively in a number of
# subdirectories (see the SUBDIRS variable below). If you want to,
# you can invoke make in individual subdirectories. However, the
# sub-Makefiles are also generated by configure, and the quickest way
# to make sure they are up to date is by running make (or "make
# Makefiles") at the top level. This is particularly important for
# Modules/Makefile, which has to be regenerated every time you edit
# Modules/Setup. The python executable is built in the Modules
# directory and then moved to the top-level directory. The recursive
# makes pass three options to subordinate makes: OPT (a quick way to
1996-07-30 18:04:22 +00:00
# change some compiler options; it usually defaults to -O), prefix and
# exec_prefix (the installation paths).
#
1996-07-30 18:04:22 +00:00
# If you have a previous version of Python installed that you don't
# want to overwrite, you can use "make altinstall" instead of "make
# install". This changes the install procedure so it installs the
# Python binary as "python<version>". The libraries and include files
# are always installed in a subdirectory called "python<version>".
# "make altinstall" does not install the manual page. If you want to
# make this installation the "official" installation but want to keep
# the old binary around "just in case", rename the installed python
# binary to "python<oldversion>" before running "make install".
# (This only works between different versions, e.g. 1.3 and 1.4 --
# different betas of the same version will overwrite each other in
# installation unless you override the VERSION Make variable.)
#
# In fact, "make install" or "make bininstall" installs the binary
# as python<version> and makes a hard link to python, so when
# installing a new version in the future, nothing of the current
# version will be lost (except for the man page).
#
# If recursive makes fail, try invoking make as "make MAKE=make".
#
# See also the section "Build instructions" in the README file.
1993-12-24 10:39:16 +00:00
# Interpreter version number, for library destination pathnames
VERSION= 1.4
# Substitutions by configure
srcdir= @srcdir@
VPATH= @srcdir@
1994-10-10 17:58:27 +00:00
RANLIB= @RANLIB@
1994-09-12 10:56:06 +00:00
# Machine-dependent subdirectories
MACHDEP= @MACHDEP@
# Install prefix for architecture-independent files
prefix= @prefix@
# Install prefix for architecture-dependent files
exec_prefix= @exec_prefix@
# Expanded directories
1996-07-30 18:04:22 +00:00
BINDIR= $(exec_prefix)/bin
LIBDIR= $(exec_prefix)/lib
MANDIR= $(prefix)/man
INCLUDEDIR= $(prefix)/include
SCRIPTDIR= $(prefix)/lib
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
LIBP= $(LIBDIR)/python$(VERSION)
1994-09-12 10:56:06 +00:00
# Symbols used for using shared libraries
SO= @SO@
LDSHARED= @LDSHARED@
CCSHARED= @CCSHARED@
LINKFORSHARED= @LINKFORSHARED@
DESTSHARED= $(BINLIBDEST)/sharedmodules
1994-09-12 10:56:06 +00:00
# Shell used by make (some versions default to the login shell, which is bad)
SHELL= /bin/sh
# Portable install script (configure doesn't always guess right)
INSTALL= @srcdir@/install-sh -c
1996-07-30 18:04:22 +00:00
INSTALL_PROGRAM=${INSTALL} -m 755
INSTALL_DATA= ${INSTALL} -m 644
# --with-PACKAGE options for configure script
# e.g. --with-readline --with-svr5 --with-solaris --with-thread
# (see README for an explanation)
WITH=
# Compiler options passed to subordinate makes
OPT= @OPT@
# Subdirectories where to run make recursively
SUBDIRS= Parser Objects Python Modules
# Other subdirectories
1996-07-30 18:04:22 +00:00
SUBDIRSTOO= Include Lib Doc Misc Demo Grammar
# Files and directories to be distributed
CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.in
DISTFILES= README ChangeLog $(CONFIGFILES)
DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
DIST= $(DISTFILES) $(DISTDIRS)
# Default target
all: python
# Build the interpreter
python: Makefiles
@for i in $(SUBDIRS); do \
(echo Making in subdirectory $$i; cd $$i; \
$(MAKE) OPT="$(OPT)" \
1996-07-30 18:04:22 +00:00
VERSION="$(VERSION)" \
prefix="$(prefix)" \
exec_prefix="$(exec_prefix)" \
all); \
done
# Test the interpreter (twice, once without .pyc files, once with)
TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/test:./Modules
TESTOPTS=
TESTPROG= $(srcdir)/Lib/test/regrtest.py
test: python
-rm -f $(srcdir)/Lib/test/*.pyc
PYTHONPATH=$(TESTPATH) ./python $(TESTPROG) $(TESTOPTS)
PYTHONPATH=$(TESTPATH) ./python $(TESTPROG) $(TESTOPTS)
# Install everything
1996-07-30 21:41:56 +00:00
install: altinstall bininstall maninstall
# Install almost everything without disturbing previous versions
1996-07-30 18:04:22 +00:00
altinstall: altbininstall libinstall inclinstall libainstall sharedinstall
# Install the interpreter (by creating a hard link to python$(VERSION))
bininstall: altbininstall
-if test -f $(BINDIR)/python; \
then rm -f $(BINDIR)/python; \
else true; \
fi
(cd $(BINDIR); ln python$(VERSION) python)
# Install the interpreter with $(VERSION) affixed
# This goes into $(exec_prefix)
altbininstall: python
@for i in $(BINDIR); \
do \
if test ! -d $$i; then \
echo "Creating directory $$i"; \
mkdir $$i; \
chmod 755 $$i; \
else true; \
fi; \
done
$(INSTALL_PROGRAM) python $(BINDIR)/python$(VERSION)
1996-07-30 18:04:22 +00:00
# Install the manual page
maninstall:
@for i in $(MANDIR) $(MANDIR)/man1; \
do \
if test ! -d $$i; then \
echo "Creating directory $$i"; \
mkdir $$i; \
chmod 755 $$i; \
else true; \
fi; \
done
1996-07-30 18:04:22 +00:00
$(INSTALL_DATA) $(srcdir)/Misc/python.man \
$(MANDIR)/man1/python.1
1996-07-30 18:04:22 +00:00
# Install the library
MACHDEPS= $(MACHDEP)
LIBSUBDIRS= stdwin tkinter test $(MACHDEPS)
libinstall: python $(srcdir)/Lib/$(MACHDEP)
1996-07-30 18:04:22 +00:00
@for i in $(SCRIPTDIR) $(LIBDEST); \
do \
if test ! -d $$i; then \
echo "Creating directory $$i"; \
mkdir $$i; \
chmod 755 $$i; \
else true; \
fi; \
done
1996-07-30 18:04:22 +00:00
@for d in $(LIBSUBDIRS); \
do \
a=$(srcdir)/Lib/$$d; \
if test ! -d $$a; then continue; else true; fi; \
b=$(LIBDEST)/$$d; \
if test ! -d $$b; then \
echo "Creating directory $$b"; \
mkdir $$b; \
chmod 755 $$b; \
else true; \
fi; \
done
@for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
do \
if test -x $$i; then \
$(INSTALL_PROGRAM) $$i $(LIBDEST); \
echo $(INSTALL_PROGRAM) $$i $(LIBDEST); \
else \
$(INSTALL_DATA) $$i $(LIBDEST); \
echo $(INSTALL_DATA) $$i $(LIBDEST); \
fi; \
done
@for d in $(LIBSUBDIRS); \
do \
a=$(srcdir)/Lib/$$d; \
if test ! -d $$a; then continue; else true; fi; \
b=$(LIBDEST)/$$d; \
for i in $$a/*; \
do \
case $$i in \
*CVS) ;; \
*.pyc) ;; \
*~) ;; \
*) \
if test -x $$i; then \
echo $(INSTALL_PROGRAM) $$i $$b; \
$(INSTALL_PROGRAM) $$i $$b; \
else \
echo $(INSTALL_DATA) $$i $$b; \
$(INSTALL_DATA) $$i $$b; \
fi;; \
esac; \
done; \
done
PYTHONPATH=$(LIBDEST) \
./python $(LIBDEST)/compileall.py $(LIBDEST)
# Create the MACHDEP source directory, if one wasn't distributed..
$(srcdir)/Lib/$(MACHDEP):
mkdir $(srcdir)/Lib/$(MACHDEP)
cp $(srcdir)/Lib/generic/regen $(srcdir)/Lib/$(MACHDEP)/regen
export PATH; PATH="`pwd`:$$PATH"; \
export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
cd $(srcdir)/Lib/$(MACHDEP); ./regen
# Install the include files
inclinstall:
@for i in $(INCLUDEDIR) $(INCLUDEPY); \
do \
if test ! -d $$i; then \
echo "Creating directory $$i"; \
mkdir $$i; \
chmod 755 $$i; \
else true; \
fi; \
done
@for i in $(srcdir)/Include/*.h; \
do \
echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
$(INSTALL_DATA) $$i $(INCLUDEPY); \
done
# Install the lib*.a files and miscellaneous stuff needed by extensions
# This goes into $(exec_prefix)
1996-07-30 18:04:22 +00:00
LIBPL= $(LIBP)/config
libainstall: all
@for i in $(LIBDIR) $(LIBP) $(LIBPL); \
do \
if test ! -d $$i; then \
echo "Creating directory $$i"; \
mkdir $$i; \
chmod 755 $$i; \
else true; \
fi; \
done
@for i in $(SUBDIRS); do \
echo Installing in subdirectory $$i; \
$(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \
1994-10-10 17:58:27 +00:00
$(RANLIB) $(LIBPL)/lib$$i.a; \
done
$(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
$(INSTALL_DATA) $(srcdir)/Modules/getpath.c $(LIBPL)/getpath.c
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
$(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile
$(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
1996-07-21 02:46:47 +00:00
$(INSTALL_PROGRAM) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
$(INSTALL_DATA) config.h $(LIBPL)/config.h
$(INSTALL_DATA) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c
1995-08-09 09:18:20 +00:00
$(INSTALL_DATA) Modules/main.o $(LIBPL)/main.o
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
1994-09-12 10:56:06 +00:00
sharedinstall:
cd Modules; $(MAKE) \
OPT="$(OPT)" \
1996-07-30 18:04:22 +00:00
VERSION="$(VERSION)" \
1994-09-12 10:56:06 +00:00
SO="$(SO)" \
LDSHARED="$(LDSHARED)" \
CCSHARED="$(CCSHARED)" \
LINKFORSHARED="$(LINKFORSHARED)" \
DESTSHARED="$(DESTSHARED)" \
prefix="$(prefix)" \
exec_prefix="$(exec_prefix)" \
1994-09-12 10:56:06 +00:00
sharedinstall
# Build the sub-Makefiles
Makefiles: config.status Modules/Makefile.pre
(cd Modules; $(MAKE) -f Makefile.pre Makefile)
@for i in . $(SUBDIRS); do \
(echo making Makefile in subdirectory $$i; cd $$i; \
$(MAKE) Makefile); \
done
# Build the intermediate Makefile in Modules
Modules/Makefile.pre: config.status
$(SHELL) config.status
# Build the toplevel Makefile
Makefile: Makefile.in config.status
CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status
# Run the configure script. If config.status already exists,
# call it with the --recheck argument, which reruns configure with the
# same options as it was run last time; otherwise run the configure
# script with options taken from the $(WITH) variable
config.status: $(srcdir)/configure
if test -f config.status; \
then $(SHELL) config.status --recheck; \
1995-01-12 12:26:50 +00:00
$(SHELL) config.status; \
else $(SHELL) $(srcdir)/configure $(WITH); \
fi
.PRECIOUS: config.status python
# Rerun configure with the same options as it was run last time,
# provided the config.status script exists
recheck:
$(SHELL) config.status --recheck
$(SHELL) config.status
# Rebuild the configure script from configure.in; also rebuild config.h.in
autoconf:
1996-06-28 20:15:41 +00:00
(cd $(srcdir); autoconf)
(cd $(srcdir); autoheader)
# Create a tags file for vi
tags::
ctags -w -t Include/*.h
for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
sort tags -o tags
# Create a tags file for GNU Emacs
TAGS::
etags Include/*.h
for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
# Add dependencies to sub-Makefiles
depend:
@for i in $(SUBDIRS); do \
(echo making depend in subdirectory $$i; cd $$i; \
$(MAKE) depend); \
done
1993-12-24 10:39:16 +00:00
# Sanitation targets -- clean leaves libraries, executables and tags
# files, which clobber removes those as well
1993-12-24 10:39:16 +00:00
localclean:
-rm -f core *~ [@,#]* *.old *.orig *.rej
clean: localclean
-for i in $(SUBDIRS); do \
(echo making clean in subdirectory $$i; cd $$i; \
if test -f Makefile; \
then $(MAKE) clean; \
else $(MAKE) -f Makefile.*in clean; \
fi); \
1993-12-24 10:39:16 +00:00
done
localclobber: localclean
-rm -f tags TAGS python
-rm -f config.log config.cache config.h
clobber: localclobber
1993-12-24 10:39:16 +00:00
-for i in $(SUBDIRS); do \
(echo clobbering subdirectory $$i; cd $$i; \
if test -f Makefile; \
then $(MAKE) clobber; \
1995-03-22 12:27:16 +00:00
else $(MAKE) -f $(srcdir)/Makefile.in clobber; \
fi); \
1993-12-24 10:39:16 +00:00
done
# Make things extra clean, before making a distribution:
# remove all generated files, even Makefile[.pre]
1993-12-24 10:39:16 +00:00
distclean: clobber
1995-03-22 12:27:16 +00:00
-$(MAKE) -f $(srcdir)/Makefile.in \
SUBDIRS="$(SUBDIRSTOO)" clobber
-rm -f config.status config.log config.cache config.h Makefile
1995-09-18 22:12:20 +00:00
-rm -f Modules/Makefile
-for i in $(SUBDIRS) $(SUBDIRSTOO); do \
for f in $$i/*.in; do \
f=`basename "$$f" .in`; \
if test "$$f" != "*"; then \
echo rm -f "$$i/$$f"; \
rm -f "$$i/$$f"; \
fi; \
done; \
1993-12-24 10:39:16 +00:00
done
# Check for smelly exported symbols (not starting with Py/_Py)
smelly: all
for i in $(SUBDIRS); do \
echo --- $$i ---; \
nm -p $$i/lib$$i.a | \
sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
done
# Find files with funny names
funny:
find $(DISTDIRS) -type d \
-o -name '*.[chs]' \
-o -name '*.py' \
-o -name '*.doc' \
-o -name '*.sty' \
-o -name '*.bib' \
-o -name '*.dat' \
-o -name '*.el' \
-o -name '*.fd' \
-o -name '*.in' \
-o -name '*.tex' \
-o -name '*,[vpt]' \
-o -name 'Setup' \
-o -name 'Setup.*' \
-o -name README \
-o -name Makefile \
-o -name ChangeLog \
-o -name Repository \
-o -name Root \
-o -name Entries \
-o -name Tag \
-o -name tags \
-o -name TAGS \
-o -name .cvsignore \
-o -name MANIFEST \
-o -print