blob: 332cba8b75a545578c91d6ea9995efc901d21b17 [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 Rossumac405f61994-09-12 10:56:06 +000096# Symbols used for using shared libraries
97SO= @SO@
98LDSHARED= @LDSHARED@
99CCSHARED= @CCSHARED@
100LINKFORSHARED= @LINKFORSHARED@
Guido van Rossumb535da31996-07-30 18:04:22 +0000101DESTSHARED= $(LIBDIR)/python$(VERSION)/sharedmodules
Guido van Rossumac405f61994-09-12 10:56:06 +0000102
Guido van Rossum586480b1996-05-28 22:49:08 +0000103# Shell used by make (some versions default to the login shell, which is bad)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000104SHELL= /bin/sh
105
Guido van Rossum586480b1996-05-28 22:49:08 +0000106# Portable install script (configure doesn't always guess right)
107INSTALL= @srcdir@/install-sh -c
Guido van Rossumb535da31996-07-30 18:04:22 +0000108INSTALL_PROGRAM=${INSTALL} -m 755
Guido van Rossum586480b1996-05-28 22:49:08 +0000109INSTALL_DATA= ${INSTALL} -m 644
110
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000111# --with-PACKAGE options for configure script
112# e.g. --with-readline --with-svr5 --with-solaris --with-thread
113# (see README for an explanation)
114WITH=
115
116# Compiler options passed to subordinate makes
Guido van Rossum4e8af441994-08-19 15:33:54 +0000117OPT= @OPT@
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000118
119# Subdirectories where to run make recursively
120SUBDIRS= Parser Objects Python Modules
121
122# Other subdirectories
Guido van Rossumb535da31996-07-30 18:04:22 +0000123SUBDIRSTOO= Include Lib Doc Misc Demo Grammar
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000124
125# Files and directories to be distributed
126CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.in
127DISTFILES= README ChangeLog $(CONFIGFILES)
128DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
129DIST= $(DISTFILES) $(DISTDIRS)
130
131# Default target
132all: python
133
134# Build the interpreter
135python: Makefiles
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000136 @for i in $(SUBDIRS); do \
137 (echo Making in subdirectory $$i; cd $$i; \
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000138 $(MAKE) OPT="$(OPT)" \
Guido van Rossumb535da31996-07-30 18:04:22 +0000139 VERSION="$(VERSION)" \
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000140 prefix="$(prefix)" \
141 exec_prefix="$(exec_prefix)" \
142 all); \
Guido van Rossum810a92f1993-12-28 19:39:56 +0000143 done
144
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000145# Test the interpreter (twice, once without .pyc files, once with)
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000146TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/test:./Modules
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000147test: python
148 -rm -f $(srcdir)/Lib/test/*.pyc
149 PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
150 PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
Guido van Rossum810a92f1993-12-28 19:39:56 +0000151
Guido van Rossum586480b1996-05-28 22:49:08 +0000152# Install everything
Guido van Rossum64b65671996-07-30 20:42:12 +0000153install: altintall bininstall maninstall
Guido van Rossum586480b1996-05-28 22:49:08 +0000154
Guido van Rossum64b65671996-07-30 20:42:12 +0000155# Install almost everything without disturbing previous versions
Guido van Rossumb535da31996-07-30 18:04:22 +0000156altinstall: altbininstall libinstall inclinstall libainstall sharedinstall
Guido van Rossum3912fd81996-07-24 02:35:43 +0000157
Guido van Rossum64b65671996-07-30 20:42:12 +0000158# Install the interpreter (by creating a hard link to python$(VERSION))
159bininstall: altbininstall
160 -if test -f $(BINDIR)/python; \
161 then rm -f $(BINDIR)/python; \
162 else true; \
163 fi
164 (cd $(BINDIR); ln python$(VERSION) python)
Guido van Rossum810a92f1993-12-28 19:39:56 +0000165
Guido van Rossum3912fd81996-07-24 02:35:43 +0000166# Install the interpreter with $(VERSION) affixed
Guido van Rossum64b65671996-07-30 20:42:12 +0000167# This goes into $(exec_prefix)
Guido van Rossum3912fd81996-07-24 02:35:43 +0000168altbininstall: python
169 @for i in $(BINDIR); \
170 do \
171 if test ! -d $$i; then \
172 echo "Creating directory $$i"; \
173 mkdir $$i; \
174 chmod 755 $$i; \
175 else true; \
176 fi; \
177 done
178 $(INSTALL_PROGRAM) python $(BINDIR)/python$(VERSION)
179
Guido van Rossum586480b1996-05-28 22:49:08 +0000180# Install the manual page
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000181maninstall:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000182 @for i in $(MANDIR) $(MANDIR)/man1; \
Guido van Rossum586480b1996-05-28 22:49:08 +0000183 do \
184 if test ! -d $$i; then \
185 echo "Creating directory $$i"; \
186 mkdir $$i; \
187 chmod 755 $$i; \
188 else true; \
189 fi; \
190 done
Guido van Rossum6403d281995-01-20 16:51:32 +0000191 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
Guido van Rossum90412791994-10-20 22:04:30 +0000192 $(MANDIR)/man1/python.1
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000193
Guido van Rossumb535da31996-07-30 18:04:22 +0000194# Install the library
195LIBDEST= $(SCRIPTDIR)/python$(VERSION)
196LIBSUBDIRS= stdwin tkinter test $(MACHDEP)
Guido van Rossum64b65671996-07-30 20:42:12 +0000197libinstall: python $(srcdir)/Lib/$(MACHDEP)
Guido van Rossumb535da31996-07-30 18:04:22 +0000198 @for i in $(SCRIPTDIR) $(LIBDEST); \
199 do \
200 if test ! -d $$i; then \
201 echo "Creating directory $$i"; \
202 mkdir $$i; \
203 chmod 755 $$i; \
204 else true; \
205 fi; \
206 done
207 @for d in $(LIBSUBDIRS); \
208 do \
209 a=$(srcdir)/Lib/$$d; \
210 if test ! -d $$a; then continue; else true; fi; \
211 b=$(LIBDEST)/$$d; \
212 if test ! -d $$b; then \
213 echo "Creating directory $$b"; \
214 mkdir $$b; \
215 chmod 755 $$b; \
216 else true; \
217 fi; \
218 done
219 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
220 do \
221 if test -x $$i; then \
222 $(INSTALL_PROGRAM) $$i $(LIBDEST); \
223 echo $(INSTALL_PROGRAM) $$i $(LIBDEST); \
224 else \
225 $(INSTALL_DATA) $$i $(LIBDEST); \
226 echo $(INSTALL_DATA) $$i $(LIBDEST); \
227 fi; \
228 done
229 @for d in $(LIBSUBDIRS); \
230 do \
231 a=$(srcdir)/Lib/$$d; \
232 if test ! -d $$a; then continue; else true; fi; \
233 b=$(LIBDEST)/$$d; \
234 for i in $$a/*; \
235 do \
236 case $$i in \
237 *CVS) ;; \
238 *.pyc) ;; \
239 *~) ;; \
240 *) \
241 if test -x $$i; then \
242 echo $(INSTALL_PROGRAM) $$i $$b; \
243 $(INSTALL_PROGRAM) $$i $$b; \
244 else \
245 echo $(INSTALL_DATA) $$i $$b; \
246 $(INSTALL_DATA) $$i $$b; \
247 fi;; \
248 esac; \
249 done; \
250 done
251 PYTHONPATH=$(LIBDEST) \
252 ./python $(LIBDEST)/compileall.py $(LIBDEST)
253
Guido van Rossum64b65671996-07-30 20:42:12 +0000254# Create the MACHDEP source directory, if one wasn't distributed..
255# XXX This requires Tools/scripts/h2py.py which requires /usr/local/bin/python.
256# Oh well, it's a hint that something should be done.
257$(srcdir)/Lib/$(MACHDEP):
258 mkdir $(srcdir)/Lib/$(MACHDEP)
259 cp $(srcdir)/Lib/generic/regen $(srcdir)/Lib/$(MACHDEP)/regen
260 (cd $(srcdir)/Lib/$(MACHDEP); ./regen)
261
Guido van Rossum586480b1996-05-28 22:49:08 +0000262# Install the include files
Guido van Rossumb535da31996-07-30 18:04:22 +0000263INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000264inclinstall:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000265 @for i in $(INCLUDEDIR) $(INCLUDEPY); \
Guido van Rossum586480b1996-05-28 22:49:08 +0000266 do \
267 if test ! -d $$i; then \
268 echo "Creating directory $$i"; \
269 mkdir $$i; \
270 chmod 755 $$i; \
271 else true; \
272 fi; \
273 done
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000274 @for i in $(srcdir)/Include/*.h; \
275 do \
276 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
277 $(INSTALL_DATA) $$i $(INCLUDEPY); \
278 done
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000279
Guido van Rossum586480b1996-05-28 22:49:08 +0000280# Install the lib*.a files and miscellaneous stuff needed by extensions
Guido van Rossum64b65671996-07-30 20:42:12 +0000281# This goes into $(exec_prefix)
Guido van Rossumb535da31996-07-30 18:04:22 +0000282LIBP= $(LIBDIR)/python$(VERSION)
283LIBPL= $(LIBP)/config
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000284libainstall: all
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000285 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
Guido van Rossum586480b1996-05-28 22:49:08 +0000286 do \
287 if test ! -d $$i; then \
288 echo "Creating directory $$i"; \
289 mkdir $$i; \
290 chmod 755 $$i; \
291 else true; \
292 fi; \
293 done
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000294 @for i in $(SUBDIRS); do \
295 echo Installing in subdirectory $$i; \
Guido van Rossum586480b1996-05-28 22:49:08 +0000296 $(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \
Guido van Rossum4a91df41994-10-10 17:58:27 +0000297 $(RANLIB) $(LIBPL)/lib$$i.a; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000298 done
Guido van Rossum6403d281995-01-20 16:51:32 +0000299 $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000300 $(INSTALL_DATA) $(srcdir)/Modules/getpath.c $(LIBPL)/getpath.c
Guido van Rossum6403d281995-01-20 16:51:32 +0000301 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
302 $(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile
303 $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
Guido van Rossum70a86591996-07-21 02:46:47 +0000304 $(INSTALL_PROGRAM) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
Guido van Rossum6403d281995-01-20 16:51:32 +0000305 $(INSTALL_DATA) config.h $(LIBPL)/config.h
306 $(INSTALL_DATA) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c
Sjoerd Mullenderad5d2cf1995-08-09 09:18:20 +0000307 $(INSTALL_DATA) Modules/main.o $(LIBPL)/main.o
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000308
Guido van Rossum586480b1996-05-28 22:49:08 +0000309# Install the dynamically loadable modules
Guido van Rossum64b65671996-07-30 20:42:12 +0000310# This goes into $(exec_prefix)
Guido van Rossumac405f61994-09-12 10:56:06 +0000311sharedinstall:
312 cd Modules; $(MAKE) \
313 OPT="$(OPT)" \
Guido van Rossumb535da31996-07-30 18:04:22 +0000314 VERSION="$(VERSION)" \
Guido van Rossumac405f61994-09-12 10:56:06 +0000315 SO="$(SO)" \
316 LDSHARED="$(LDSHARED)" \
317 CCSHARED="$(CCSHARED)" \
318 LINKFORSHARED="$(LINKFORSHARED)" \
319 DESTSHARED="$(DESTSHARED)" \
Guido van Rossum3912fd81996-07-24 02:35:43 +0000320 prefix="$(prefix)" \
321 exec_prefix="$(exec_prefix)" \
Guido van Rossumac405f61994-09-12 10:56:06 +0000322 sharedinstall
323
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000324# Build the sub-Makefiles
Guido van Rossumd09119e1995-01-17 16:45:08 +0000325Makefiles: config.status Modules/Makefile.pre
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000326 (cd Modules; $(MAKE) -f Makefile.pre Makefile)
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000327 @for i in . $(SUBDIRS); do \
328 (echo making Makefile in subdirectory $$i; cd $$i; \
329 $(MAKE) Makefile); \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000330 done
331
Guido van Rossumd09119e1995-01-17 16:45:08 +0000332# Build the intermediate Makefile in Modules
333Modules/Makefile.pre: config.status
334 $(SHELL) config.status
335
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000336# Build the toplevel Makefile
337Makefile: Makefile.in config.status
338 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status
339
340# Run the configure script. If config.status already exists,
341# call it with the --recheck argument, which reruns configure with the
342# same options as it was run last time; otherwise run the configure
343# script with options taken from the $(WITH) variable
344config.status: $(srcdir)/configure
345 if test -f config.status; \
346 then $(SHELL) config.status --recheck; \
Guido van Rossumfb00a991995-01-12 12:26:50 +0000347 $(SHELL) config.status; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000348 else $(SHELL) $(srcdir)/configure $(WITH); \
349 fi
350
351.PRECIOUS: config.status python
352
353# Rerun configure with the same options as it was run last time,
354# provided the config.status script exists
355recheck:
356 $(SHELL) config.status --recheck
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000357 $(SHELL) config.status
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000358
359# Rebuild the configure script from configure.in; also rebuild config.h.in
360autoconf:
Guido van Rossum00682671996-06-28 20:15:41 +0000361 (cd $(srcdir); autoconf)
362 (cd $(srcdir); autoheader)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000363
364# Create a tags file for vi
365tags::
366 ctags -w -t Include/*.h
367 for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
368 sort tags -o tags
369
370# Create a tags file for GNU Emacs
371TAGS::
Guido van Rossum5552eb71994-08-05 15:51:00 +0000372 etags Include/*.h
373 for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000374
375# Add dependencies to sub-Makefiles
Guido van Rossum810a92f1993-12-28 19:39:56 +0000376depend:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000377 @for i in $(SUBDIRS); do \
378 (echo making depend in subdirectory $$i; cd $$i; \
379 $(MAKE) depend); \
Guido van Rossum810a92f1993-12-28 19:39:56 +0000380 done
Guido van Rossum627b2d71993-12-24 10:39:16 +0000381
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000382# Sanitation targets -- clean leaves libraries, executables and tags
383# files, which clobber removes those as well
384
Guido van Rossum627b2d71993-12-24 10:39:16 +0000385localclean:
386 -rm -f core *~ [@,#]* *.old *.orig *.rej
Guido van Rossum627b2d71993-12-24 10:39:16 +0000387
388clean: localclean
389 -for i in $(SUBDIRS); do \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000390 (echo making clean in subdirectory $$i; cd $$i; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000391 if test -f Makefile; \
392 then $(MAKE) clean; \
393 else $(MAKE) -f Makefile.*in clean; \
394 fi); \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000395 done
396
Guido van Rossum810a92f1993-12-28 19:39:56 +0000397localclobber: localclean
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000398 -rm -f tags TAGS python
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000399 -rm -f config.log config.cache config.h
Guido van Rossum810a92f1993-12-28 19:39:56 +0000400
401clobber: localclobber
Guido van Rossum627b2d71993-12-24 10:39:16 +0000402 -for i in $(SUBDIRS); do \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000403 (echo clobbering subdirectory $$i; cd $$i; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000404 if test -f Makefile; \
405 then $(MAKE) clobber; \
Guido van Rossum7b4d4601995-03-22 12:27:16 +0000406 else $(MAKE) -f $(srcdir)/Makefile.in clobber; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000407 fi); \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000408 done
409
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000410# Make things extra clean, before making a distribution:
411# remove all generated files, even Makefile[.pre]
Guido van Rossum627b2d71993-12-24 10:39:16 +0000412distclean: clobber
Guido van Rossum7b4d4601995-03-22 12:27:16 +0000413 -$(MAKE) -f $(srcdir)/Makefile.in \
414 SUBDIRS="$(SUBDIRSTOO)" clobber
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000415 -rm -f config.status config.log config.cache config.h Makefile
Guido van Rossume7abf4e1995-09-18 22:12:20 +0000416 -rm -f Modules/Makefile
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000417 -for i in $(SUBDIRS) $(SUBDIRSTOO); do \
418 for f in $$i/*.in; do \
419 f=`basename "$$f" .in`; \
420 if test "$$f" != "*"; then \
421 echo rm -f "$$i/$$f"; \
422 rm -f "$$i/$$f"; \
423 fi; \
424 done; \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000425 done
Guido van Rossum627b2d71993-12-24 10:39:16 +0000426
Guido van Rossum586480b1996-05-28 22:49:08 +0000427# Check for smelly exported symbols (not starting with Py/_Py)
428smelly: all
429 for i in $(SUBDIRS); do \
430 echo --- $$i ---; \
431 nm -p $$i/lib$$i.a | \
432 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
433 done
434
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000435# Find files with funny names
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000436funny:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000437 find $(DISTDIRS) -type d \
438 -o -name '*.[chs]' \
439 -o -name '*.py' \
440 -o -name '*.doc' \
441 -o -name '*.sty' \
442 -o -name '*.bib' \
443 -o -name '*.dat' \
444 -o -name '*.el' \
445 -o -name '*.fd' \
446 -o -name '*.in' \
447 -o -name '*.tex' \
448 -o -name '*,[vpt]' \
449 -o -name 'Setup' \
450 -o -name 'Setup.*' \
451 -o -name README \
452 -o -name Makefile \
453 -o -name ChangeLog \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000454 -o -name Repository \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000455 -o -name Root \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000456 -o -name Entries \
457 -o -name Tag \
458 -o -name tags \
459 -o -name TAGS \
460 -o -name .cvsignore \
461 -o -name MANIFEST \
462 -o -print