diff options
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 126 |
1 files changed, 100 insertions, 26 deletions
diff --git a/Makefile.in b/Makefile.in index 8b0edf0..ead8118 100644 --- a/Makefile.in +++ b/Makefile.in @@ -21,15 +21,39 @@ # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ######################################################################## -# Toplevel Makefile for Python -# Note -- if recursive makes fail, try adding MAKE=make +# 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 +# change some compiler options; it defaults to -O), prefix and +# exec_prefix (the installation paths). +# +# If recursive makes fail, try invoking make as "make MAKE=make". +# +# See also the section "Build instructions" in the README file. # Substitutions by configure srcdir= @srcdir@ VPATH= @srcdir@ -INSTALL= @INSTALL@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ -INSTALL_DATA= @INSTALL_DATA@ RANLIB= @RANLIB@ # Machine-dependent subdirectories @@ -55,9 +79,14 @@ CCSHARED= @CCSHARED@ LINKFORSHARED= @LINKFORSHARED@ DESTSHARED= $(SCRIPTDIR)/python/$(MACHDEP) -# Programs +# 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 +INSTALL_PROGRAM=${INSTALL} +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) @@ -98,19 +127,37 @@ test: python PYTHONPATH=$(TESTPATH) ./python -c 'import autotest' PYTHONPATH=$(TESTPATH) ./python -c 'import autotest' +# Install everything +install: bininstall libinstall maninstall inclinstall \ + libainstall sharedinstall + # Install the interpreter -install: python +bininstall: 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 - @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 # something like find Lib -print | cpio -pacvdmu $(LIBDEST) LIBDEST= $(SCRIPTDIR)/python -libinstall: - -if test ! -d $(LIBDEST); \ - then mkdir $(LIBDEST); \ - fi +libinstall: python + for i in $(SCRIPTDIR) $(LIBDEST); \ + do \ + if test ! -d $$i; then \ + echo "Creating directory $$i"; \ + mkdir $$i; \ + chmod 755 $$i; \ + else true; \ + fi; \ + done cp -r $(srcdir)/Lib/* $(LIBDEST) PYTHONPATH=$(LIBDEST) \ ./python $(LIBDEST)/compileall.py $(LIBDEST) @@ -123,31 +170,50 @@ libinstall: DESTSHARED="$(DESTSHARED)" \ sharedinstall -# install the manual page +# 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 $(INSTALL_DATA) $(srcdir)/Misc/python.man \ $(MANDIR)/man1/python.1 -# install the include files +# Install the include files INCLUDEPY= $(INCLUDEDIR)/Py inclinstall: - -if test ! -d $(INCLUDEPY); \ - then mkdir $(INCLUDEPY); \ - fi + for i in $(INCLUDEDIR) $(INCLUDEPY); \ + do \ + if test ! -d $$i; then \ + echo "Creating directory $$i"; \ + mkdir $$i; \ + chmod 755 $$i; \ + else true; \ + fi; \ + done $(INSTALL_DATA) $(srcdir)/Include/*.h $(INCLUDEPY) -# install the lib*.a files and miscellaneous stuff needed by extensions +# Install the lib*.a files and miscellaneous stuff needed by extensions LIBP= $(LIBDIR)/python LIBPL= $(LIBP)/lib libainstall: all - -if test ! -d $(LIBP); \ - then mkdir $(LIBP); \ - fi - -if test ! -d $(LIBPL); \ - then mkdir $(LIBPL); \ - fi + 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 $$i; $(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \ + echo $$i; \ + $(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \ $(RANLIB) $(LIBPL)/lib$$i.a; \ done $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c @@ -160,7 +226,7 @@ libainstall: all $(INSTALL_DATA) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c $(INSTALL_DATA) Modules/main.o $(LIBPL)/main.o -# install the dynamically loadable modules +# Install the dynamically loadable modules sharedinstall: cd Modules; $(MAKE) \ OPT="$(OPT)" \ @@ -270,6 +336,14 @@ distclean: clobber done; \ 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 find: find $(DISTDIRS) -type d \ |