blob: cb92728ca80a9f80a7144e9089336e245ea69206 [file] [log] [blame]
Guido van Rossum433c8ad1994-08-01 12:07:07 +00001########################################################################
Guido van Rossumaf5b83e1995-01-04 19:02:35 +00002# Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
3# The Netherlands.
4#
Guido van Rossum433c8ad1994-08-01 12:07:07 +00005# All Rights Reserved
Guido van Rossumaf5b83e1995-01-04 19:02:35 +00006#
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 Rossum433c8ad1994-08-01 12:07:07 +00009# provided that the above copyright notice appear in all copies and that
Guido van Rossumaf5b83e1995-01-04 19:02:35 +000010# both that copyright notice and this permission notice appear in
Guido van Rossum433c8ad1994-08-01 12:07:07 +000011# 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 Rossumaf5b83e1995-01-04 19:02:35 +000014#
Guido van Rossum433c8ad1994-08-01 12:07:07 +000015# 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 Rossum627b2d71993-12-24 10:39:16 +000023
Guido van Rossum586480b1996-05-28 22:49:08 +000024# Top-level Makefile for Python
25#
26# As distributed, this file is called Makefile.in; it is processed
27# into the real Makefile by running the script ./configure, which
28# replaces things like @spam@ with values appropriate for your system.
29# This means that if you edit Makefile, your changes get lost the next
30# time you run the configure script. Ideally, you can do:
31#
32# ./configure
33# make
34# make test
35# make install
36#
37# The top-level Makefile invokes make recursively in a number of
38# subdirectories (see the SUBDIRS variable below). If you want to,
39# you can invoke make in individual subdirectories. However, the
40# sub-Makefiles are also generated by configure, and the quickest way
41# to make sure they are up to date is by running make (or "make
42# Makefiles") at the top level. This is particularly important for
43# Modules/Makefile, which has to be regenerated every time you edit
44# Modules/Setup. The python executable is built in the Modules
45# directory and then moved to the top-level directory. The recursive
46# makes pass three options to subordinate makes: OPT (a quick way to
Guido van Rossumb535da31996-07-30 18:04:22 +000047# change some compiler options; it usually defaults to -O), prefix and
Guido van Rossum586480b1996-05-28 22:49:08 +000048# exec_prefix (the installation paths).
49#
Guido van Rossumb535da31996-07-30 18:04:22 +000050# If you have a previous version of Python installed that you don't
51# want to overwrite, you can use "make altinstall" instead of "make
52# install". This changes the install procedure so it installs the
53# Python binary as "python<version>". The libraries and include files
54# are always installed in a subdirectory called "python<version>".
55# "make altinstall" does not install the manual page. If you want to
56# make this installation the "official" installation but want to keep
57# the old binary around "just in case", rename the installed python
58# binary to "python<oldversion>" before running "make install".
59# (This only works between different versions, e.g. 1.3 and 1.4 --
60# different betas of the same version will overwrite each other in
61# installation unless you override the VERSION Make variable.)
62#
Guido van Rossum64b65671996-07-30 20:42:12 +000063# In fact, "make install" or "make bininstall" installs the binary
64# as python<version> and makes a hard link to python, so when
65# installing a new version in the future, nothing of the current
66# version will be lost (except for the man page).
67#
Guido van Rossum586480b1996-05-28 22:49:08 +000068# If recursive makes fail, try invoking make as "make MAKE=make".
69#
70# See also the section "Build instructions" in the README file.
Guido van Rossum627b2d71993-12-24 10:39:16 +000071
Guido van Rossum3912fd81996-07-24 02:35:43 +000072# Interpreter version number, for library destination pathnames
73VERSION= 1.4
74
Guido van Rossum433c8ad1994-08-01 12:07:07 +000075# Substitutions by configure
76srcdir= @srcdir@
77VPATH= @srcdir@
Guido van Rossum4a91df41994-10-10 17:58:27 +000078RANLIB= @RANLIB@
Guido van Rossum433c8ad1994-08-01 12:07:07 +000079
Guido van Rossumac405f61994-09-12 10:56:06 +000080# Machine-dependent subdirectories
81MACHDEP= @MACHDEP@
82
Guido van Rossum433c8ad1994-08-01 12:07:07 +000083# Install prefix for architecture-independent files
Guido van Rossum76be6ed1995-01-02 18:33:54 +000084prefix= @prefix@
Guido van Rossum433c8ad1994-08-01 12:07:07 +000085
86# Install prefix for architecture-dependent files
Guido van Rossum76be6ed1995-01-02 18:33:54 +000087exec_prefix= @exec_prefix@
Guido van Rossum433c8ad1994-08-01 12:07:07 +000088
Guido van Rossum90412791994-10-20 22:04:30 +000089# Expanded directories
Guido van Rossumb535da31996-07-30 18:04:22 +000090BINDIR= $(exec_prefix)/bin
91LIBDIR= $(exec_prefix)/lib
92MANDIR= $(prefix)/man
93INCLUDEDIR= $(prefix)/include
94SCRIPTDIR= $(prefix)/lib
Guido van Rossum90412791994-10-20 22:04:30 +000095
Guido van Rossumbed23fe1996-07-31 17:30:37 +000096# Detailed destination directories
97BINLIBDEST= $(LIBDIR)/python$(VERSION)
98LIBDEST= $(SCRIPTDIR)/python$(VERSION)
99INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
100LIBP= $(LIBDIR)/python$(VERSION)
101
Guido van Rossumac405f61994-09-12 10:56:06 +0000102# Symbols used for using shared libraries
103SO= @SO@
104LDSHARED= @LDSHARED@
105CCSHARED= @CCSHARED@
106LINKFORSHARED= @LINKFORSHARED@
Guido van Rossumbed23fe1996-07-31 17:30:37 +0000107DESTSHARED= $(BINLIBDEST)/sharedmodules
Guido van Rossumac405f61994-09-12 10:56:06 +0000108
Guido van Rossum586480b1996-05-28 22:49:08 +0000109# Shell used by make (some versions default to the login shell, which is bad)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000110SHELL= /bin/sh
111
Guido van Rossum586480b1996-05-28 22:49:08 +0000112# Portable install script (configure doesn't always guess right)
113INSTALL= @srcdir@/install-sh -c
Guido van Rossumb535da31996-07-30 18:04:22 +0000114INSTALL_PROGRAM=${INSTALL} -m 755
Guido van Rossum586480b1996-05-28 22:49:08 +0000115INSTALL_DATA= ${INSTALL} -m 644
116
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000117# --with-PACKAGE options for configure script
118# e.g. --with-readline --with-svr5 --with-solaris --with-thread
119# (see README for an explanation)
120WITH=
121
122# Compiler options passed to subordinate makes
Guido van Rossum4e8af441994-08-19 15:33:54 +0000123OPT= @OPT@
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000124
125# Subdirectories where to run make recursively
126SUBDIRS= Parser Objects Python Modules
127
128# Other subdirectories
Guido van Rossumb535da31996-07-30 18:04:22 +0000129SUBDIRSTOO= Include Lib Doc Misc Demo Grammar
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000130
131# Files and directories to be distributed
132CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.in
133DISTFILES= README ChangeLog $(CONFIGFILES)
134DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
135DIST= $(DISTFILES) $(DISTDIRS)
136
137# Default target
138all: python
139
140# Build the interpreter
141python: Makefiles
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000142 @for i in $(SUBDIRS); do \
143 (echo Making in subdirectory $$i; cd $$i; \
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000144 $(MAKE) OPT="$(OPT)" \
Guido van Rossumb535da31996-07-30 18:04:22 +0000145 VERSION="$(VERSION)" \
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000146 prefix="$(prefix)" \
147 exec_prefix="$(exec_prefix)" \
148 all); \
Guido van Rossum810a92f1993-12-28 19:39:56 +0000149 done
150
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000151# Test the interpreter (twice, once without .pyc files, once with)
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000152TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/test:./Modules
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000153test: python
154 -rm -f $(srcdir)/Lib/test/*.pyc
155 PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
156 PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
Guido van Rossum810a92f1993-12-28 19:39:56 +0000157
Guido van Rossum586480b1996-05-28 22:49:08 +0000158# Install everything
Guido van Rossum6d472981996-07-30 21:41:56 +0000159install: altinstall bininstall maninstall
Guido van Rossum586480b1996-05-28 22:49:08 +0000160
Guido van Rossum64b65671996-07-30 20:42:12 +0000161# Install almost everything without disturbing previous versions
Guido van Rossumb535da31996-07-30 18:04:22 +0000162altinstall: altbininstall libinstall inclinstall libainstall sharedinstall
Guido van Rossum3912fd81996-07-24 02:35:43 +0000163
Guido van Rossum64b65671996-07-30 20:42:12 +0000164# Install the interpreter (by creating a hard link to python$(VERSION))
165bininstall: altbininstall
166 -if test -f $(BINDIR)/python; \
167 then rm -f $(BINDIR)/python; \
168 else true; \
169 fi
170 (cd $(BINDIR); ln python$(VERSION) python)
Guido van Rossum810a92f1993-12-28 19:39:56 +0000171
Guido van Rossum3912fd81996-07-24 02:35:43 +0000172# Install the interpreter with $(VERSION) affixed
Guido van Rossum64b65671996-07-30 20:42:12 +0000173# This goes into $(exec_prefix)
Guido van Rossum3912fd81996-07-24 02:35:43 +0000174altbininstall: python
175 @for i in $(BINDIR); \
176 do \
177 if test ! -d $$i; then \
178 echo "Creating directory $$i"; \
179 mkdir $$i; \
180 chmod 755 $$i; \
181 else true; \
182 fi; \
183 done
184 $(INSTALL_PROGRAM) python $(BINDIR)/python$(VERSION)
185
Guido van Rossum586480b1996-05-28 22:49:08 +0000186# Install the manual page
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000187maninstall:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000188 @for i in $(MANDIR) $(MANDIR)/man1; \
Guido van Rossum586480b1996-05-28 22:49:08 +0000189 do \
190 if test ! -d $$i; then \
191 echo "Creating directory $$i"; \
192 mkdir $$i; \
193 chmod 755 $$i; \
194 else true; \
195 fi; \
196 done
Guido van Rossum6403d281995-01-20 16:51:32 +0000197 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
Guido van Rossum90412791994-10-20 22:04:30 +0000198 $(MANDIR)/man1/python.1
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000199
Guido van Rossumb535da31996-07-30 18:04:22 +0000200# Install the library
Guido van Rossumb8dccd21996-07-30 21:55:17 +0000201MACHDEPS= $(MACHDEP)
202LIBSUBDIRS= stdwin tkinter test $(MACHDEPS)
Guido van Rossum64b65671996-07-30 20:42:12 +0000203libinstall: python $(srcdir)/Lib/$(MACHDEP)
Guido van Rossumb535da31996-07-30 18:04:22 +0000204 @for i in $(SCRIPTDIR) $(LIBDEST); \
205 do \
206 if test ! -d $$i; then \
207 echo "Creating directory $$i"; \
208 mkdir $$i; \
209 chmod 755 $$i; \
210 else true; \
211 fi; \
212 done
213 @for d in $(LIBSUBDIRS); \
214 do \
215 a=$(srcdir)/Lib/$$d; \
216 if test ! -d $$a; then continue; else true; fi; \
217 b=$(LIBDEST)/$$d; \
218 if test ! -d $$b; then \
219 echo "Creating directory $$b"; \
220 mkdir $$b; \
221 chmod 755 $$b; \
222 else true; \
223 fi; \
224 done
225 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
226 do \
227 if test -x $$i; then \
228 $(INSTALL_PROGRAM) $$i $(LIBDEST); \
229 echo $(INSTALL_PROGRAM) $$i $(LIBDEST); \
230 else \
231 $(INSTALL_DATA) $$i $(LIBDEST); \
232 echo $(INSTALL_DATA) $$i $(LIBDEST); \
233 fi; \
234 done
235 @for d in $(LIBSUBDIRS); \
236 do \
237 a=$(srcdir)/Lib/$$d; \
238 if test ! -d $$a; then continue; else true; fi; \
239 b=$(LIBDEST)/$$d; \
240 for i in $$a/*; \
241 do \
242 case $$i in \
243 *CVS) ;; \
244 *.pyc) ;; \
245 *~) ;; \
246 *) \
247 if test -x $$i; then \
248 echo $(INSTALL_PROGRAM) $$i $$b; \
249 $(INSTALL_PROGRAM) $$i $$b; \
250 else \
251 echo $(INSTALL_DATA) $$i $$b; \
252 $(INSTALL_DATA) $$i $$b; \
253 fi;; \
254 esac; \
255 done; \
256 done
257 PYTHONPATH=$(LIBDEST) \
258 ./python $(LIBDEST)/compileall.py $(LIBDEST)
259
Guido van Rossum64b65671996-07-30 20:42:12 +0000260# Create the MACHDEP source directory, if one wasn't distributed..
Guido van Rossumcda848f1996-08-21 20:18:29 +0000261$(srcdir)/Lib/$(MACHDEP):
Guido van Rossum64b65671996-07-30 20:42:12 +0000262 mkdir $(srcdir)/Lib/$(MACHDEP)
263 cp $(srcdir)/Lib/generic/regen $(srcdir)/Lib/$(MACHDEP)/regen
Guido van Rossumf71bd681996-08-28 19:23:01 +0000264 export PATH; PATH="`pwd`:$(PATH)"; \
265 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
Guido van Rossumfc8ebb11996-08-19 21:51:24 +0000266 cd $(srcdir)/Lib/$(MACHDEP); ./regen
Guido van Rossum64b65671996-07-30 20:42:12 +0000267
Guido van Rossum586480b1996-05-28 22:49:08 +0000268# Install the include files
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000269inclinstall:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000270 @for i in $(INCLUDEDIR) $(INCLUDEPY); \
Guido van Rossum586480b1996-05-28 22:49:08 +0000271 do \
272 if test ! -d $$i; then \
273 echo "Creating directory $$i"; \
274 mkdir $$i; \
275 chmod 755 $$i; \
276 else true; \
277 fi; \
278 done
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000279 @for i in $(srcdir)/Include/*.h; \
280 do \
281 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
282 $(INSTALL_DATA) $$i $(INCLUDEPY); \
283 done
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000284
Guido van Rossum586480b1996-05-28 22:49:08 +0000285# Install the lib*.a files and miscellaneous stuff needed by extensions
Guido van Rossum64b65671996-07-30 20:42:12 +0000286# This goes into $(exec_prefix)
Guido van Rossumb535da31996-07-30 18:04:22 +0000287LIBPL= $(LIBP)/config
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000288libainstall: all
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000289 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
Guido van Rossum586480b1996-05-28 22:49:08 +0000290 do \
291 if test ! -d $$i; then \
292 echo "Creating directory $$i"; \
293 mkdir $$i; \
294 chmod 755 $$i; \
295 else true; \
296 fi; \
297 done
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000298 @for i in $(SUBDIRS); do \
299 echo Installing in subdirectory $$i; \
Guido van Rossum586480b1996-05-28 22:49:08 +0000300 $(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \
Guido van Rossum4a91df41994-10-10 17:58:27 +0000301 $(RANLIB) $(LIBPL)/lib$$i.a; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000302 done
Guido van Rossum6403d281995-01-20 16:51:32 +0000303 $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000304 $(INSTALL_DATA) $(srcdir)/Modules/getpath.c $(LIBPL)/getpath.c
Guido van Rossum6403d281995-01-20 16:51:32 +0000305 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
306 $(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile
307 $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
Guido van Rossum70a86591996-07-21 02:46:47 +0000308 $(INSTALL_PROGRAM) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
Guido van Rossum6403d281995-01-20 16:51:32 +0000309 $(INSTALL_DATA) config.h $(LIBPL)/config.h
310 $(INSTALL_DATA) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c
Sjoerd Mullenderad5d2cf1995-08-09 09:18:20 +0000311 $(INSTALL_DATA) Modules/main.o $(LIBPL)/main.o
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000312
Guido van Rossum586480b1996-05-28 22:49:08 +0000313# Install the dynamically loadable modules
Guido van Rossum64b65671996-07-30 20:42:12 +0000314# This goes into $(exec_prefix)
Guido van Rossumac405f61994-09-12 10:56:06 +0000315sharedinstall:
316 cd Modules; $(MAKE) \
317 OPT="$(OPT)" \
Guido van Rossumb535da31996-07-30 18:04:22 +0000318 VERSION="$(VERSION)" \
Guido van Rossumac405f61994-09-12 10:56:06 +0000319 SO="$(SO)" \
320 LDSHARED="$(LDSHARED)" \
321 CCSHARED="$(CCSHARED)" \
322 LINKFORSHARED="$(LINKFORSHARED)" \
323 DESTSHARED="$(DESTSHARED)" \
Guido van Rossum3912fd81996-07-24 02:35:43 +0000324 prefix="$(prefix)" \
325 exec_prefix="$(exec_prefix)" \
Guido van Rossumac405f61994-09-12 10:56:06 +0000326 sharedinstall
327
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000328# Build the sub-Makefiles
Guido van Rossumd09119e1995-01-17 16:45:08 +0000329Makefiles: config.status Modules/Makefile.pre
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000330 (cd Modules; $(MAKE) -f Makefile.pre Makefile)
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000331 @for i in . $(SUBDIRS); do \
332 (echo making Makefile in subdirectory $$i; cd $$i; \
333 $(MAKE) Makefile); \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000334 done
335
Guido van Rossumd09119e1995-01-17 16:45:08 +0000336# Build the intermediate Makefile in Modules
337Modules/Makefile.pre: config.status
338 $(SHELL) config.status
339
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000340# Build the toplevel Makefile
341Makefile: Makefile.in config.status
342 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status
343
344# Run the configure script. If config.status already exists,
345# call it with the --recheck argument, which reruns configure with the
346# same options as it was run last time; otherwise run the configure
347# script with options taken from the $(WITH) variable
348config.status: $(srcdir)/configure
349 if test -f config.status; \
350 then $(SHELL) config.status --recheck; \
Guido van Rossumfb00a991995-01-12 12:26:50 +0000351 $(SHELL) config.status; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000352 else $(SHELL) $(srcdir)/configure $(WITH); \
353 fi
354
355.PRECIOUS: config.status python
356
357# Rerun configure with the same options as it was run last time,
358# provided the config.status script exists
359recheck:
360 $(SHELL) config.status --recheck
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000361 $(SHELL) config.status
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000362
363# Rebuild the configure script from configure.in; also rebuild config.h.in
364autoconf:
Guido van Rossum00682671996-06-28 20:15:41 +0000365 (cd $(srcdir); autoconf)
366 (cd $(srcdir); autoheader)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000367
368# Create a tags file for vi
369tags::
370 ctags -w -t Include/*.h
371 for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
372 sort tags -o tags
373
374# Create a tags file for GNU Emacs
375TAGS::
Guido van Rossum5552eb71994-08-05 15:51:00 +0000376 etags Include/*.h
377 for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000378
379# Add dependencies to sub-Makefiles
Guido van Rossum810a92f1993-12-28 19:39:56 +0000380depend:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000381 @for i in $(SUBDIRS); do \
382 (echo making depend in subdirectory $$i; cd $$i; \
383 $(MAKE) depend); \
Guido van Rossum810a92f1993-12-28 19:39:56 +0000384 done
Guido van Rossum627b2d71993-12-24 10:39:16 +0000385
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000386# Sanitation targets -- clean leaves libraries, executables and tags
387# files, which clobber removes those as well
388
Guido van Rossum627b2d71993-12-24 10:39:16 +0000389localclean:
390 -rm -f core *~ [@,#]* *.old *.orig *.rej
Guido van Rossum627b2d71993-12-24 10:39:16 +0000391
392clean: localclean
393 -for i in $(SUBDIRS); do \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000394 (echo making clean in subdirectory $$i; cd $$i; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000395 if test -f Makefile; \
396 then $(MAKE) clean; \
397 else $(MAKE) -f Makefile.*in clean; \
398 fi); \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000399 done
400
Guido van Rossum810a92f1993-12-28 19:39:56 +0000401localclobber: localclean
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000402 -rm -f tags TAGS python
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000403 -rm -f config.log config.cache config.h
Guido van Rossum810a92f1993-12-28 19:39:56 +0000404
405clobber: localclobber
Guido van Rossum627b2d71993-12-24 10:39:16 +0000406 -for i in $(SUBDIRS); do \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000407 (echo clobbering subdirectory $$i; cd $$i; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000408 if test -f Makefile; \
409 then $(MAKE) clobber; \
Guido van Rossum7b4d4601995-03-22 12:27:16 +0000410 else $(MAKE) -f $(srcdir)/Makefile.in clobber; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000411 fi); \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000412 done
413
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000414# Make things extra clean, before making a distribution:
415# remove all generated files, even Makefile[.pre]
Guido van Rossum627b2d71993-12-24 10:39:16 +0000416distclean: clobber
Guido van Rossum7b4d4601995-03-22 12:27:16 +0000417 -$(MAKE) -f $(srcdir)/Makefile.in \
418 SUBDIRS="$(SUBDIRSTOO)" clobber
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000419 -rm -f config.status config.log config.cache config.h Makefile
Guido van Rossume7abf4e1995-09-18 22:12:20 +0000420 -rm -f Modules/Makefile
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000421 -for i in $(SUBDIRS) $(SUBDIRSTOO); do \
422 for f in $$i/*.in; do \
423 f=`basename "$$f" .in`; \
424 if test "$$f" != "*"; then \
425 echo rm -f "$$i/$$f"; \
426 rm -f "$$i/$$f"; \
427 fi; \
428 done; \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000429 done
Guido van Rossum627b2d71993-12-24 10:39:16 +0000430
Guido van Rossum586480b1996-05-28 22:49:08 +0000431# Check for smelly exported symbols (not starting with Py/_Py)
432smelly: all
433 for i in $(SUBDIRS); do \
434 echo --- $$i ---; \
435 nm -p $$i/lib$$i.a | \
436 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
437 done
438
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000439# Find files with funny names
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000440funny:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000441 find $(DISTDIRS) -type d \
442 -o -name '*.[chs]' \
443 -o -name '*.py' \
444 -o -name '*.doc' \
445 -o -name '*.sty' \
446 -o -name '*.bib' \
447 -o -name '*.dat' \
448 -o -name '*.el' \
449 -o -name '*.fd' \
450 -o -name '*.in' \
451 -o -name '*.tex' \
452 -o -name '*,[vpt]' \
453 -o -name 'Setup' \
454 -o -name 'Setup.*' \
455 -o -name README \
456 -o -name Makefile \
457 -o -name ChangeLog \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000458 -o -name Repository \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000459 -o -name Root \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000460 -o -name Entries \
461 -o -name Tag \
462 -o -name tags \
463 -o -name TAGS \
464 -o -name .cvsignore \
465 -o -name MANIFEST \
466 -o -print