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