Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1 | ######################################################################## |
Guido van Rossum | ef4bb5f | 2000-07-01 00:16:13 +0000 | [diff] [blame] | 2 | # Copyright (c) 2000, BeOpen.com. |
| 3 | # Copyright (c) 1995-2000, Corporation for National Research Initiatives. |
| 4 | # Copyright (c) 1990-1995, Stichting Mathematisch Centrum. |
| 5 | # All rights reserved. |
Guido van Rossum | d266eb4 | 1996-10-25 14:44:06 +0000 | [diff] [blame] | 6 | # |
Guido van Rossum | ef4bb5f | 2000-07-01 00:16:13 +0000 | [diff] [blame] | 7 | # See the file "Misc/COPYRIGHT" for information on usage and |
| 8 | # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 9 | ######################################################################## |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 11 | # Top-level Makefile for Python |
| 12 | # |
| 13 | # As distributed, this file is called Makefile.in; it is processed |
| 14 | # into the real Makefile by running the script ./configure, which |
| 15 | # replaces things like @spam@ with values appropriate for your system. |
| 16 | # This means that if you edit Makefile, your changes get lost the next |
| 17 | # time you run the configure script. Ideally, you can do: |
| 18 | # |
| 19 | # ./configure |
| 20 | # make |
| 21 | # make test |
| 22 | # make install |
| 23 | # |
| 24 | # The top-level Makefile invokes make recursively in a number of |
| 25 | # subdirectories (see the SUBDIRS variable below). If you want to, |
| 26 | # you can invoke make in individual subdirectories. However, the |
| 27 | # sub-Makefiles are also generated by configure, and the quickest way |
| 28 | # to make sure they are up to date is by running make (or "make |
| 29 | # Makefiles") at the top level. This is particularly important for |
| 30 | # Modules/Makefile, which has to be regenerated every time you edit |
| 31 | # Modules/Setup. The python executable is built in the Modules |
| 32 | # directory and then moved to the top-level directory. The recursive |
| 33 | # makes pass three options to subordinate makes: OPT (a quick way to |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 34 | # change some compiler options; it usually defaults to -O), prefix and |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 35 | # exec_prefix (the installation paths). |
| 36 | # |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 37 | # If you have a previous version of Python installed that you don't |
| 38 | # want to overwrite, you can use "make altinstall" instead of "make |
| 39 | # install". This changes the install procedure so it installs the |
| 40 | # Python binary as "python<version>". The libraries and include files |
| 41 | # are always installed in a subdirectory called "python<version>". |
| 42 | # "make altinstall" does not install the manual page. If you want to |
| 43 | # make this installation the "official" installation but want to keep |
| 44 | # the old binary around "just in case", rename the installed python |
| 45 | # binary to "python<oldversion>" before running "make install". |
| 46 | # (This only works between different versions, e.g. 1.3 and 1.4 -- |
| 47 | # different betas of the same version will overwrite each other in |
| 48 | # installation unless you override the VERSION Make variable.) |
| 49 | # |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 50 | # In fact, "make install" or "make bininstall" installs the binary |
| 51 | # as python<version> and makes a hard link to python, so when |
| 52 | # installing a new version in the future, nothing of the current |
| 53 | # version will be lost (except for the man page). |
| 54 | # |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 55 | # If recursive makes fail, try invoking make as "make MAKE=make". |
| 56 | # |
| 57 | # See also the section "Build instructions" in the README file. |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 58 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 59 | # Substitutions by configure |
Guido van Rossum | 914fbd9 | 1997-07-19 19:38:43 +0000 | [diff] [blame] | 60 | VERSION= @VERSION@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 61 | srcdir= @srcdir@ |
| 62 | VPATH= @srcdir@ |
Guido van Rossum | 1eec528 | 1997-07-25 22:34:08 +0000 | [diff] [blame] | 63 | CC= @CC@ |
Guido van Rossum | 5aadaf5 | 1997-08-19 14:40:11 +0000 | [diff] [blame] | 64 | AR= @AR@ |
Guido van Rossum | 4a91df4 | 1994-10-10 17:58:27 +0000 | [diff] [blame] | 65 | RANLIB= @RANLIB@ |
Guido van Rossum | 1eec528 | 1997-07-25 22:34:08 +0000 | [diff] [blame] | 66 | DEFS= @DEFS@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 67 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 68 | # Machine-dependent subdirectories |
| 69 | MACHDEP= @MACHDEP@ |
| 70 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 71 | # Install prefix for architecture-independent files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 72 | prefix= @prefix@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 73 | |
| 74 | # Install prefix for architecture-dependent files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 75 | exec_prefix= @exec_prefix@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 76 | |
Guido van Rossum | 9041279 | 1994-10-20 22:04:30 +0000 | [diff] [blame] | 77 | # Expanded directories |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 78 | BINDIR= $(exec_prefix)/bin |
| 79 | LIBDIR= $(exec_prefix)/lib |
| 80 | MANDIR= $(prefix)/man |
| 81 | INCLUDEDIR= $(prefix)/include |
Guido van Rossum | abffd00 | 1997-09-11 14:37:59 +0000 | [diff] [blame] | 82 | CONFINCLUDEDIR= $(exec_prefix)/include |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 83 | SCRIPTDIR= $(prefix)/lib |
Guido van Rossum | 9041279 | 1994-10-20 22:04:30 +0000 | [diff] [blame] | 84 | |
Guido van Rossum | bed23fe | 1996-07-31 17:30:37 +0000 | [diff] [blame] | 85 | # Detailed destination directories |
| 86 | BINLIBDEST= $(LIBDIR)/python$(VERSION) |
| 87 | LIBDEST= $(SCRIPTDIR)/python$(VERSION) |
| 88 | INCLUDEPY= $(INCLUDEDIR)/python$(VERSION) |
Guido van Rossum | abffd00 | 1997-09-11 14:37:59 +0000 | [diff] [blame] | 89 | CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION) |
Guido van Rossum | bed23fe | 1996-07-31 17:30:37 +0000 | [diff] [blame] | 90 | LIBP= $(LIBDIR)/python$(VERSION) |
| 91 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 92 | # Symbols used for using shared libraries |
| 93 | SO= @SO@ |
| 94 | LDSHARED= @LDSHARED@ |
| 95 | CCSHARED= @CCSHARED@ |
| 96 | LINKFORSHARED= @LINKFORSHARED@ |
Guido van Rossum | cf809d6 | 1997-10-20 23:16:32 +0000 | [diff] [blame] | 97 | DESTSHARED= $(BINLIBDEST)/lib-dynload |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 98 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 99 | # Shell used by make (some versions default to the login shell, which is bad) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 100 | SHELL= /bin/sh |
| 101 | |
Guido van Rossum | c9fd600 | 1997-11-11 18:29:22 +0000 | [diff] [blame] | 102 | # Use ``EXE=.exe'' for Unix emulations on DOS/Windows (e.g. GNUWIN32) |
| 103 | EXE= |
| 104 | |
Guido van Rossum | 6cedf82 | 1997-12-02 17:52:37 +0000 | [diff] [blame] | 105 | # Modes for directories, executables and data files created by the |
Guido van Rossum | b73172f | 2000-08-29 15:00:11 +0000 | [diff] [blame] | 106 | # install process. Default to user-only-writable for all file types. |
| 107 | DIRMODE= 755 |
Guido van Rossum | 6cedf82 | 1997-12-02 17:52:37 +0000 | [diff] [blame] | 108 | EXEMODE= 755 |
| 109 | FILEMODE= 644 |
| 110 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 111 | # Portable install script (configure doesn't always guess right) |
| 112 | INSTALL= @srcdir@/install-sh -c |
Guido van Rossum | 6cedf82 | 1997-12-02 17:52:37 +0000 | [diff] [blame] | 113 | INSTALL_PROGRAM=${INSTALL} -m $(EXEMODE) |
| 114 | INSTALL_DATA= ${INSTALL} -m $(FILEMODE) |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 115 | |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 116 | # Use this to make a link between python$(VERSION) and python in $(BINDIR) |
| 117 | LN=@LN@ |
| 118 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 119 | # --with-PACKAGE options for configure script |
| 120 | # e.g. --with-readline --with-svr5 --with-solaris --with-thread |
| 121 | # (see README for an explanation) |
| 122 | WITH= |
| 123 | |
| 124 | # Compiler options passed to subordinate makes |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 125 | OPT= @OPT@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 126 | |
| 127 | # Subdirectories where to run make recursively |
Thomas Wouters | 6546983 | 2000-08-11 22:26:35 +0000 | [diff] [blame] | 128 | SUBDIRS= Parser Grammar Objects Python Modules |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 129 | |
| 130 | # Other subdirectories |
Thomas Wouters | 6546983 | 2000-08-11 22:26:35 +0000 | [diff] [blame] | 131 | SUBDIRSTOO= Include Lib Misc Demo |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 132 | |
| 133 | # Files and directories to be distributed |
| 134 | CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.in |
| 135 | DISTFILES= README ChangeLog $(CONFIGFILES) |
| 136 | DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy |
| 137 | DIST= $(DISTFILES) $(DISTDIRS) |
| 138 | |
Guido van Rossum | 1eec528 | 1997-07-25 22:34:08 +0000 | [diff] [blame] | 139 | # Compilation flags for getbuildinfo.c only |
| 140 | CFLAGS= $(OPT) -I. $(DEFS) |
| 141 | |
Guido van Rossum | 914fbd9 | 1997-07-19 19:38:43 +0000 | [diff] [blame] | 142 | LIBRARY= libpython$(VERSION).a |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 143 | LDLIBRARY= @LDLIBRARY@ |
Guido van Rossum | 914fbd9 | 1997-07-19 19:38:43 +0000 | [diff] [blame] | 144 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 145 | # Default target |
Guido van Rossum | 717d1fd | 1999-02-23 15:43:15 +0000 | [diff] [blame] | 146 | all: $(LIBRARY) python$(EXE) sharedmods |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 147 | |
| 148 | # Build the interpreter |
Guido van Rossum | 717d1fd | 1999-02-23 15:43:15 +0000 | [diff] [blame] | 149 | python$(EXE): $(LIBRARY) buildno Modules/python.o |
Guido van Rossum | 86c052e | 1997-08-20 22:13:15 +0000 | [diff] [blame] | 150 | expr `cat buildno` + 1 >buildno1 |
| 151 | mv -f buildno1 buildno |
Guido van Rossum | 1eec528 | 1997-07-25 22:34:08 +0000 | [diff] [blame] | 152 | $(CC) -c $(CFLAGS) -DBUILD=`cat buildno` \ |
| 153 | $(srcdir)/Modules/getbuildinfo.c |
| 154 | $(AR) cr $(LIBRARY) getbuildinfo.o |
| 155 | $(RANLIB) $(LIBRARY) |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 156 | @MAKE_LDLIBRARY@ |
Guido van Rossum | 914fbd9 | 1997-07-19 19:38:43 +0000 | [diff] [blame] | 157 | cd Modules; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \ |
| 158 | prefix="$(prefix)" exec_prefix="$(exec_prefix)" \ |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 159 | LIBRARY=../$(LDLIBRARY) link |
Guido van Rossum | 914fbd9 | 1997-07-19 19:38:43 +0000 | [diff] [blame] | 160 | |
Guido van Rossum | 370a083 | 1998-10-01 16:42:41 +0000 | [diff] [blame] | 161 | Modules/python.o: $(srcdir)/Modules/python.c |
| 162 | cd Modules; $(MAKE) OPT="$(OPT)" python.o |
| 163 | |
Guido van Rossum | 1eec528 | 1997-07-25 22:34:08 +0000 | [diff] [blame] | 164 | buildno: |
| 165 | echo 0 >buildno |
| 166 | |
Guido van Rossum | 506ef9e | 1997-08-18 14:22:24 +0000 | [diff] [blame] | 167 | # Build the shared modules |
Guido van Rossum | 717d1fd | 1999-02-23 15:43:15 +0000 | [diff] [blame] | 168 | sharedmods: python$(EXE) |
Guido van Rossum | 506ef9e | 1997-08-18 14:22:24 +0000 | [diff] [blame] | 169 | cd Modules; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \ |
| 170 | prefix="$(prefix)" exec_prefix="$(exec_prefix)" \ |
| 171 | sharedmods |
| 172 | |
Guido van Rossum | 914fbd9 | 1997-07-19 19:38:43 +0000 | [diff] [blame] | 173 | # Build the library |
| 174 | $(LIBRARY): $(SUBDIRS) |
| 175 | if test ! -f $(LIBRARY); \ |
| 176 | then for i in $(SUBDIRS); do rm -f $$i/add2lib; done; true; \ |
| 177 | else true; fi |
| 178 | for i in $(SUBDIRS); do \ |
| 179 | (cd $$i; $(MAKE) VERSION="$(VERSION)" add2lib); done |
Guido van Rossum | 4246edd | 1997-04-23 15:14:24 +0000 | [diff] [blame] | 180 | |
Guido van Rossum | 3c4bb80 | 1997-12-18 23:55:32 +0000 | [diff] [blame] | 181 | # This rule is only here for DG/UX!!! |
| 182 | libpython$(VERSION).so: $(LIBRARY) |
Guido van Rossum | 717d1fd | 1999-02-23 15:43:15 +0000 | [diff] [blame] | 183 | case `uname -s | tr -d '/ ' | tr '[A-Z]' '[a-z]'` in \ |
| 184 | *dgux*) \ |
| 185 | test -d dgux || mkdir dgux; \ |
| 186 | (cd dgux;ar x ../$^;ld -G -o ../$@ * ); \ |
| 187 | /bin/rm -rf ./dgux \ |
| 188 | ;; \ |
| 189 | esac |
Guido van Rossum | 3c4bb80 | 1997-12-18 23:55:32 +0000 | [diff] [blame] | 190 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 191 | # This rule is here for OPENSTEP/Rhapsody/MacOSX |
| 192 | libpython$(VERSION).dylib: $(LIBRARY) |
| 193 | libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) -framework System @LIBTOOL_CRUFT@ |
| 194 | |
Guido van Rossum | 4246edd | 1997-04-23 15:14:24 +0000 | [diff] [blame] | 195 | $(SUBDIRS): Makefiles |
| 196 | |
Thomas Wouters | 6546983 | 2000-08-11 22:26:35 +0000 | [diff] [blame] | 197 | Grammar: |
Sjoerd Mullender | 59bb080 | 2000-08-17 11:38:18 +0000 | [diff] [blame] | 198 | cd Grammar ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \ |
Thomas Wouters | 6546983 | 2000-08-11 22:26:35 +0000 | [diff] [blame] | 199 | prefix="$(prefix)" exec_prefix="$(exec_prefix)" all |
| 200 | |
Guido van Rossum | 4246edd | 1997-04-23 15:14:24 +0000 | [diff] [blame] | 201 | Parser: |
| 202 | cd Parser ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \ |
| 203 | prefix="$(prefix)" exec_prefix="$(exec_prefix)" all |
| 204 | |
| 205 | Python: |
| 206 | cd Python ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \ |
| 207 | prefix="$(prefix)" exec_prefix="$(exec_prefix)" all |
| 208 | |
| 209 | Objects: |
| 210 | cd Objects ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \ |
| 211 | prefix="$(prefix)" exec_prefix="$(exec_prefix)" all |
| 212 | |
Guido van Rossum | 914fbd9 | 1997-07-19 19:38:43 +0000 | [diff] [blame] | 213 | Modules: Parser Python Objects |
Guido van Rossum | 4246edd | 1997-04-23 15:14:24 +0000 | [diff] [blame] | 214 | cd Modules ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \ |
| 215 | prefix="$(prefix)" exec_prefix="$(exec_prefix)" all |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 216 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 217 | # Test the interpreter (twice, once without .pyc files, once with) |
Barry Warsaw | 29d0a00 | 2000-08-03 15:52:30 +0000 | [diff] [blame] | 218 | TESTOPTS= -l |
Guido van Rossum | 042a051 | 1997-01-03 15:54:36 +0000 | [diff] [blame] | 219 | TESTPROG= $(srcdir)/Lib/test/regrtest.py |
Fred Drake | 9abc25e | 2000-02-10 17:23:44 +0000 | [diff] [blame] | 220 | TESTPYTHON= ./python$(EXE) -tt |
Guido van Rossum | bcb393f | 1999-11-16 15:58:32 +0000 | [diff] [blame] | 221 | test: all |
Guido van Rossum | cf809d6 | 1997-10-20 23:16:32 +0000 | [diff] [blame] | 222 | -rm -f $(srcdir)/Lib/test/*.py[co] |
Barry Warsaw | dd82bb9 | 1997-08-29 21:52:14 +0000 | [diff] [blame] | 223 | -PYTHONPATH= $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) |
| 224 | PYTHONPATH= $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 225 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 226 | # Install everything |
Guido van Rossum | 6d47298 | 1996-07-30 21:41:56 +0000 | [diff] [blame] | 227 | install: altinstall bininstall maninstall |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 228 | |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 229 | # Install almost everything without disturbing previous versions |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 230 | altinstall: altbininstall libinstall inclinstall libainstall sharedinstall |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 231 | |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 232 | # Install the interpreter (by creating a hard link to python$(VERSION)) |
| 233 | bininstall: altbininstall |
Guido van Rossum | 717d1fd | 1999-02-23 15:43:15 +0000 | [diff] [blame] | 234 | -if test -f $(BINDIR)/python$(EXE); \ |
| 235 | then rm -f $(BINDIR)/python$(EXE); \ |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 236 | else true; \ |
| 237 | fi |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 238 | (cd $(BINDIR); $(LN) python$(VERSION)$(EXE) python$(EXE)) |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 239 | |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 240 | # Install the interpreter with $(VERSION) affixed |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 241 | # This goes into $(exec_prefix) |
Guido van Rossum | 717d1fd | 1999-02-23 15:43:15 +0000 | [diff] [blame] | 242 | altbininstall: python$(EXE) |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 243 | @for i in $(BINDIR); \ |
| 244 | do \ |
| 245 | if test ! -d $$i; then \ |
| 246 | echo "Creating directory $$i"; \ |
| 247 | mkdir $$i; \ |
Guido van Rossum | 6cedf82 | 1997-12-02 17:52:37 +0000 | [diff] [blame] | 248 | chmod $(DIRMODE) $$i; \ |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 249 | else true; \ |
| 250 | fi; \ |
| 251 | done |
Guido van Rossum | c9fd600 | 1997-11-11 18:29:22 +0000 | [diff] [blame] | 252 | $(INSTALL_PROGRAM) python$(EXE) $(BINDIR)/python$(VERSION)$(EXE) |
Guido van Rossum | 8b0d95f | 1997-12-19 23:02:22 +0000 | [diff] [blame] | 253 | if test -f libpython$(VERSION).so; then \ |
| 254 | $(INSTALL_DATA) libpython$(VERSION).so $(LIBDIR); \ |
| 255 | else true; \ |
| 256 | fi |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 257 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 258 | # Install the manual page |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 259 | maninstall: |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 260 | @for i in $(MANDIR) $(MANDIR)/man1; \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 261 | do \ |
| 262 | if test ! -d $$i; then \ |
| 263 | echo "Creating directory $$i"; \ |
| 264 | mkdir $$i; \ |
Guido van Rossum | 6cedf82 | 1997-12-02 17:52:37 +0000 | [diff] [blame] | 265 | chmod $(DIRMODE) $$i; \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 266 | else true; \ |
| 267 | fi; \ |
| 268 | done |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 269 | $(INSTALL_DATA) $(srcdir)/Misc/python.man \ |
Guido van Rossum | 9041279 | 1994-10-20 22:04:30 +0000 | [diff] [blame] | 270 | $(MANDIR)/man1/python.1 |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 271 | |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 272 | # Install the library |
Guido van Rossum | 86b7db3 | 1997-10-06 00:15:31 +0000 | [diff] [blame] | 273 | PLATDIR= plat-$(MACHDEP) |
| 274 | MACHDEPS= $(PLATDIR) |
Fred Drake | 4247ba6 | 2000-06-30 15:46:08 +0000 | [diff] [blame] | 275 | XMLLIBSUBDIRS= xml xml/dom xml/parser xml/sax |
Guido van Rossum | 0f7bd3c | 2000-04-24 14:57:21 +0000 | [diff] [blame] | 276 | LIBSUBDIRS= lib-old lib-tk site-packages test test/output encodings \ |
Fred Drake | 4247ba6 | 2000-06-30 15:46:08 +0000 | [diff] [blame] | 277 | distutils distutils/command $(XMLLIBSUBDIRS) curses $(MACHDEPS) |
Guido van Rossum | 86b7db3 | 1997-10-06 00:15:31 +0000 | [diff] [blame] | 278 | libinstall: python $(srcdir)/Lib/$(PLATDIR) |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 279 | @for i in $(SCRIPTDIR) $(LIBDEST); \ |
| 280 | do \ |
| 281 | if test ! -d $$i; then \ |
| 282 | echo "Creating directory $$i"; \ |
| 283 | mkdir $$i; \ |
Guido van Rossum | 6cedf82 | 1997-12-02 17:52:37 +0000 | [diff] [blame] | 284 | chmod $(DIRMODE) $$i; \ |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 285 | else true; \ |
| 286 | fi; \ |
| 287 | done |
| 288 | @for d in $(LIBSUBDIRS); \ |
| 289 | do \ |
| 290 | a=$(srcdir)/Lib/$$d; \ |
| 291 | if test ! -d $$a; then continue; else true; fi; \ |
| 292 | b=$(LIBDEST)/$$d; \ |
| 293 | if test ! -d $$b; then \ |
| 294 | echo "Creating directory $$b"; \ |
| 295 | mkdir $$b; \ |
Guido van Rossum | 6cedf82 | 1997-12-02 17:52:37 +0000 | [diff] [blame] | 296 | chmod $(DIRMODE) $$b; \ |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 297 | else true; \ |
| 298 | fi; \ |
| 299 | done |
| 300 | @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \ |
| 301 | do \ |
| 302 | if test -x $$i; then \ |
| 303 | $(INSTALL_PROGRAM) $$i $(LIBDEST); \ |
| 304 | echo $(INSTALL_PROGRAM) $$i $(LIBDEST); \ |
| 305 | else \ |
| 306 | $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 307 | echo $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 308 | fi; \ |
| 309 | done |
| 310 | @for d in $(LIBSUBDIRS); \ |
| 311 | do \ |
| 312 | a=$(srcdir)/Lib/$$d; \ |
| 313 | if test ! -d $$a; then continue; else true; fi; \ |
| 314 | b=$(LIBDEST)/$$d; \ |
| 315 | for i in $$a/*; \ |
| 316 | do \ |
| 317 | case $$i in \ |
| 318 | *CVS) ;; \ |
Guido van Rossum | cf809d6 | 1997-10-20 23:16:32 +0000 | [diff] [blame] | 319 | *.py[co]) ;; \ |
Guido van Rossum | b73172f | 2000-08-29 15:00:11 +0000 | [diff] [blame] | 320 | *.orig) ;; \ |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 321 | *~) ;; \ |
| 322 | *) \ |
Guido van Rossum | 8e29a59 | 1997-12-02 19:18:27 +0000 | [diff] [blame] | 323 | if test -d $$i; then continue; fi; \ |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 324 | if test -x $$i; then \ |
| 325 | echo $(INSTALL_PROGRAM) $$i $$b; \ |
| 326 | $(INSTALL_PROGRAM) $$i $$b; \ |
| 327 | else \ |
| 328 | echo $(INSTALL_DATA) $$i $$b; \ |
| 329 | $(INSTALL_DATA) $$i $$b; \ |
| 330 | fi;; \ |
| 331 | esac; \ |
| 332 | done; \ |
| 333 | done |
| 334 | PYTHONPATH=$(LIBDEST) \ |
Fred Drake | 4b0200e | 2000-07-04 04:15:53 +0000 | [diff] [blame] | 335 | ./python$(EXE) -tt $(LIBDEST)/compileall.py $(LIBDEST) |
Fred Drake | db5a41f | 1997-03-13 14:14:29 +0000 | [diff] [blame] | 336 | PYTHONPATH=$(LIBDEST) \ |
Guido van Rossum | 717d1fd | 1999-02-23 15:43:15 +0000 | [diff] [blame] | 337 | ./python$(EXE) -O $(LIBDEST)/compileall.py $(LIBDEST) |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 338 | |
Guido van Rossum | 86b7db3 | 1997-10-06 00:15:31 +0000 | [diff] [blame] | 339 | # Create the PLATDIR source directory, if one wasn't distributed.. |
| 340 | $(srcdir)/Lib/$(PLATDIR): |
| 341 | mkdir $(srcdir)/Lib/$(PLATDIR) |
| 342 | cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen |
Guido van Rossum | 04831d1 | 1996-09-10 18:21:32 +0000 | [diff] [blame] | 343 | export PATH; PATH="`pwd`:$$PATH"; \ |
Guido van Rossum | f71bd68 | 1996-08-28 19:23:01 +0000 | [diff] [blame] | 344 | export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ |
Guido van Rossum | 86b7db3 | 1997-10-06 00:15:31 +0000 | [diff] [blame] | 345 | cd $(srcdir)/Lib/$(PLATDIR); ./regen |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 346 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 347 | # Install the include files |
Guido van Rossum | abffd00 | 1997-09-11 14:37:59 +0000 | [diff] [blame] | 348 | INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 349 | inclinstall: |
Guido van Rossum | abffd00 | 1997-09-11 14:37:59 +0000 | [diff] [blame] | 350 | @for i in $(INCLDIRSTOMAKE); \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 351 | do \ |
| 352 | if test ! -d $$i; then \ |
| 353 | echo "Creating directory $$i"; \ |
| 354 | mkdir $$i; \ |
Guido van Rossum | 6cedf82 | 1997-12-02 17:52:37 +0000 | [diff] [blame] | 355 | chmod $(DIRMODE) $$i; \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 356 | else true; \ |
| 357 | fi; \ |
| 358 | done |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 359 | @for i in $(srcdir)/Include/*.h; \ |
| 360 | do \ |
| 361 | echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 362 | $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 363 | done |
Guido van Rossum | abffd00 | 1997-09-11 14:37:59 +0000 | [diff] [blame] | 364 | $(INSTALL_DATA) config.h $(CONFINCLUDEPY)/config.h |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 365 | |
Guido van Rossum | 914fbd9 | 1997-07-19 19:38:43 +0000 | [diff] [blame] | 366 | # Install the library and miscellaneous stuff needed for extending/embedding |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 367 | # This goes into $(exec_prefix) |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 368 | LIBPL= $(LIBP)/config |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 369 | libainstall: all |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 370 | @for i in $(LIBDIR) $(LIBP) $(LIBPL); \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 371 | do \ |
| 372 | if test ! -d $$i; then \ |
| 373 | echo "Creating directory $$i"; \ |
| 374 | mkdir $$i; \ |
Guido van Rossum | 6cedf82 | 1997-12-02 17:52:37 +0000 | [diff] [blame] | 375 | chmod $(DIRMODE) $$i; \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 376 | else true; \ |
| 377 | fi; \ |
| 378 | done |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 379 | @if [ "$(MACHDEP)" != "beos" ] ; then \ |
| 380 | $(INSTALL_DATA) $(LIBRARY) $(LIBPL)/$(LIBRARY) ; \ |
| 381 | $(RANLIB) $(LIBPL)/$(LIBRARY) ; \ |
| 382 | fi |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 383 | $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c |
Guido van Rossum | 895e105 | 1997-07-19 22:53:39 +0000 | [diff] [blame] | 384 | $(INSTALL_DATA) Modules/python.o $(LIBPL)/python.o |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 385 | $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in |
| 386 | $(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile |
| 387 | $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup |
Guido van Rossum | ded2e20 | 1997-07-19 22:00:45 +0000 | [diff] [blame] | 388 | $(INSTALL_DATA) Modules/Setup.local $(LIBPL)/Setup.local |
Barry Warsaw | 6de7213 | 2000-06-30 16:04:18 +0000 | [diff] [blame] | 389 | $(INSTALL_DATA) Modules/Setup.config $(LIBPL)/Setup.config |
Guido van Rossum | 70a8659 | 1996-07-21 02:46:47 +0000 | [diff] [blame] | 390 | $(INSTALL_PROGRAM) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup |
Guido van Rossum | d99d714 | 1997-10-04 04:35:24 +0000 | [diff] [blame] | 391 | $(INSTALL_PROGRAM) $(srcdir)/install-sh $(LIBPL)/install-sh |
Guido van Rossum | e475d86 | 1997-10-29 19:07:30 +0000 | [diff] [blame] | 392 | $(INSTALL_DATA) $(srcdir)/Misc/Makefile.pre.in $(LIBPL)/Makefile.pre.in |
Guido van Rossum | 69f6580 | 1998-03-03 21:47:00 +0000 | [diff] [blame] | 393 | @if [ -s Modules/python.exp -a \ |
Guido van Rossum | a58153e | 1998-05-05 20:40:18 +0000 | [diff] [blame] | 394 | "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \ |
Guido van Rossum | 69f6580 | 1998-03-03 21:47:00 +0000 | [diff] [blame] | 395 | echo; echo "Installing support files for building shared extension modules on AIX:"; \ |
| 396 | $(INSTALL_DATA) Modules/python.exp \ |
| 397 | $(LIBPL)/python.exp; \ |
| 398 | echo; echo "$(LIBPL)/python.exp"; \ |
| 399 | $(INSTALL_PROGRAM) $(srcdir)/Modules/makexp_aix \ |
| 400 | $(LIBPL)/makexp_aix; \ |
| 401 | echo "$(LIBPL)/makexp_aix"; \ |
| 402 | $(INSTALL_PROGRAM) $(srcdir)/Modules/ld_so_aix \ |
| 403 | $(LIBPL)/ld_so_aix; \ |
| 404 | echo "$(LIBPL)/ld_so_aix"; \ |
| 405 | echo; echo "See Misc/AIX-NOTES for details."; \ |
| 406 | else true; \ |
| 407 | fi |
Fred Drake | d3b1f11 | 2000-08-31 22:02:46 +0000 | [diff] [blame] | 408 | @if [ "$(MACHDEP)" = "beos" ] ; then \ |
Fred Drake | b0b7e31 | 2000-08-24 18:11:21 +0000 | [diff] [blame] | 409 | echo; echo "Installing support files for building shared extension modules on BeOS:"; \ |
| 410 | $(INSTALL_DATA) BeOS/README $(LIBPL)/README; \ |
| 411 | echo; echo "$(LIBPL)/README"; \ |
| 412 | $(INSTALL_DATA) BeOS/README.readline-2.2 $(LIBPL)/README.readline-2.2; \ |
| 413 | echo "$(LIBPL)/README.readline-2.2"; \ |
| 414 | $(INSTALL_DATA) BeOS/dl_export.h $(LIBPL)/dl_export.h; \ |
| 415 | echo "$(LIBPL)/dl_export.h"; \ |
| 416 | $(INSTALL_PROGRAM) BeOS/ar-fake $(LIBPL)/ar-fake; \ |
| 417 | echo "$(LIBPL)/ar-fake"; \ |
| 418 | $(INSTALL_PROGRAM) BeOS/linkcc $(LIBPL)/linkcc; \ |
| 419 | echo "$(LIBPL)/linkcc"; \ |
| 420 | $(INSTALL_PROGRAM) BeOS/linkmodule $(LIBPL)/linkmodule; \ |
| 421 | echo "$(LIBPL)/linkmodule"; \ |
| 422 | echo; echo "See BeOS/README for details."; \ |
| 423 | else true; \ |
| 424 | fi |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 425 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 426 | # Install the dynamically loadable modules |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 427 | # This goes into $(exec_prefix) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 428 | sharedinstall: |
| 429 | cd Modules; $(MAKE) \ |
| 430 | OPT="$(OPT)" \ |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 431 | VERSION="$(VERSION)" \ |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 432 | SO="$(SO)" \ |
| 433 | LDSHARED="$(LDSHARED)" \ |
| 434 | CCSHARED="$(CCSHARED)" \ |
| 435 | LINKFORSHARED="$(LINKFORSHARED)" \ |
| 436 | DESTSHARED="$(DESTSHARED)" \ |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 437 | prefix="$(prefix)" \ |
| 438 | exec_prefix="$(exec_prefix)" \ |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 439 | sharedinstall |
| 440 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 441 | # Build the sub-Makefiles |
Guido van Rossum | d09119e | 1995-01-17 16:45:08 +0000 | [diff] [blame] | 442 | Makefiles: config.status Modules/Makefile.pre |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 443 | (cd Modules; $(MAKE) -f Makefile.pre Makefile) |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 444 | @for i in . $(SUBDIRS); do \ |
| 445 | (echo making Makefile in subdirectory $$i; cd $$i; \ |
| 446 | $(MAKE) Makefile); \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 447 | done |
Guido van Rossum | 2a57004 | 1998-10-07 22:51:56 +0000 | [diff] [blame] | 448 | -(rm -f Modules/hassignal; cd Modules; $(MAKE) hassignal) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 449 | |
Guido van Rossum | d09119e | 1995-01-17 16:45:08 +0000 | [diff] [blame] | 450 | # Build the intermediate Makefile in Modules |
| 451 | Modules/Makefile.pre: config.status |
| 452 | $(SHELL) config.status |
| 453 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 454 | # Build the toplevel Makefile |
| 455 | Makefile: Makefile.in config.status |
| 456 | CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status |
| 457 | |
| 458 | # Run the configure script. If config.status already exists, |
| 459 | # call it with the --recheck argument, which reruns configure with the |
| 460 | # same options as it was run last time; otherwise run the configure |
| 461 | # script with options taken from the $(WITH) variable |
| 462 | config.status: $(srcdir)/configure |
| 463 | if test -f config.status; \ |
| 464 | then $(SHELL) config.status --recheck; \ |
Guido van Rossum | fb00a99 | 1995-01-12 12:26:50 +0000 | [diff] [blame] | 465 | $(SHELL) config.status; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 466 | else $(SHELL) $(srcdir)/configure $(WITH); \ |
| 467 | fi |
| 468 | |
Guido van Rossum | 717d1fd | 1999-02-23 15:43:15 +0000 | [diff] [blame] | 469 | .PRECIOUS: config.status python$(EXE) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 470 | |
| 471 | # Rerun configure with the same options as it was run last time, |
| 472 | # provided the config.status script exists |
| 473 | recheck: |
| 474 | $(SHELL) config.status --recheck |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 475 | $(SHELL) config.status |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 476 | |
| 477 | # Rebuild the configure script from configure.in; also rebuild config.h.in |
| 478 | autoconf: |
Guido van Rossum | 0068267 | 1996-06-28 20:15:41 +0000 | [diff] [blame] | 479 | (cd $(srcdir); autoconf) |
| 480 | (cd $(srcdir); autoheader) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 481 | |
| 482 | # Create a tags file for vi |
| 483 | tags:: |
Guido van Rossum | 251caa5 | 2000-07-31 18:26:35 +0000 | [diff] [blame] | 484 | cd $(srcdir); \ |
| 485 | ctags -w -t Include/*.h; \ |
| 486 | for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; \ |
| 487 | done; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 488 | sort tags -o tags |
| 489 | |
| 490 | # Create a tags file for GNU Emacs |
| 491 | TAGS:: |
Guido van Rossum | 251caa5 | 2000-07-31 18:26:35 +0000 | [diff] [blame] | 492 | cd $(srcdir); \ |
| 493 | etags Include/*.h; \ |
Guido van Rossum | 5552eb7 | 1994-08-05 15:51:00 +0000 | [diff] [blame] | 494 | for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 495 | |
| 496 | # Add dependencies to sub-Makefiles |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 497 | depend: |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 498 | @for i in $(SUBDIRS); do \ |
| 499 | (echo making depend in subdirectory $$i; cd $$i; \ |
| 500 | $(MAKE) depend); \ |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 501 | done |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 502 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 503 | # Sanitation targets -- clean leaves libraries, executables and tags |
| 504 | # files, which clobber removes those as well |
| 505 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 506 | localclean: |
| 507 | -rm -f core *~ [@,#]* *.old *.orig *.rej |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 508 | |
| 509 | clean: localclean |
| 510 | -for i in $(SUBDIRS); do \ |
Guido van Rossum | 15527e9 | 1998-05-19 21:15:03 +0000 | [diff] [blame] | 511 | if test -d $$i; then \ |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 512 | (echo making clean in subdirectory $$i; cd $$i; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 513 | if test -f Makefile; \ |
| 514 | then $(MAKE) clean; \ |
| 515 | else $(MAKE) -f Makefile.*in clean; \ |
| 516 | fi); \ |
Guido van Rossum | 15527e9 | 1998-05-19 21:15:03 +0000 | [diff] [blame] | 517 | else true; fi; \ |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 518 | done |
| 519 | |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 520 | localclobber: localclean |
Guido van Rossum | 717d1fd | 1999-02-23 15:43:15 +0000 | [diff] [blame] | 521 | -rm -f tags TAGS python$(EXE) $(LIBRARY) $(LDLIBRARY) *.o |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 522 | -rm -f config.log config.cache config.h |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 523 | |
| 524 | clobber: localclobber |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 525 | -for i in $(SUBDIRS); do \ |
Guido van Rossum | 15527e9 | 1998-05-19 21:15:03 +0000 | [diff] [blame] | 526 | if test -d $$i; then \ |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 527 | (echo clobbering subdirectory $$i; cd $$i; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 528 | if test -f Makefile; \ |
| 529 | then $(MAKE) clobber; \ |
Guido van Rossum | 15527e9 | 1998-05-19 21:15:03 +0000 | [diff] [blame] | 530 | else $(MAKE) -f $(srcdir)/Makefile*.in clobber; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 531 | fi); \ |
Guido van Rossum | 15527e9 | 1998-05-19 21:15:03 +0000 | [diff] [blame] | 532 | else true; fi; \ |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 533 | done |
| 534 | |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 535 | # Make things extra clean, before making a distribution: |
| 536 | # remove all generated files, even Makefile[.pre] |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 537 | distclean: clobber |
Guido van Rossum | 7b4d460 | 1995-03-22 12:27:16 +0000 | [diff] [blame] | 538 | -$(MAKE) -f $(srcdir)/Makefile.in \ |
| 539 | SUBDIRS="$(SUBDIRSTOO)" clobber |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 540 | -rm -f config.status config.log config.cache config.h Makefile |
Guido van Rossum | cf0be04 | 1997-08-29 18:42:35 +0000 | [diff] [blame] | 541 | -rm -f buildno |
Guido van Rossum | e7abf4e | 1995-09-18 22:12:20 +0000 | [diff] [blame] | 542 | -rm -f Modules/Makefile |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 543 | -for i in $(SUBDIRS) $(SUBDIRSTOO); do \ |
| 544 | for f in $$i/*.in; do \ |
| 545 | f=`basename "$$f" .in`; \ |
| 546 | if test "$$f" != "*"; then \ |
| 547 | echo rm -f "$$i/$$f"; \ |
| 548 | rm -f "$$i/$$f"; \ |
| 549 | fi; \ |
| 550 | done; \ |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 551 | done |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 552 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 553 | # Check for smelly exported symbols (not starting with Py/_Py) |
| 554 | smelly: all |
| 555 | for i in $(SUBDIRS); do \ |
| 556 | echo --- $$i ---; \ |
| 557 | nm -p $$i/lib$$i.a | \ |
| 558 | sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ |
| 559 | done |
| 560 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 561 | # Find files with funny names |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 562 | funny: |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 563 | find $(DISTDIRS) -type d \ |
| 564 | -o -name '*.[chs]' \ |
| 565 | -o -name '*.py' \ |
| 566 | -o -name '*.doc' \ |
| 567 | -o -name '*.sty' \ |
| 568 | -o -name '*.bib' \ |
| 569 | -o -name '*.dat' \ |
| 570 | -o -name '*.el' \ |
| 571 | -o -name '*.fd' \ |
| 572 | -o -name '*.in' \ |
| 573 | -o -name '*.tex' \ |
| 574 | -o -name '*,[vpt]' \ |
| 575 | -o -name 'Setup' \ |
| 576 | -o -name 'Setup.*' \ |
| 577 | -o -name README \ |
| 578 | -o -name Makefile \ |
| 579 | -o -name ChangeLog \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 580 | -o -name Repository \ |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 581 | -o -name Root \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 582 | -o -name Entries \ |
| 583 | -o -name Tag \ |
| 584 | -o -name tags \ |
| 585 | -o -name TAGS \ |
| 586 | -o -name .cvsignore \ |
| 587 | -o -name MANIFEST \ |
| 588 | -o -print |
Fred Drake | b0b7e31 | 2000-08-24 18:11:21 +0000 | [diff] [blame] | 589 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |