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