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