blob: e578cf99012185ebfb19d9ea4f06bb09dd30f713 [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 Rossum586480b1996-05-28 22:49:08 +000063# If recursive makes fail, try invoking make as "make MAKE=make".
64#
65# See also the section "Build instructions" in the README file.
Guido van Rossum627b2d71993-12-24 10:39:16 +000066
Guido van Rossum3912fd81996-07-24 02:35:43 +000067# Interpreter version number, for library destination pathnames
68VERSION= 1.4
69
Guido van Rossum433c8ad1994-08-01 12:07:07 +000070# Substitutions by configure
71srcdir= @srcdir@
72VPATH= @srcdir@
Guido van Rossum4a91df41994-10-10 17:58:27 +000073RANLIB= @RANLIB@
Guido van Rossum433c8ad1994-08-01 12:07:07 +000074
Guido van Rossumac405f61994-09-12 10:56:06 +000075# Machine-dependent subdirectories
76MACHDEP= @MACHDEP@
77
Guido van Rossum433c8ad1994-08-01 12:07:07 +000078# Install prefix for architecture-independent files
Guido van Rossum76be6ed1995-01-02 18:33:54 +000079prefix= @prefix@
Guido van Rossum433c8ad1994-08-01 12:07:07 +000080
81# Install prefix for architecture-dependent files
Guido van Rossum76be6ed1995-01-02 18:33:54 +000082exec_prefix= @exec_prefix@
Guido van Rossum433c8ad1994-08-01 12:07:07 +000083
Guido van Rossum90412791994-10-20 22:04:30 +000084# Expanded directories
Guido van Rossumb535da31996-07-30 18:04:22 +000085BINDIR= $(exec_prefix)/bin
86LIBDIR= $(exec_prefix)/lib
87MANDIR= $(prefix)/man
88INCLUDEDIR= $(prefix)/include
89SCRIPTDIR= $(prefix)/lib
Guido van Rossum90412791994-10-20 22:04:30 +000090
Guido van Rossumac405f61994-09-12 10:56:06 +000091# Symbols used for using shared libraries
92SO= @SO@
93LDSHARED= @LDSHARED@
94CCSHARED= @CCSHARED@
95LINKFORSHARED= @LINKFORSHARED@
Guido van Rossumb535da31996-07-30 18:04:22 +000096DESTSHARED= $(LIBDIR)/python$(VERSION)/sharedmodules
Guido van Rossumac405f61994-09-12 10:56:06 +000097
Guido van Rossum586480b1996-05-28 22:49:08 +000098# Shell used by make (some versions default to the login shell, which is bad)
Guido van Rossum433c8ad1994-08-01 12:07:07 +000099SHELL= /bin/sh
100
Guido van Rossum586480b1996-05-28 22:49:08 +0000101# Portable install script (configure doesn't always guess right)
102INSTALL= @srcdir@/install-sh -c
Guido van Rossumb535da31996-07-30 18:04:22 +0000103INSTALL_PROGRAM=${INSTALL} -m 755
Guido van Rossum586480b1996-05-28 22:49:08 +0000104INSTALL_DATA= ${INSTALL} -m 644
105
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000106# --with-PACKAGE options for configure script
107# e.g. --with-readline --with-svr5 --with-solaris --with-thread
108# (see README for an explanation)
109WITH=
110
111# Compiler options passed to subordinate makes
Guido van Rossum4e8af441994-08-19 15:33:54 +0000112OPT= @OPT@
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000113
114# Subdirectories where to run make recursively
115SUBDIRS= Parser Objects Python Modules
116
117# Other subdirectories
Guido van Rossumb535da31996-07-30 18:04:22 +0000118SUBDIRSTOO= Include Lib Doc Misc Demo Grammar
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000119
120# Files and directories to be distributed
121CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.in
122DISTFILES= README ChangeLog $(CONFIGFILES)
123DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
124DIST= $(DISTFILES) $(DISTDIRS)
125
126# Default target
127all: python
128
129# Build the interpreter
130python: Makefiles
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000131 @for i in $(SUBDIRS); do \
132 (echo Making in subdirectory $$i; cd $$i; \
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000133 $(MAKE) OPT="$(OPT)" \
Guido van Rossumb535da31996-07-30 18:04:22 +0000134 VERSION="$(VERSION)" \
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000135 prefix="$(prefix)" \
136 exec_prefix="$(exec_prefix)" \
137 all); \
Guido van Rossum810a92f1993-12-28 19:39:56 +0000138 done
139
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000140# Test the interpreter (twice, once without .pyc files, once with)
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000141TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/test:./Modules
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000142test: python
143 -rm -f $(srcdir)/Lib/test/*.pyc
144 PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
145 PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
Guido van Rossum810a92f1993-12-28 19:39:56 +0000146
Guido van Rossum586480b1996-05-28 22:49:08 +0000147# Install everything
Guido van Rossumb535da31996-07-30 18:04:22 +0000148install: bininstall maninstall libinstall inclinstall \
Guido van Rossum586480b1996-05-28 22:49:08 +0000149 libainstall sharedinstall
150
Guido van Rossum3912fd81996-07-24 02:35:43 +0000151# Install most things with $(VERSION) affixed
Guido van Rossumb535da31996-07-30 18:04:22 +0000152altinstall: altbininstall libinstall inclinstall libainstall sharedinstall
Guido van Rossum3912fd81996-07-24 02:35:43 +0000153
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000154# Install the interpreter
Guido van Rossum586480b1996-05-28 22:49:08 +0000155bininstall: python
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000156 @for i in $(BINDIR); \
Guido van Rossum586480b1996-05-28 22:49:08 +0000157 do \
158 if test ! -d $$i; then \
159 echo "Creating directory $$i"; \
160 mkdir $$i; \
161 chmod 755 $$i; \
162 else true; \
163 fi; \
164 done
Guido van Rossum6403d281995-01-20 16:51:32 +0000165 $(INSTALL_PROGRAM) python $(BINDIR)/python
Guido van Rossum810a92f1993-12-28 19:39:56 +0000166
Guido van Rossum3912fd81996-07-24 02:35:43 +0000167# Install the interpreter with $(VERSION) affixed
168altbininstall: 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)
197libinstall: python
198 @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 Rossum586480b1996-05-28 22:49:08 +0000254# Install the include files
Guido van Rossumb535da31996-07-30 18:04:22 +0000255INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000256inclinstall:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000257 @for i in $(INCLUDEDIR) $(INCLUDEPY); \
Guido van Rossum586480b1996-05-28 22:49:08 +0000258 do \
259 if test ! -d $$i; then \
260 echo "Creating directory $$i"; \
261 mkdir $$i; \
262 chmod 755 $$i; \
263 else true; \
264 fi; \
265 done
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000266 @for i in $(srcdir)/Include/*.h; \
267 do \
268 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
269 $(INSTALL_DATA) $$i $(INCLUDEPY); \
270 done
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000271
Guido van Rossum586480b1996-05-28 22:49:08 +0000272# Install the lib*.a files and miscellaneous stuff needed by extensions
Guido van Rossumb535da31996-07-30 18:04:22 +0000273LIBP= $(LIBDIR)/python$(VERSION)
274LIBPL= $(LIBP)/config
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000275libainstall: all
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000276 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
Guido van Rossum586480b1996-05-28 22:49:08 +0000277 do \
278 if test ! -d $$i; then \
279 echo "Creating directory $$i"; \
280 mkdir $$i; \
281 chmod 755 $$i; \
282 else true; \
283 fi; \
284 done
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000285 @for i in $(SUBDIRS); do \
286 echo Installing in subdirectory $$i; \
Guido van Rossum586480b1996-05-28 22:49:08 +0000287 $(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \
Guido van Rossum4a91df41994-10-10 17:58:27 +0000288 $(RANLIB) $(LIBPL)/lib$$i.a; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000289 done
Guido van Rossum6403d281995-01-20 16:51:32 +0000290 $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000291 $(INSTALL_DATA) $(srcdir)/Modules/getpath.c $(LIBPL)/getpath.c
Guido van Rossum6403d281995-01-20 16:51:32 +0000292 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
293 $(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile
294 $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
Guido van Rossum70a86591996-07-21 02:46:47 +0000295 $(INSTALL_PROGRAM) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
Guido van Rossum6403d281995-01-20 16:51:32 +0000296 $(INSTALL_DATA) config.h $(LIBPL)/config.h
297 $(INSTALL_DATA) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c
Sjoerd Mullenderad5d2cf1995-08-09 09:18:20 +0000298 $(INSTALL_DATA) Modules/main.o $(LIBPL)/main.o
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000299
Guido van Rossum586480b1996-05-28 22:49:08 +0000300# Install the dynamically loadable modules
Guido van Rossumac405f61994-09-12 10:56:06 +0000301sharedinstall:
302 cd Modules; $(MAKE) \
303 OPT="$(OPT)" \
Guido van Rossumb535da31996-07-30 18:04:22 +0000304 VERSION="$(VERSION)" \
Guido van Rossumac405f61994-09-12 10:56:06 +0000305 SO="$(SO)" \
306 LDSHARED="$(LDSHARED)" \
307 CCSHARED="$(CCSHARED)" \
308 LINKFORSHARED="$(LINKFORSHARED)" \
309 DESTSHARED="$(DESTSHARED)" \
Guido van Rossum3912fd81996-07-24 02:35:43 +0000310 prefix="$(prefix)" \
311 exec_prefix="$(exec_prefix)" \
Guido van Rossumac405f61994-09-12 10:56:06 +0000312 sharedinstall
313
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000314# Build the sub-Makefiles
Guido van Rossumd09119e1995-01-17 16:45:08 +0000315Makefiles: config.status Modules/Makefile.pre
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000316 (cd Modules; $(MAKE) -f Makefile.pre Makefile)
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000317 @for i in . $(SUBDIRS); do \
318 (echo making Makefile in subdirectory $$i; cd $$i; \
319 $(MAKE) Makefile); \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000320 done
321
Guido van Rossumd09119e1995-01-17 16:45:08 +0000322# Build the intermediate Makefile in Modules
323Modules/Makefile.pre: config.status
324 $(SHELL) config.status
325
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000326# Build the toplevel Makefile
327Makefile: Makefile.in config.status
328 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status
329
330# Run the configure script. If config.status already exists,
331# call it with the --recheck argument, which reruns configure with the
332# same options as it was run last time; otherwise run the configure
333# script with options taken from the $(WITH) variable
334config.status: $(srcdir)/configure
335 if test -f config.status; \
336 then $(SHELL) config.status --recheck; \
Guido van Rossumfb00a991995-01-12 12:26:50 +0000337 $(SHELL) config.status; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000338 else $(SHELL) $(srcdir)/configure $(WITH); \
339 fi
340
341.PRECIOUS: config.status python
342
343# Rerun configure with the same options as it was run last time,
344# provided the config.status script exists
345recheck:
346 $(SHELL) config.status --recheck
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000347 $(SHELL) config.status
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000348
349# Rebuild the configure script from configure.in; also rebuild config.h.in
350autoconf:
Guido van Rossum00682671996-06-28 20:15:41 +0000351 (cd $(srcdir); autoconf)
352 (cd $(srcdir); autoheader)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000353
354# Create a tags file for vi
355tags::
356 ctags -w -t Include/*.h
357 for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
358 sort tags -o tags
359
360# Create a tags file for GNU Emacs
361TAGS::
Guido van Rossum5552eb71994-08-05 15:51:00 +0000362 etags Include/*.h
363 for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000364
365# Add dependencies to sub-Makefiles
Guido van Rossum810a92f1993-12-28 19:39:56 +0000366depend:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000367 @for i in $(SUBDIRS); do \
368 (echo making depend in subdirectory $$i; cd $$i; \
369 $(MAKE) depend); \
Guido van Rossum810a92f1993-12-28 19:39:56 +0000370 done
Guido van Rossum627b2d71993-12-24 10:39:16 +0000371
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000372# Sanitation targets -- clean leaves libraries, executables and tags
373# files, which clobber removes those as well
374
Guido van Rossum627b2d71993-12-24 10:39:16 +0000375localclean:
376 -rm -f core *~ [@,#]* *.old *.orig *.rej
Guido van Rossum627b2d71993-12-24 10:39:16 +0000377
378clean: localclean
379 -for i in $(SUBDIRS); do \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000380 (echo making clean in subdirectory $$i; cd $$i; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000381 if test -f Makefile; \
382 then $(MAKE) clean; \
383 else $(MAKE) -f Makefile.*in clean; \
384 fi); \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000385 done
386
Guido van Rossum810a92f1993-12-28 19:39:56 +0000387localclobber: localclean
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000388 -rm -f tags TAGS python
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000389 -rm -f config.log config.cache config.h
Guido van Rossum810a92f1993-12-28 19:39:56 +0000390
391clobber: localclobber
Guido van Rossum627b2d71993-12-24 10:39:16 +0000392 -for i in $(SUBDIRS); do \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000393 (echo clobbering subdirectory $$i; cd $$i; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000394 if test -f Makefile; \
395 then $(MAKE) clobber; \
Guido van Rossum7b4d4601995-03-22 12:27:16 +0000396 else $(MAKE) -f $(srcdir)/Makefile.in clobber; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000397 fi); \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000398 done
399
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000400# Make things extra clean, before making a distribution:
401# remove all generated files, even Makefile[.pre]
Guido van Rossum627b2d71993-12-24 10:39:16 +0000402distclean: clobber
Guido van Rossum7b4d4601995-03-22 12:27:16 +0000403 -$(MAKE) -f $(srcdir)/Makefile.in \
404 SUBDIRS="$(SUBDIRSTOO)" clobber
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000405 -rm -f config.status config.log config.cache config.h Makefile
Guido van Rossume7abf4e1995-09-18 22:12:20 +0000406 -rm -f Modules/Makefile
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000407 -for i in $(SUBDIRS) $(SUBDIRSTOO); do \
408 for f in $$i/*.in; do \
409 f=`basename "$$f" .in`; \
410 if test "$$f" != "*"; then \
411 echo rm -f "$$i/$$f"; \
412 rm -f "$$i/$$f"; \
413 fi; \
414 done; \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000415 done
Guido van Rossum627b2d71993-12-24 10:39:16 +0000416
Guido van Rossum586480b1996-05-28 22:49:08 +0000417# Check for smelly exported symbols (not starting with Py/_Py)
418smelly: all
419 for i in $(SUBDIRS); do \
420 echo --- $$i ---; \
421 nm -p $$i/lib$$i.a | \
422 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
423 done
424
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000425# Find files with funny names
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000426funny:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000427 find $(DISTDIRS) -type d \
428 -o -name '*.[chs]' \
429 -o -name '*.py' \
430 -o -name '*.doc' \
431 -o -name '*.sty' \
432 -o -name '*.bib' \
433 -o -name '*.dat' \
434 -o -name '*.el' \
435 -o -name '*.fd' \
436 -o -name '*.in' \
437 -o -name '*.tex' \
438 -o -name '*,[vpt]' \
439 -o -name 'Setup' \
440 -o -name 'Setup.*' \
441 -o -name README \
442 -o -name Makefile \
443 -o -name ChangeLog \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000444 -o -name Repository \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000445 -o -name Root \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000446 -o -name Entries \
447 -o -name Tag \
448 -o -name tags \
449 -o -name TAGS \
450 -o -name .cvsignore \
451 -o -name MANIFEST \
452 -o -print