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