1994-08-01 12:07:07 +00:00
|
|
|
########################################################################
|
1995-01-04 19:02:35 +00:00
|
|
|
# Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
|
|
|
|
# The Netherlands.
|
|
|
|
#
|
1994-08-01 12:07:07 +00:00
|
|
|
# All Rights Reserved
|
1995-01-04 19:02:35 +00:00
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and distribute this software and its
|
|
|
|
# documentation for any purpose and without fee is hereby granted,
|
1994-08-01 12:07:07 +00:00
|
|
|
# provided that the above copyright notice appear in all copies and that
|
1995-01-04 19:02:35 +00:00
|
|
|
# both that copyright notice and this permission notice appear in
|
1994-08-01 12:07:07 +00:00
|
|
|
# supporting documentation, and that the names of Stichting Mathematisch
|
|
|
|
# Centrum or CWI not be used in advertising or publicity pertaining to
|
|
|
|
# distribution of the software without specific, written prior permission.
|
1995-01-04 19:02:35 +00:00
|
|
|
#
|
1994-08-01 12:07:07 +00:00
|
|
|
# STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
|
|
|
|
# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
|
|
# FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM 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
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Toplevel Makefile for Python
|
|
|
|
# Note -- if recursive makes fail, try adding MAKE=make
|
1993-12-24 10:39:16 +00:00
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Substitutions by configure
|
|
|
|
srcdir= @srcdir@
|
|
|
|
VPATH= @srcdir@
|
|
|
|
INSTALL= @INSTALL@
|
1995-01-20 16:51:32 +00:00
|
|
|
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
|
|
|
INSTALL_DATA= @INSTALL_DATA@
|
1994-10-10 17:58:27 +00:00
|
|
|
RANLIB= @RANLIB@
|
1994-08-01 12:07:07 +00:00
|
|
|
|
1994-09-12 10:56:06 +00:00
|
|
|
# Machine-dependent subdirectories
|
|
|
|
MACHDEP= @MACHDEP@
|
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Install prefix for architecture-independent files
|
1995-01-02 18:33:54 +00:00
|
|
|
prefix= @prefix@
|
1994-08-01 12:07:07 +00:00
|
|
|
|
|
|
|
# Install prefix for architecture-dependent files
|
1995-01-02 18:33:54 +00:00
|
|
|
exec_prefix= @exec_prefix@
|
1994-08-01 12:07:07 +00:00
|
|
|
|
1994-10-20 22:04:30 +00:00
|
|
|
# Expanded directories
|
|
|
|
MANDIR=$(prefix)/man
|
|
|
|
BINDIR=$(exec_prefix)/bin
|
|
|
|
LIBDIR=$(exec_prefix)/lib
|
|
|
|
INCLUDEDIR=$(prefix)/include
|
|
|
|
SCRIPTDIR=$(prefix)/lib
|
|
|
|
|
1994-09-12 10:56:06 +00:00
|
|
|
# Symbols used for using shared libraries
|
|
|
|
SO= @SO@
|
|
|
|
LDSHARED= @LDSHARED@
|
|
|
|
CCSHARED= @CCSHARED@
|
|
|
|
LINKFORSHARED= @LINKFORSHARED@
|
1994-10-20 22:04:30 +00:00
|
|
|
DESTSHARED= $(SCRIPTDIR)/python/$(MACHDEP)
|
1994-09-12 10:56:06 +00:00
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Programs
|
|
|
|
SHELL= /bin/sh
|
|
|
|
|
|
|
|
# --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
|
1994-08-19 15:33:54 +00:00
|
|
|
OPT= @OPT@
|
1994-08-01 12:07:07 +00:00
|
|
|
|
|
|
|
# Subdirectories where to run make recursively
|
|
|
|
SUBDIRS= Parser Objects Python Modules
|
|
|
|
|
|
|
|
# Other subdirectories
|
|
|
|
SUBDIRSTOO= Include Lib Doc Misc Demo readline 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 $$i; cd $$i; $(MAKE) OPT="$(OPT)" all); \
|
|
|
|
done
|
|
|
|
|
|
|
|
# Test the interpreter (twice, once without .pyc files, once with)
|
1995-01-02 18:33:54 +00:00
|
|
|
TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/test:./Modules
|
1994-08-01 12:07:07 +00:00
|
|
|
test: python
|
|
|
|
-rm -f $(srcdir)/Lib/test/*.pyc
|
|
|
|
PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
|
|
|
|
PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
|
|
|
|
|
|
|
|
# Install the interpreter
|
|
|
|
install: python
|
1995-01-20 16:51:32 +00:00
|
|
|
$(INSTALL_PROGRAM) python $(BINDIR)/python
|
1994-08-01 12:07:07 +00:00
|
|
|
@echo If this is your first time, consider make libinstall...
|
|
|
|
|
|
|
|
# Install the library.
|
|
|
|
# If your system does not support "cp -r", try "copy -r" or perhaps
|
1994-08-30 12:42:01 +00:00
|
|
|
# something like find Lib -print | cpio -pacvdmu $(LIBDEST)
|
1994-10-20 22:04:30 +00:00
|
|
|
LIBDEST= $(SCRIPTDIR)/python
|
1994-08-01 12:07:07 +00:00
|
|
|
libinstall:
|
1994-08-30 12:42:01 +00:00
|
|
|
-if test ! -d $(LIBDEST); \
|
|
|
|
then mkdir $(LIBDEST); \
|
1994-08-01 12:07:07 +00:00
|
|
|
fi
|
1994-08-30 12:42:01 +00:00
|
|
|
cp -r $(srcdir)/Lib/* $(LIBDEST)
|
|
|
|
PYTHONPATH=$(LIBDEST) \
|
|
|
|
./python $(LIBDEST)/compileall.py $(LIBDEST)
|
1995-01-20 16:51:32 +00:00
|
|
|
$(MAKE) sharedinstall
|
1994-08-01 12:07:07 +00:00
|
|
|
|
|
|
|
# install the manual page
|
|
|
|
maninstall:
|
1995-01-20 16:51:32 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/Misc/python.man \
|
1994-10-20 22:04:30 +00:00
|
|
|
$(MANDIR)/man1/python.1
|
1994-08-01 12:07:07 +00:00
|
|
|
|
|
|
|
# install the include files
|
1994-10-20 22:04:30 +00:00
|
|
|
INCLUDEPY= $(INCLUDEDIR)/Py
|
1994-08-01 12:07:07 +00:00
|
|
|
inclinstall:
|
|
|
|
-if test ! -d $(INCLUDEPY); \
|
|
|
|
then mkdir $(INCLUDEPY); \
|
|
|
|
fi
|
1995-01-20 16:51:32 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/Include/*.h $(INCLUDEPY)
|
1994-08-01 12:07:07 +00:00
|
|
|
|
|
|
|
# install the lib*.a files and miscellaneous stuff needed by extensions
|
1994-10-20 22:04:30 +00:00
|
|
|
LIBP= $(LIBDIR)/python
|
1994-08-01 12:07:07 +00:00
|
|
|
LIBPL= $(LIBP)/lib
|
|
|
|
libainstall: all
|
|
|
|
-if test ! -d $(LIBP); \
|
|
|
|
then mkdir $(LIBP); \
|
|
|
|
fi
|
|
|
|
-if test ! -d $(LIBPL); \
|
|
|
|
then mkdir $(LIBPL); \
|
|
|
|
fi
|
1993-12-28 19:39:56 +00:00
|
|
|
for i in $(SUBDIRS); do \
|
1995-01-20 16:51:32 +00:00
|
|
|
echo $$i; $(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \
|
1994-10-10 17:58:27 +00:00
|
|
|
$(RANLIB) $(LIBPL)/lib$$i.a; \
|
1994-08-01 12:07:07 +00:00
|
|
|
done
|
1995-01-20 16:51:32 +00:00
|
|
|
$(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
|
|
|
|
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
|
|
|
|
$(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile
|
|
|
|
$(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
|
|
|
|
$(INSTALL_DATA) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
|
|
|
|
$(INSTALL_DATA) config.h $(LIBPL)/config.h
|
|
|
|
$(INSTALL_DATA) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c
|
1994-08-01 12:07:07 +00:00
|
|
|
|
1994-09-12 10:56:06 +00:00
|
|
|
# install the dynamically loadable modules
|
|
|
|
sharedinstall:
|
|
|
|
cd Modules; $(MAKE) \
|
|
|
|
OPT="$(OPT)" \
|
|
|
|
SO="$(SO)" \
|
|
|
|
LDSHARED="$(LDSHARED)" \
|
|
|
|
CCSHARED="$(CCSHARED)" \
|
|
|
|
LINKFORSHARED="$(LINKFORSHARED)" \
|
|
|
|
DESTSHARED="$(DESTSHARED)" \
|
|
|
|
sharedinstall
|
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Build the sub-Makefiles
|
1995-01-17 16:45:08 +00:00
|
|
|
Makefiles: config.status Modules/Makefile.pre
|
1994-08-01 12:07:07 +00:00
|
|
|
(cd Modules; $(MAKE) -f Makefile.pre Makefile)
|
|
|
|
for i in . $(SUBDIRS); do \
|
|
|
|
(echo $$i; cd $$i; $(MAKE) Makefile); \
|
1993-12-28 19:39:56 +00:00
|
|
|
done
|
|
|
|
|
1995-01-17 16:45:08 +00:00
|
|
|
# Build the intermediate Makefile in Modules
|
|
|
|
Modules/Makefile.pre: config.status
|
|
|
|
$(SHELL) config.status
|
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# 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; \
|
1994-08-01 12:07:07 +00:00
|
|
|
else $(SHELL) $(srcdir)/configure $(WITH); \
|
|
|
|
fi
|
|
|
|
|
|
|
|
.PRECIOUS: config.status python
|
1993-12-28 19:39:56 +00:00
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Rerun configure with the same options as it was run last time,
|
|
|
|
# provided the config.status script exists
|
|
|
|
recheck:
|
|
|
|
$(SHELL) config.status --recheck
|
1995-01-04 19:02:35 +00:00
|
|
|
$(SHELL) config.status
|
1993-12-28 19:39:56 +00:00
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Rebuild the configure script from configure.in; also rebuild config.h.in
|
|
|
|
autoconf:
|
|
|
|
(cd $(srcdir); autoconf; 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::
|
1994-08-05 15:51:00 +00:00
|
|
|
etags Include/*.h
|
|
|
|
for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
|
1994-08-01 12:07:07 +00:00
|
|
|
|
|
|
|
# Add dependencies to sub-Makefiles
|
1993-12-28 19:39:56 +00:00
|
|
|
depend:
|
|
|
|
for i in $(SUBDIRS); do \
|
|
|
|
(echo $$i; cd $$i; $(MAKE) depend); \
|
|
|
|
done
|
1993-12-24 10:39:16 +00:00
|
|
|
|
1994-08-01 12:07:07 +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 \
|
1994-08-01 12:07:07 +00:00
|
|
|
(echo $$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
|
|
|
|
|
1993-12-28 19:39:56 +00:00
|
|
|
localclobber: localclean
|
1994-08-01 12:07:07 +00:00
|
|
|
-rm -f tags TAGS python
|
1995-02-13 19:45:27 +00:00
|
|
|
-rm -f config.log config.cache config.h Makefile
|
1993-12-28 19:39:56 +00:00
|
|
|
|
|
|
|
clobber: localclobber
|
1993-12-24 10:39:16 +00:00
|
|
|
-for i in $(SUBDIRS); do \
|
1994-08-01 12:07:07 +00:00
|
|
|
(echo $$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; \
|
1994-08-01 12:07:07 +00:00
|
|
|
fi); \
|
1993-12-24 10:39:16 +00:00
|
|
|
done
|
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Make things extra clean, before making a distribution
|
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
|
1995-01-02 18:33:54 +00:00
|
|
|
-rm -f config.status config.log config.cache config.h Makefile
|
1994-08-01 12:07:07 +00:00
|
|
|
-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
|
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Find files with funny names
|
|
|
|
find:
|
|
|
|
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 RCS \
|
|
|
|
-o -name Repository \
|
|
|
|
-o -name Entries \
|
|
|
|
-o -name Tag \
|
|
|
|
-o -name tags \
|
|
|
|
-o -name TAGS \
|
|
|
|
-o -name .cvsignore \
|
|
|
|
-o -name MANIFEST \
|
|
|
|
-o -print
|
1993-12-26 18:24:40 +00:00
|
|
|
|
1994-08-01 12:07:07 +00:00
|
|
|
# Build a distribution tar file (run make distclean first)
|
|
|
|
# (This leaves the RCS and CVS directories in :-( )
|
|
|
|
tar:
|
1994-08-05 15:51:00 +00:00
|
|
|
tar cf - $(DIST) | gzip --best >dist.tar.gz
|