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 | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 79 | # Interpreter version number, for library destination pathnames |
Guido van Rossum | f631d13 | 1997-01-22 03:45:38 +0000 | [diff] [blame] | 80 | VERSION= 1.5 |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 81 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 82 | # Substitutions by configure |
| 83 | srcdir= @srcdir@ |
| 84 | VPATH= @srcdir@ |
Guido van Rossum | 4a91df4 | 1994-10-10 17:58:27 +0000 | [diff] [blame] | 85 | RANLIB= @RANLIB@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 86 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 87 | # Machine-dependent subdirectories |
| 88 | MACHDEP= @MACHDEP@ |
| 89 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 90 | # Install prefix for architecture-independent files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 91 | prefix= @prefix@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 92 | |
| 93 | # Install prefix for architecture-dependent files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 94 | exec_prefix= @exec_prefix@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 95 | |
Guido van Rossum | 9041279 | 1994-10-20 22:04:30 +0000 | [diff] [blame] | 96 | # Expanded directories |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 97 | BINDIR= $(exec_prefix)/bin |
| 98 | LIBDIR= $(exec_prefix)/lib |
| 99 | MANDIR= $(prefix)/man |
| 100 | INCLUDEDIR= $(prefix)/include |
| 101 | SCRIPTDIR= $(prefix)/lib |
Guido van Rossum | 9041279 | 1994-10-20 22:04:30 +0000 | [diff] [blame] | 102 | |
Guido van Rossum | bed23fe | 1996-07-31 17:30:37 +0000 | [diff] [blame] | 103 | # Detailed destination directories |
| 104 | BINLIBDEST= $(LIBDIR)/python$(VERSION) |
| 105 | LIBDEST= $(SCRIPTDIR)/python$(VERSION) |
| 106 | INCLUDEPY= $(INCLUDEDIR)/python$(VERSION) |
| 107 | LIBP= $(LIBDIR)/python$(VERSION) |
| 108 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 109 | # Symbols used for using shared libraries |
| 110 | SO= @SO@ |
| 111 | LDSHARED= @LDSHARED@ |
| 112 | CCSHARED= @CCSHARED@ |
| 113 | LINKFORSHARED= @LINKFORSHARED@ |
Guido van Rossum | bed23fe | 1996-07-31 17:30:37 +0000 | [diff] [blame] | 114 | DESTSHARED= $(BINLIBDEST)/sharedmodules |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 115 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 116 | # 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] | 117 | SHELL= /bin/sh |
| 118 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 119 | # Portable install script (configure doesn't always guess right) |
| 120 | INSTALL= @srcdir@/install-sh -c |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 121 | INSTALL_PROGRAM=${INSTALL} -m 755 |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 122 | INSTALL_DATA= ${INSTALL} -m 644 |
| 123 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 124 | # --with-PACKAGE options for configure script |
| 125 | # e.g. --with-readline --with-svr5 --with-solaris --with-thread |
| 126 | # (see README for an explanation) |
| 127 | WITH= |
| 128 | |
| 129 | # Compiler options passed to subordinate makes |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 130 | OPT= @OPT@ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 131 | |
| 132 | # Subdirectories where to run make recursively |
| 133 | SUBDIRS= Parser Objects Python Modules |
| 134 | |
| 135 | # Other subdirectories |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 136 | SUBDIRSTOO= Include Lib Doc Misc Demo Grammar |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 137 | |
| 138 | # Files and directories to be distributed |
| 139 | CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.in |
| 140 | DISTFILES= README ChangeLog $(CONFIGFILES) |
| 141 | DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy |
| 142 | DIST= $(DISTFILES) $(DISTDIRS) |
| 143 | |
| 144 | # Default target |
| 145 | all: python |
| 146 | |
| 147 | # Build the interpreter |
| 148 | python: Makefiles |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 149 | @for i in $(SUBDIRS); do \ |
| 150 | (echo Making in subdirectory $$i; cd $$i; \ |
Guido van Rossum | 6d47d0d | 1995-08-07 21:58:40 +0000 | [diff] [blame] | 151 | $(MAKE) OPT="$(OPT)" \ |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 152 | VERSION="$(VERSION)" \ |
Guido van Rossum | 6d47d0d | 1995-08-07 21:58:40 +0000 | [diff] [blame] | 153 | prefix="$(prefix)" \ |
| 154 | exec_prefix="$(exec_prefix)" \ |
| 155 | all); \ |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 156 | done |
| 157 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 158 | # Test the interpreter (twice, once without .pyc files, once with) |
Guido van Rossum | fde462e | 1997-01-11 19:59:17 +0000 | [diff] [blame] | 159 | TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/$(MACHDEP):$(srcdir)/Lib/test:./Modules |
Barry Warsaw | 9121ab9 | 1997-01-02 20:01:44 +0000 | [diff] [blame] | 160 | TESTOPTS= |
Guido van Rossum | 042a051 | 1997-01-03 15:54:36 +0000 | [diff] [blame] | 161 | TESTPROG= $(srcdir)/Lib/test/regrtest.py |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 162 | test: python |
| 163 | -rm -f $(srcdir)/Lib/test/*.pyc |
Barry Warsaw | 9121ab9 | 1997-01-02 20:01:44 +0000 | [diff] [blame] | 164 | PYTHONPATH=$(TESTPATH) ./python $(TESTPROG) $(TESTOPTS) |
| 165 | PYTHONPATH=$(TESTPATH) ./python $(TESTPROG) $(TESTOPTS) |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 166 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 167 | # Install everything |
Guido van Rossum | 6d47298 | 1996-07-30 21:41:56 +0000 | [diff] [blame] | 168 | install: altinstall bininstall maninstall |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 169 | |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 170 | # Install almost everything without disturbing previous versions |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 171 | altinstall: altbininstall libinstall inclinstall libainstall sharedinstall |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 172 | |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 173 | # Install the interpreter (by creating a hard link to python$(VERSION)) |
| 174 | bininstall: altbininstall |
| 175 | -if test -f $(BINDIR)/python; \ |
| 176 | then rm -f $(BINDIR)/python; \ |
| 177 | else true; \ |
| 178 | fi |
| 179 | (cd $(BINDIR); ln python$(VERSION) python) |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 180 | |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 181 | # Install the interpreter with $(VERSION) affixed |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 182 | # This goes into $(exec_prefix) |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 183 | altbininstall: python |
| 184 | @for i in $(BINDIR); \ |
| 185 | do \ |
| 186 | if test ! -d $$i; then \ |
| 187 | echo "Creating directory $$i"; \ |
| 188 | mkdir $$i; \ |
| 189 | chmod 755 $$i; \ |
| 190 | else true; \ |
| 191 | fi; \ |
| 192 | done |
| 193 | $(INSTALL_PROGRAM) python $(BINDIR)/python$(VERSION) |
| 194 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 195 | # Install the manual page |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 196 | maninstall: |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 197 | @for i in $(MANDIR) $(MANDIR)/man1; \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 198 | do \ |
| 199 | if test ! -d $$i; then \ |
| 200 | echo "Creating directory $$i"; \ |
| 201 | mkdir $$i; \ |
| 202 | chmod 755 $$i; \ |
| 203 | else true; \ |
| 204 | fi; \ |
| 205 | done |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 206 | $(INSTALL_DATA) $(srcdir)/Misc/python.man \ |
Guido van Rossum | 9041279 | 1994-10-20 22:04:30 +0000 | [diff] [blame] | 207 | $(MANDIR)/man1/python.1 |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 208 | |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 209 | # Install the library |
Guido van Rossum | b8dccd2 | 1996-07-30 21:55:17 +0000 | [diff] [blame] | 210 | MACHDEPS= $(MACHDEP) |
| 211 | LIBSUBDIRS= stdwin tkinter test $(MACHDEPS) |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 212 | libinstall: python $(srcdir)/Lib/$(MACHDEP) |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 213 | @for i in $(SCRIPTDIR) $(LIBDEST); \ |
| 214 | do \ |
| 215 | if test ! -d $$i; then \ |
| 216 | echo "Creating directory $$i"; \ |
| 217 | mkdir $$i; \ |
| 218 | chmod 755 $$i; \ |
| 219 | else true; \ |
| 220 | fi; \ |
| 221 | done |
| 222 | @for d in $(LIBSUBDIRS); \ |
| 223 | do \ |
| 224 | a=$(srcdir)/Lib/$$d; \ |
| 225 | if test ! -d $$a; then continue; else true; fi; \ |
| 226 | b=$(LIBDEST)/$$d; \ |
| 227 | if test ! -d $$b; then \ |
| 228 | echo "Creating directory $$b"; \ |
| 229 | mkdir $$b; \ |
| 230 | chmod 755 $$b; \ |
| 231 | else true; \ |
| 232 | fi; \ |
| 233 | done |
| 234 | @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \ |
| 235 | do \ |
| 236 | if test -x $$i; then \ |
| 237 | $(INSTALL_PROGRAM) $$i $(LIBDEST); \ |
| 238 | echo $(INSTALL_PROGRAM) $$i $(LIBDEST); \ |
| 239 | else \ |
| 240 | $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 241 | echo $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 242 | fi; \ |
| 243 | done |
| 244 | @for d in $(LIBSUBDIRS); \ |
| 245 | do \ |
| 246 | a=$(srcdir)/Lib/$$d; \ |
| 247 | if test ! -d $$a; then continue; else true; fi; \ |
| 248 | b=$(LIBDEST)/$$d; \ |
| 249 | for i in $$a/*; \ |
| 250 | do \ |
| 251 | case $$i in \ |
| 252 | *CVS) ;; \ |
| 253 | *.pyc) ;; \ |
| 254 | *~) ;; \ |
| 255 | *) \ |
| 256 | if test -x $$i; then \ |
| 257 | echo $(INSTALL_PROGRAM) $$i $$b; \ |
| 258 | $(INSTALL_PROGRAM) $$i $$b; \ |
| 259 | else \ |
| 260 | echo $(INSTALL_DATA) $$i $$b; \ |
| 261 | $(INSTALL_DATA) $$i $$b; \ |
| 262 | fi;; \ |
| 263 | esac; \ |
| 264 | done; \ |
| 265 | done |
| 266 | PYTHONPATH=$(LIBDEST) \ |
| 267 | ./python $(LIBDEST)/compileall.py $(LIBDEST) |
Fred Drake | db5a41f | 1997-03-13 14:14:29 +0000 | [diff] [blame] | 268 | PYTHONPATH=$(LIBDEST) \ |
| 269 | ./python -O $(LIBDEST)/compileall.py $(LIBDEST) |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 270 | |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 271 | # Create the MACHDEP source directory, if one wasn't distributed.. |
Guido van Rossum | cda848f | 1996-08-21 20:18:29 +0000 | [diff] [blame] | 272 | $(srcdir)/Lib/$(MACHDEP): |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 273 | mkdir $(srcdir)/Lib/$(MACHDEP) |
| 274 | cp $(srcdir)/Lib/generic/regen $(srcdir)/Lib/$(MACHDEP)/regen |
Guido van Rossum | 04831d1 | 1996-09-10 18:21:32 +0000 | [diff] [blame] | 275 | export PATH; PATH="`pwd`:$$PATH"; \ |
Guido van Rossum | f71bd68 | 1996-08-28 19:23:01 +0000 | [diff] [blame] | 276 | export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ |
Guido van Rossum | fc8ebb1 | 1996-08-19 21:51:24 +0000 | [diff] [blame] | 277 | cd $(srcdir)/Lib/$(MACHDEP); ./regen |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 278 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 279 | # Install the include files |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 280 | inclinstall: |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 281 | @for i in $(INCLUDEDIR) $(INCLUDEPY); \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 282 | do \ |
| 283 | if test ! -d $$i; then \ |
| 284 | echo "Creating directory $$i"; \ |
| 285 | mkdir $$i; \ |
| 286 | chmod 755 $$i; \ |
| 287 | else true; \ |
| 288 | fi; \ |
| 289 | done |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 290 | @for i in $(srcdir)/Include/*.h; \ |
| 291 | do \ |
| 292 | echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 293 | $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 294 | done |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 295 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 296 | # Install the lib*.a files and miscellaneous stuff needed by extensions |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 297 | # This goes into $(exec_prefix) |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 298 | LIBPL= $(LIBP)/config |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 299 | libainstall: all |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 300 | @for i in $(LIBDIR) $(LIBP) $(LIBPL); \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 301 | do \ |
| 302 | if test ! -d $$i; then \ |
| 303 | echo "Creating directory $$i"; \ |
| 304 | mkdir $$i; \ |
| 305 | chmod 755 $$i; \ |
| 306 | else true; \ |
| 307 | fi; \ |
| 308 | done |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 309 | @for i in $(SUBDIRS); do \ |
| 310 | echo Installing in subdirectory $$i; \ |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 311 | $(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \ |
Guido van Rossum | 4a91df4 | 1994-10-10 17:58:27 +0000 | [diff] [blame] | 312 | $(RANLIB) $(LIBPL)/lib$$i.a; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 313 | done |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 314 | $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c |
Guido van Rossum | 6d47d0d | 1995-08-07 21:58:40 +0000 | [diff] [blame] | 315 | $(INSTALL_DATA) $(srcdir)/Modules/getpath.c $(LIBPL)/getpath.c |
Guido van Rossum | 5ad7aaf | 1997-04-11 15:25:08 +0000 | [diff] [blame^] | 316 | $(INSTALL_DATA) $(srcdir)/Modules/getbuildinfo.c $(LIBPL)/getbuildinfo.c |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 317 | $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in |
| 318 | $(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile |
| 319 | $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup |
Guido van Rossum | 70a8659 | 1996-07-21 02:46:47 +0000 | [diff] [blame] | 320 | $(INSTALL_PROGRAM) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup |
Guido van Rossum | 6403d28 | 1995-01-20 16:51:32 +0000 | [diff] [blame] | 321 | $(INSTALL_DATA) config.h $(LIBPL)/config.h |
| 322 | $(INSTALL_DATA) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c |
Sjoerd Mullender | ad5d2cf | 1995-08-09 09:18:20 +0000 | [diff] [blame] | 323 | $(INSTALL_DATA) Modules/main.o $(LIBPL)/main.o |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 324 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 325 | # Install the dynamically loadable modules |
Guido van Rossum | 64b6567 | 1996-07-30 20:42:12 +0000 | [diff] [blame] | 326 | # This goes into $(exec_prefix) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 327 | sharedinstall: |
| 328 | cd Modules; $(MAKE) \ |
| 329 | OPT="$(OPT)" \ |
Guido van Rossum | b535da3 | 1996-07-30 18:04:22 +0000 | [diff] [blame] | 330 | VERSION="$(VERSION)" \ |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 331 | SO="$(SO)" \ |
| 332 | LDSHARED="$(LDSHARED)" \ |
| 333 | CCSHARED="$(CCSHARED)" \ |
| 334 | LINKFORSHARED="$(LINKFORSHARED)" \ |
| 335 | DESTSHARED="$(DESTSHARED)" \ |
Guido van Rossum | 3912fd8 | 1996-07-24 02:35:43 +0000 | [diff] [blame] | 336 | prefix="$(prefix)" \ |
| 337 | exec_prefix="$(exec_prefix)" \ |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 338 | sharedinstall |
| 339 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 340 | # Build the sub-Makefiles |
Guido van Rossum | d09119e | 1995-01-17 16:45:08 +0000 | [diff] [blame] | 341 | Makefiles: config.status Modules/Makefile.pre |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 342 | (cd Modules; $(MAKE) -f Makefile.pre Makefile) |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 343 | @for i in . $(SUBDIRS); do \ |
| 344 | (echo making Makefile in subdirectory $$i; cd $$i; \ |
| 345 | $(MAKE) Makefile); \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 346 | done |
| 347 | |
Guido van Rossum | d09119e | 1995-01-17 16:45:08 +0000 | [diff] [blame] | 348 | # Build the intermediate Makefile in Modules |
| 349 | Modules/Makefile.pre: config.status |
| 350 | $(SHELL) config.status |
| 351 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 352 | # Build the toplevel Makefile |
| 353 | Makefile: Makefile.in config.status |
| 354 | CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status |
| 355 | |
| 356 | # Run the configure script. If config.status already exists, |
| 357 | # call it with the --recheck argument, which reruns configure with the |
| 358 | # same options as it was run last time; otherwise run the configure |
| 359 | # script with options taken from the $(WITH) variable |
| 360 | config.status: $(srcdir)/configure |
| 361 | if test -f config.status; \ |
| 362 | then $(SHELL) config.status --recheck; \ |
Guido van Rossum | fb00a99 | 1995-01-12 12:26:50 +0000 | [diff] [blame] | 363 | $(SHELL) config.status; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 364 | else $(SHELL) $(srcdir)/configure $(WITH); \ |
| 365 | fi |
| 366 | |
| 367 | .PRECIOUS: config.status python |
| 368 | |
| 369 | # Rerun configure with the same options as it was run last time, |
| 370 | # provided the config.status script exists |
| 371 | recheck: |
| 372 | $(SHELL) config.status --recheck |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 373 | $(SHELL) config.status |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 374 | |
| 375 | # Rebuild the configure script from configure.in; also rebuild config.h.in |
| 376 | autoconf: |
Guido van Rossum | 0068267 | 1996-06-28 20:15:41 +0000 | [diff] [blame] | 377 | (cd $(srcdir); autoconf) |
| 378 | (cd $(srcdir); autoheader) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 379 | |
| 380 | # Create a tags file for vi |
| 381 | tags:: |
| 382 | ctags -w -t Include/*.h |
| 383 | for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done |
| 384 | sort tags -o tags |
| 385 | |
| 386 | # Create a tags file for GNU Emacs |
| 387 | TAGS:: |
Guido van Rossum | 5552eb7 | 1994-08-05 15:51:00 +0000 | [diff] [blame] | 388 | etags Include/*.h |
| 389 | for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 390 | |
| 391 | # Add dependencies to sub-Makefiles |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 392 | depend: |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 393 | @for i in $(SUBDIRS); do \ |
| 394 | (echo making depend in subdirectory $$i; cd $$i; \ |
| 395 | $(MAKE) depend); \ |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 396 | done |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 397 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 398 | # Sanitation targets -- clean leaves libraries, executables and tags |
| 399 | # files, which clobber removes those as well |
| 400 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 401 | localclean: |
| 402 | -rm -f core *~ [@,#]* *.old *.orig *.rej |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 403 | |
| 404 | clean: localclean |
| 405 | -for i in $(SUBDIRS); do \ |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 406 | (echo making clean in 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) clean; \ |
| 409 | else $(MAKE) -f Makefile.*in clean; \ |
| 410 | fi); \ |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 411 | done |
| 412 | |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 413 | localclobber: localclean |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 414 | -rm -f tags TAGS python |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 415 | -rm -f config.log config.cache config.h |
Guido van Rossum | 810a92f | 1993-12-28 19:39:56 +0000 | [diff] [blame] | 416 | |
| 417 | clobber: localclobber |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 418 | -for i in $(SUBDIRS); do \ |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 419 | (echo clobbering subdirectory $$i; cd $$i; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 420 | if test -f Makefile; \ |
| 421 | then $(MAKE) clobber; \ |
Guido van Rossum | 7b4d460 | 1995-03-22 12:27:16 +0000 | [diff] [blame] | 422 | else $(MAKE) -f $(srcdir)/Makefile.in clobber; \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 423 | fi); \ |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 424 | done |
| 425 | |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 426 | # Make things extra clean, before making a distribution: |
| 427 | # remove all generated files, even Makefile[.pre] |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 428 | distclean: clobber |
Guido van Rossum | 7b4d460 | 1995-03-22 12:27:16 +0000 | [diff] [blame] | 429 | -$(MAKE) -f $(srcdir)/Makefile.in \ |
| 430 | SUBDIRS="$(SUBDIRSTOO)" clobber |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 431 | -rm -f config.status config.log config.cache config.h Makefile |
Guido van Rossum | e7abf4e | 1995-09-18 22:12:20 +0000 | [diff] [blame] | 432 | -rm -f Modules/Makefile |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 433 | -for i in $(SUBDIRS) $(SUBDIRSTOO); do \ |
| 434 | for f in $$i/*.in; do \ |
| 435 | f=`basename "$$f" .in`; \ |
| 436 | if test "$$f" != "*"; then \ |
| 437 | echo rm -f "$$i/$$f"; \ |
| 438 | rm -f "$$i/$$f"; \ |
| 439 | fi; \ |
| 440 | done; \ |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 441 | done |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 442 | |
Guido van Rossum | 586480b | 1996-05-28 22:49:08 +0000 | [diff] [blame] | 443 | # Check for smelly exported symbols (not starting with Py/_Py) |
| 444 | smelly: all |
| 445 | for i in $(SUBDIRS); do \ |
| 446 | echo --- $$i ---; \ |
| 447 | nm -p $$i/lib$$i.a | \ |
| 448 | sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ |
| 449 | done |
| 450 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 451 | # Find files with funny names |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 452 | funny: |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 453 | find $(DISTDIRS) -type d \ |
| 454 | -o -name '*.[chs]' \ |
| 455 | -o -name '*.py' \ |
| 456 | -o -name '*.doc' \ |
| 457 | -o -name '*.sty' \ |
| 458 | -o -name '*.bib' \ |
| 459 | -o -name '*.dat' \ |
| 460 | -o -name '*.el' \ |
| 461 | -o -name '*.fd' \ |
| 462 | -o -name '*.in' \ |
| 463 | -o -name '*.tex' \ |
| 464 | -o -name '*,[vpt]' \ |
| 465 | -o -name 'Setup' \ |
| 466 | -o -name 'Setup.*' \ |
| 467 | -o -name README \ |
| 468 | -o -name Makefile \ |
| 469 | -o -name ChangeLog \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 470 | -o -name Repository \ |
Guido van Rossum | bfc1bbe | 1996-06-20 14:30:38 +0000 | [diff] [blame] | 471 | -o -name Root \ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 472 | -o -name Entries \ |
| 473 | -o -name Tag \ |
| 474 | -o -name tags \ |
| 475 | -o -name TAGS \ |
| 476 | -o -name .cvsignore \ |
| 477 | -o -name MANIFEST \ |
| 478 | -o -print |