Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1 | ######################################################################## |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 2 | # Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 3 | # The Netherlands. |
| 4 | # |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 5 | # All Rights Reserved |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 6 | # |
| 7 | # Permission to use, copy, modify, and distribute this software and its |
| 8 | # documentation for any purpose and without fee is hereby granted, |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 9 | # provided that the above copyright notice appear in all copies and that |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 10 | # both that copyright notice and this permission notice appear in |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 11 | # supporting documentation, and that the names of Stichting Mathematisch |
| 12 | # Centrum or CWI not be used in advertising or publicity pertaining to |
| 13 | # distribution of the software without specific, written prior permission. |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 14 | # |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 15 | # STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO |
| 16 | # THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 17 | # FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE |
| 18 | # FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 19 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 20 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
| 21 | # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 22 | ######################################################################## |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 23 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 24 | # Top-level Makefile for Python |
| 25 | # |
| 26 | # As distributed, this file is called Makefile.in; it is processed |
| 27 | # into the real Makefile by running the script ./configure, which |
| 28 | # replaces things like @spam@ with values appropriate for your system. |
| 29 | # This means that if you edit Makefile, your changes get lost the next |
| 30 | # time you run the configure script. Ideally, you can do: |
| 31 | # |
| 32 | # ./configure |
| 33 | # make |
| 34 | # make test |
| 35 | # make install |
| 36 | # |
| 37 | # The top-level Makefile invokes make recursively in a number of |
| 38 | # subdirectories (see the SUBDIRS variable below). If you want to, |
| 39 | # you can invoke make in individual subdirectories. However, the |
| 40 | # sub-Makefiles are also generated by configure, and the quickest way |
| 41 | # to make sure they are up to date is by running make (or "make |
| 42 | # Makefiles") at the top level. This is particularly important for |
| 43 | # Modules/Makefile, which has to be regenerated every time you edit |
| 44 | # Modules/Setup. The python executable is built in the Modules |
| 45 | # directory and then moved to the top-level directory. The recursive |
| 46 | # 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] | 47 | # change some compiler options; it usually defaults to -O), prefix and |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 48 | # exec_prefix (the installation paths). |
| 49 | # |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 50 | # If you have a previous version of Python installed that you don't |
| 51 | # want to overwrite, you can use "make altinstall" instead of "make |
| 52 | # install". This changes the install procedure so it installs the |
| 53 | # Python binary as "python<version>". The libraries and include files |
| 54 | # are always installed in a subdirectory called "python<version>". |
| 55 | # "make altinstall" does not install the manual page. If you want to |
| 56 | # make this installation the "official" installation but want to keep |
| 57 | # the old binary around "just in case", rename the installed python |
| 58 | # binary to "python<oldversion>" before running "make install". |
| 59 | # (This only works between different versions, e.g. 1.3 and 1.4 -- |
| 60 | # different betas of the same version will overwrite each other in |
| 61 | # installation unless you override the VERSION Make variable.) |
| 62 | # |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 63 | # In fact, "make install" or "make bininstall" installs the binary |
| 64 | # as python<version> and makes a hard link to python, so when |
| 65 | # installing a new version in the future, nothing of the current |
| 66 | # version will be lost (except for the man page). |
| 67 | # |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 68 | # If recursive makes fail, try invoking make as "make MAKE=make". |
| 69 | # |
| 70 | # See also the section "Build instructions" in the README file. |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 71 | |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 72 | # Interpreter version number, for library destination pathnames |
| 73 | VERSION= 1.4 |
| 74 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 75 | # Substitutions by configure |
| 76 | srcdir= @srcdir@ |
| 77 | VPATH= @srcdir@ |
Guido van Rossum | 4a91df4 | 1994-10-10 17:58:27 +0000 | [diff] [blame] | 78 | RANLIB= @RANLIB@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 79 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 80 | # Machine-dependent subdirectories |
| 81 | MACHDEP= @MACHDEP@ |
| 82 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 83 | # Install prefix for architecture-independent files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 84 | prefix= @prefix@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 85 | |
| 86 | # Install prefix for architecture-dependent files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 87 | exec_prefix= @exec_prefix@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 88 | |
Guido van Rossum | 9041279 | 1994-10-20 22:04:30 +0000 | [diff] [blame] | 89 | # Expanded directories |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 90 | BINDIR= $(exec_prefix)/bin |
| 91 | LIBDIR= $(exec_prefix)/lib |
| 92 | MANDIR= $(prefix)/man |
| 93 | INCLUDEDIR= $(prefix)/include |
| 94 | SCRIPTDIR= $(prefix)/lib |
Guido van Rossum | 9041279 | 1994-10-20 22:04:30 +0000 | [diff] [blame] | 95 | |
Guido van Rossum | bed23fe | 1996-07-31 17:30:37 +0000 | [diff] [blame] | 96 | # Detailed destination directories |
| 97 | BINLIBDEST= $(LIBDIR)/python$(VERSION) |
| 98 | LIBDEST= $(SCRIPTDIR)/python$(VERSION) |
| 99 | INCLUDEPY= $(INCLUDEDIR)/python$(VERSION) |
| 100 | LIBP= $(LIBDIR)/python$(VERSION) |
| 101 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 102 | # Symbols used for using shared libraries |
| 103 | SO= @SO@ |
| 104 | LDSHARED= @LDSHARED@ |
| 105 | CCSHARED= @CCSHARED@ |
| 106 | LINKFORSHARED= @LINKFORSHARED@ |
Guido van Rossum | bed23fe | 1996-07-31 17:30:37 +0000 | [diff] [blame] | 107 | DESTSHARED= $(BINLIBDEST)/sharedmodules |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 108 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 109 | # 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] | 110 | SHELL= /bin/sh |
| 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 | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 114 | INSTALL_PROGRAM=${INSTALL} -m 755 |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 115 | INSTALL_DATA= ${INSTALL} -m 644 |
| 116 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 117 | # --with-PACKAGE options for configure script |
| 118 | # e.g. --with-readline --with-svr5 --with-solaris --with-thread |
| 119 | # (see README for an explanation) |
| 120 | WITH= |
| 121 | |
| 122 | # Compiler options passed to subordinate makes |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 123 | OPT= @OPT@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 124 | |
| 125 | # Subdirectories where to run make recursively |
| 126 | SUBDIRS= Parser Objects Python Modules |
| 127 | |
| 128 | # Other subdirectories |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 129 | SUBDIRSTOO= Include Lib Doc Misc Demo Grammar |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 130 | |
| 131 | # Files and directories to be distributed |
| 132 | CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.in |
| 133 | DISTFILES= README ChangeLog $(CONFIGFILES) |
| 134 | DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy |
| 135 | DIST= $(DISTFILES) $(DISTDIRS) |
| 136 | |
| 137 | # Default target |
| 138 | all: python |
| 139 | |
| 140 | # Build the interpreter |
| 141 | python: Makefiles |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 142 | @for i in $(SUBDIRS); do \ |
| 143 | (echo Making in subdirectory $$i; cd $$i; \ |
Guido van Rossum | 6d47d0d | 1995-08-07 21:58:40 +0000 | [diff] [blame] | 144 | $(MAKE) OPT="$(OPT)" \ |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 145 | VERSION="$(VERSION)" \ |
Guido van Rossum | 6d47d0d | 1995-08-07 21:58:40 +0000 | [diff] [blame] | 146 | prefix="$(prefix)" \ |
| 147 | exec_prefix="$(exec_prefix)" \ |
| 148 | all); \ |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 149 | done |
| 150 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 151 | # Test the interpreter (twice, once without .pyc files, once with) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 152 | TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/test:./Modules |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 153 | test: python |
| 154 | -rm -f $(srcdir)/Lib/test/*.pyc |
| 155 | PYTHONPATH=$(TESTPATH) ./python -c 'import autotest' |
| 156 | PYTHONPATH=$(TESTPATH) ./python -c 'import autotest' |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 157 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 158 | # Install everything |
Guido van Rossum | 6d47298 | 1996-07-30 21:41:56 +0000 | [diff] [blame] | 159 | install: altinstall bininstall maninstall |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 160 | |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 161 | # Install almost everything without disturbing previous versions |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 162 | altinstall: altbininstall libinstall inclinstall libainstall sharedinstall |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 163 | |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 164 | # Install the interpreter (by creating a hard link to python$(VERSION)) |
| 165 | bininstall: altbininstall |
| 166 | -if test -f $(BINDIR)/python; \ |
| 167 | then rm -f $(BINDIR)/python; \ |
| 168 | else true; \ |
| 169 | fi |
| 170 | (cd $(BINDIR); ln python$(VERSION) python) |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 171 | |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 172 | # Install the interpreter with $(VERSION) affixed |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 173 | # This goes into $(exec_prefix) |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 174 | altbininstall: python |
| 175 | @for i in $(BINDIR); \ |
| 176 | do \ |
| 177 | if test ! -d $$i; then \ |
| 178 | echo "Creating directory $$i"; \ |
| 179 | mkdir $$i; \ |
| 180 | chmod 755 $$i; \ |
| 181 | else true; \ |
| 182 | fi; \ |
| 183 | done |
| 184 | $(INSTALL_PROGRAM) python $(BINDIR)/python$(VERSION) |
| 185 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 186 | # Install the manual page |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 187 | maninstall: |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 188 | @for i in $(MANDIR) $(MANDIR)/man1; \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 189 | do \ |
| 190 | if test ! -d $$i; then \ |
| 191 | echo "Creating directory $$i"; \ |
| 192 | mkdir $$i; \ |
| 193 | chmod 755 $$i; \ |
| 194 | else true; \ |
| 195 | fi; \ |
| 196 | done |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 197 | $(INSTALL_DATA) $(srcdir)/Misc/python.man \ |
Guido van Rossum | 9041279 | 1994-10-20 22:04:30 +0000 | [diff] [blame] | 198 | $(MANDIR)/man1/python.1 |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 199 | |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 200 | # Install the library |
Guido van Rossum | b8dccd2 | 1996-07-30 21:55:17 +0000 | [diff] [blame] | 201 | MACHDEPS= $(MACHDEP) |
| 202 | LIBSUBDIRS= stdwin tkinter test $(MACHDEPS) |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 203 | libinstall: python $(srcdir)/Lib/$(MACHDEP) |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 204 | @for i in $(SCRIPTDIR) $(LIBDEST); \ |
| 205 | do \ |
| 206 | if test ! -d $$i; then \ |
| 207 | echo "Creating directory $$i"; \ |
| 208 | mkdir $$i; \ |
| 209 | chmod 755 $$i; \ |
| 210 | else true; \ |
| 211 | fi; \ |
| 212 | done |
| 213 | @for d in $(LIBSUBDIRS); \ |
| 214 | do \ |
| 215 | a=$(srcdir)/Lib/$$d; \ |
| 216 | if test ! -d $$a; then continue; else true; fi; \ |
| 217 | b=$(LIBDEST)/$$d; \ |
| 218 | if test ! -d $$b; then \ |
| 219 | echo "Creating directory $$b"; \ |
| 220 | mkdir $$b; \ |
| 221 | chmod 755 $$b; \ |
| 222 | else true; \ |
| 223 | fi; \ |
| 224 | done |
| 225 | @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \ |
| 226 | do \ |
| 227 | if test -x $$i; then \ |
| 228 | $(INSTALL_PROGRAM) $$i $(LIBDEST); \ |
| 229 | echo $(INSTALL_PROGRAM) $$i $(LIBDEST); \ |
| 230 | else \ |
| 231 | $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 232 | echo $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 233 | fi; \ |
| 234 | done |
| 235 | @for d in $(LIBSUBDIRS); \ |
| 236 | do \ |
| 237 | a=$(srcdir)/Lib/$$d; \ |
| 238 | if test ! -d $$a; then continue; else true; fi; \ |
| 239 | b=$(LIBDEST)/$$d; \ |
| 240 | for i in $$a/*; \ |
| 241 | do \ |
| 242 | case $$i in \ |
| 243 | *CVS) ;; \ |
| 244 | *.pyc) ;; \ |
| 245 | *~) ;; \ |
| 246 | *) \ |
| 247 | if test -x $$i; then \ |
| 248 | echo $(INSTALL_PROGRAM) $$i $$b; \ |
| 249 | $(INSTALL_PROGRAM) $$i $$b; \ |
| 250 | else \ |
| 251 | echo $(INSTALL_DATA) $$i $$b; \ |
| 252 | $(INSTALL_DATA) $$i $$b; \ |
| 253 | fi;; \ |
| 254 | esac; \ |
| 255 | done; \ |
| 256 | done |
| 257 | PYTHONPATH=$(LIBDEST) \ |
| 258 | ./python $(LIBDEST)/compileall.py $(LIBDEST) |
| 259 | |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 260 | # Create the MACHDEP source directory, if one wasn't distributed.. |
Guido van Rossum | cda848f | 1996-08-21 20:18:29 +0000 | [diff] [blame^] | 261 | $(srcdir)/Lib/$(MACHDEP): |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 262 | mkdir $(srcdir)/Lib/$(MACHDEP) |
| 263 | cp $(srcdir)/Lib/generic/regen $(srcdir)/Lib/$(MACHDEP)/regen |
Guido van Rossum | fc8ebb1 | 1996-08-19 21:51:24 +0000 | [diff] [blame] | 264 | export PATH; PATH="`pwd`:$PATH"; \ |
| 265 | cd $(srcdir)/Lib/$(MACHDEP); ./regen |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 266 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 267 | # Install the include files |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 268 | inclinstall: |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 269 | @for i in $(INCLUDEDIR) $(INCLUDEPY); \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 270 | do \ |
| 271 | if test ! -d $$i; then \ |
| 272 | echo "Creating directory $$i"; \ |
| 273 | mkdir $$i; \ |
| 274 | chmod 755 $$i; \ |
| 275 | else true; \ |
| 276 | fi; \ |
| 277 | done |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 278 | @for i in $(srcdir)/Include/*.h; \ |
| 279 | do \ |
| 280 | echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 281 | $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 282 | done |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 283 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 284 | # Install the lib*.a files and miscellaneous stuff needed by extensions |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 285 | # This goes into $(exec_prefix) |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 286 | LIBPL= $(LIBP)/config |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 287 | libainstall: all |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 288 | @for i in $(LIBDIR) $(LIBP) $(LIBPL); \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 289 | do \ |
| 290 | if test ! -d $$i; then \ |
| 291 | echo "Creating directory $$i"; \ |
| 292 | mkdir $$i; \ |
| 293 | chmod 755 $$i; \ |
| 294 | else true; \ |
| 295 | fi; \ |
| 296 | done |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 297 | @for i in $(SUBDIRS); do \ |
| 298 | echo Installing in subdirectory $$i; \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 299 | $(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \ |
Guido van Rossum | 4a91df4 | 1994-10-10 17:58:27 +0000 | [diff] [blame] | 300 | $(RANLIB) $(LIBPL)/lib$$i.a; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 301 | done |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 302 | $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c |
Guido van Rossum | 6d47d0d | 1995-08-07 21:58:40 +0000 | [diff] [blame] | 303 | $(INSTALL_DATA) $(srcdir)/Modules/getpath.c $(LIBPL)/getpath.c |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 304 | $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in |
| 305 | $(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile |
| 306 | $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup |
Guido van Rossum | 70a8659 | 1996-07-21 02:46:47 +0000 | [diff] [blame] | 307 | $(INSTALL_PROGRAM) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 308 | $(INSTALL_DATA) config.h $(LIBPL)/config.h |
| 309 | $(INSTALL_DATA) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c |
Sjoerd Mullender | ad5d2cf | 1995-08-09 09:18:20 +0000 | [diff] [blame] | 310 | $(INSTALL_DATA) Modules/main.o $(LIBPL)/main.o |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 311 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 312 | # Install the dynamically loadable modules |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 313 | # This goes into $(exec_prefix) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 314 | sharedinstall: |
| 315 | cd Modules; $(MAKE) \ |
| 316 | OPT="$(OPT)" \ |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 317 | VERSION="$(VERSION)" \ |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 318 | SO="$(SO)" \ |
| 319 | LDSHARED="$(LDSHARED)" \ |
| 320 | CCSHARED="$(CCSHARED)" \ |
| 321 | LINKFORSHARED="$(LINKFORSHARED)" \ |
| 322 | DESTSHARED="$(DESTSHARED)" \ |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 323 | prefix="$(prefix)" \ |
| 324 | exec_prefix="$(exec_prefix)" \ |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 325 | sharedinstall |
| 326 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 327 | # Build the sub-Makefiles |
Guido van Rossum | d09119e | 1995-01-17 16:45:08 +0000 | [diff] [blame] | 328 | Makefiles: config.status Modules/Makefile.pre |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 329 | (cd Modules; $(MAKE) -f Makefile.pre Makefile) |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 330 | @for i in . $(SUBDIRS); do \ |
| 331 | (echo making Makefile in subdirectory $$i; cd $$i; \ |
| 332 | $(MAKE) Makefile); \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 333 | done |
| 334 | |
Guido van Rossum | d09119e | 1995-01-17 16:45:08 +0000 | [diff] [blame] | 335 | # Build the intermediate Makefile in Modules |
| 336 | Modules/Makefile.pre: config.status |
| 337 | $(SHELL) config.status |
| 338 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 339 | # Build the toplevel Makefile |
| 340 | Makefile: Makefile.in config.status |
| 341 | CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status |
| 342 | |
| 343 | # Run the configure script. If config.status already exists, |
| 344 | # call it with the --recheck argument, which reruns configure with the |
| 345 | # same options as it was run last time; otherwise run the configure |
| 346 | # script with options taken from the $(WITH) variable |
| 347 | config.status: $(srcdir)/configure |
| 348 | if test -f config.status; \ |
| 349 | then $(SHELL) config.status --recheck; \ |
Guido van Rossum | fb00a99 | 1995-01-12 12:26:50 +0000 | [diff] [blame] | 350 | $(SHELL) config.status; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 351 | else $(SHELL) $(srcdir)/configure $(WITH); \ |
| 352 | fi |
| 353 | |
| 354 | .PRECIOUS: config.status python |
| 355 | |
| 356 | # Rerun configure with the same options as it was run last time, |
| 357 | # provided the config.status script exists |
| 358 | recheck: |
| 359 | $(SHELL) config.status --recheck |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 360 | $(SHELL) config.status |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 361 | |
| 362 | # Rebuild the configure script from configure.in; also rebuild config.h.in |
| 363 | autoconf: |
Guido van Rossum | 0068267 | 1996-06-28 20:15:41 +0000 | [diff] [blame] | 364 | (cd $(srcdir); autoconf) |
| 365 | (cd $(srcdir); autoheader) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 366 | |
| 367 | # Create a tags file for vi |
| 368 | tags:: |
| 369 | ctags -w -t Include/*.h |
| 370 | for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done |
| 371 | sort tags -o tags |
| 372 | |
| 373 | # Create a tags file for GNU Emacs |
| 374 | TAGS:: |
Guido van Rossum | 5552eb7 | 1994-08-05 15:51:00 +0000 | [diff] [blame] | 375 | etags Include/*.h |
| 376 | for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 377 | |
| 378 | # Add dependencies to sub-Makefiles |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 379 | depend: |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 380 | @for i in $(SUBDIRS); do \ |
| 381 | (echo making depend in subdirectory $$i; cd $$i; \ |
| 382 | $(MAKE) depend); \ |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 383 | done |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 384 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 385 | # Sanitation targets -- clean leaves libraries, executables and tags |
| 386 | # files, which clobber removes those as well |
| 387 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 388 | localclean: |
| 389 | -rm -f core *~ [@,#]* *.old *.orig *.rej |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 390 | |
| 391 | clean: localclean |
| 392 | -for i in $(SUBDIRS); do \ |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 393 | (echo making clean in subdirectory $$i; cd $$i; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 394 | if test -f Makefile; \ |
| 395 | then $(MAKE) clean; \ |
| 396 | else $(MAKE) -f Makefile.*in clean; \ |
| 397 | fi); \ |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 398 | done |
| 399 | |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 400 | localclobber: localclean |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 401 | -rm -f tags TAGS python |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 402 | -rm -f config.log config.cache config.h |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 403 | |
| 404 | clobber: localclobber |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 405 | -for i in $(SUBDIRS); do \ |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 406 | (echo clobbering subdirectory $$i; cd $$i; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 407 | if test -f Makefile; \ |
| 408 | then $(MAKE) clobber; \ |
Guido van Rossum | 7b4d460 | 1995-03-22 12:27:16 +0000 | [diff] [blame] | 409 | else $(MAKE) -f $(srcdir)/Makefile.in clobber; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 410 | fi); \ |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 411 | done |
| 412 | |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 413 | # Make things extra clean, before making a distribution: |
| 414 | # remove all generated files, even Makefile[.pre] |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 415 | distclean: clobber |
Guido van Rossum | 7b4d460 | 1995-03-22 12:27:16 +0000 | [diff] [blame] | 416 | -$(MAKE) -f $(srcdir)/Makefile.in \ |
| 417 | SUBDIRS="$(SUBDIRSTOO)" clobber |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 418 | -rm -f config.status config.log config.cache config.h Makefile |
Guido van Rossum | e7abf4e | 1995-09-18 22:12:20 +0000 | [diff] [blame] | 419 | -rm -f Modules/Makefile |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 420 | -for i in $(SUBDIRS) $(SUBDIRSTOO); do \ |
| 421 | for f in $$i/*.in; do \ |
| 422 | f=`basename "$$f" .in`; \ |
| 423 | if test "$$f" != "*"; then \ |
| 424 | echo rm -f "$$i/$$f"; \ |
| 425 | rm -f "$$i/$$f"; \ |
| 426 | fi; \ |
| 427 | done; \ |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 428 | done |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 429 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 430 | # Check for smelly exported symbols (not starting with Py/_Py) |
| 431 | smelly: all |
| 432 | for i in $(SUBDIRS); do \ |
| 433 | echo --- $$i ---; \ |
| 434 | nm -p $$i/lib$$i.a | \ |
| 435 | sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ |
| 436 | done |
| 437 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 438 | # Find files with funny names |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 439 | funny: |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 440 | find $(DISTDIRS) -type d \ |
| 441 | -o -name '*.[chs]' \ |
| 442 | -o -name '*.py' \ |
| 443 | -o -name '*.doc' \ |
| 444 | -o -name '*.sty' \ |
| 445 | -o -name '*.bib' \ |
| 446 | -o -name '*.dat' \ |
| 447 | -o -name '*.el' \ |
| 448 | -o -name '*.fd' \ |
| 449 | -o -name '*.in' \ |
| 450 | -o -name '*.tex' \ |
| 451 | -o -name '*,[vpt]' \ |
| 452 | -o -name 'Setup' \ |
| 453 | -o -name 'Setup.*' \ |
| 454 | -o -name README \ |
| 455 | -o -name Makefile \ |
| 456 | -o -name ChangeLog \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 457 | -o -name Repository \ |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 458 | -o -name Root \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 459 | -o -name Entries \ |
| 460 | -o -name Tag \ |
| 461 | -o -name tags \ |
| 462 | -o -name TAGS \ |
| 463 | -o -name .cvsignore \ |
| 464 | -o -name MANIFEST \ |
| 465 | -o -print |