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