Makefile.in 17.9 KB
Newer Older
1
########################################################################
2 3 4
# Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
# The Netherlands.
#
5
#                         All Rights Reserved
6 7 8
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
9
# provided that the above copyright notice appear in all copies and that
10
# both that copyright notice and this permission notice appear in
11
# supporting documentation, and that the names of Stichting Mathematisch
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# Centrum or CWI or Corporation for National Research Initiatives or
# CNRI not be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission.
# 
# While CWI is the initial source for this software, a modified version
# is made available by the Corporation for National Research Initiatives
# (CNRI) at the Internet address ftp://ftp.python.org.
# 
# STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
# CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
29
########################################################################
Guido van Rossum's avatar
Guido van Rossum committed
30

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
# Top-level Makefile for Python
# 
# As distributed, this file is called Makefile.in; it is processed
# into the real Makefile by running the script ./configure, which
# replaces things like @spam@ with values appropriate for your system.
# This means that if you edit Makefile, your changes get lost the next
# time you run the configure script.  Ideally, you can do:
# 
#	./configure
#	make
#	make test
#	make install
# 
# The top-level Makefile invokes make recursively in a number of
# subdirectories (see the SUBDIRS variable below).  If you want to,
# you can invoke make in individual subdirectories.  However, the
# sub-Makefiles are also generated by configure, and the quickest way
# to make sure they are up to date is by running make (or "make
# Makefiles") at the top level.  This is particularly important for
# Modules/Makefile, which has to be regenerated every time you edit
# Modules/Setup.  The python executable is built in the Modules
# directory and then moved to the top-level directory.  The recursive
# makes pass three options to subordinate makes: OPT (a quick way to
54
# change some compiler options; it usually defaults to -O), prefix and
55 56
# exec_prefix (the installation paths).
# 
57 58 59 60 61 62 63 64 65 66 67 68 69
# If you have a previous version of Python installed that you don't
# want to overwrite, you can use "make altinstall" instead of "make
# install".  This changes the install procedure so it installs the
# Python binary as "python<version>".  The libraries and include files
# are always installed in a subdirectory called "python<version>".
# "make altinstall" does not install the manual page.  If you want to
# make this installation the "official" installation but want to keep
# the old binary around "just in case", rename the installed python
# binary to "python<oldversion>" before running "make install".
# (This only works between different versions, e.g. 1.3 and 1.4 --
# different betas of the same version will overwrite each other in
# installation unless you override the VERSION Make variable.)
# 
70 71 72 73 74
# In fact, "make install" or "make bininstall" installs the binary
# as python<version> and makes a hard link to python, so when
# installing a new version in the future, nothing of the current
# version will be lost (except for the man page).
# 
75 76 77
# If recursive makes fail, try invoking make as "make MAKE=make".
# 
# See also the section "Build instructions" in the README file.
Guido van Rossum's avatar
Guido van Rossum committed
78

79
# Substitutions by configure
80
VERSION=	@VERSION@
81 82
srcdir=		@srcdir@
VPATH=		@srcdir@
83
CC=		@CC@
84
AR=		@AR@
85
RANLIB=		@RANLIB@
86
DEFS=		@DEFS@
87

88 89 90
# Machine-dependent subdirectories
MACHDEP=	@MACHDEP@

91
# Install prefix for architecture-independent files
92
prefix=		@prefix@
93 94

# Install prefix for architecture-dependent files
95
exec_prefix=	@exec_prefix@
96

97
# Expanded directories
98 99 100 101
BINDIR=		$(exec_prefix)/bin
LIBDIR=		$(exec_prefix)/lib
MANDIR=		$(prefix)/man
INCLUDEDIR=	$(prefix)/include
102
CONFINCLUDEDIR=	$(exec_prefix)/include
103
SCRIPTDIR=	$(prefix)/lib
104

105 106 107 108
# Detailed destination directories
BINLIBDEST=	$(LIBDIR)/python$(VERSION)
LIBDEST=	$(SCRIPTDIR)/python$(VERSION)
INCLUDEPY=	$(INCLUDEDIR)/python$(VERSION)
109
CONFINCLUDEPY=	$(CONFINCLUDEDIR)/python$(VERSION)
110 111
LIBP=		$(LIBDIR)/python$(VERSION)

112 113 114 115 116
# Symbols used for using shared libraries
SO=		@SO@
LDSHARED=	@LDSHARED@
CCSHARED=	@CCSHARED@
LINKFORSHARED=	@LINKFORSHARED@
117
DESTSHARED=	$(BINLIBDEST)/lib-dynload
118

119
# Shell used by make (some versions default to the login shell, which is bad)
120 121
SHELL=		/bin/sh

122 123 124
# Use ``EXE=.exe'' for Unix emulations on DOS/Windows (e.g. GNUWIN32)
EXE=

125 126 127 128 129 130 131
# Modes for directories, executables and data files created by the
# install process.  Default to group-writable directories but
# user-only-writable for executables and data files.
DIRMODE=	775
EXEMODE=	755
FILEMODE=	644

132 133
# Portable install script (configure doesn't always guess right)
INSTALL=	@srcdir@/install-sh -c
134 135
INSTALL_PROGRAM=${INSTALL} -m $(EXEMODE)
INSTALL_DATA=	${INSTALL} -m $(FILEMODE)
136

137 138 139
# Use this to make a link between python$(VERSION) and python in $(BINDIR)
LN=@LN@

140 141 142 143 144 145
# --with-PACKAGE options for configure script
# e.g. --with-readline --with-svr5 --with-solaris --with-thread
# (see README for an explanation)
WITH=		

# Compiler options passed to subordinate makes
146
OPT=		@OPT@
147 148 149 150 151

# Subdirectories where to run make recursively
SUBDIRS=	Parser Objects Python Modules

# Other subdirectories
152
SUBDIRSTOO=	Include Lib Misc Demo Grammar
153 154 155 156 157 158 159

# Files and directories to be distributed
CONFIGFILES=	configure configure.in acconfig.h config.h.in Makefile.in
DISTFILES=	README ChangeLog $(CONFIGFILES)
DISTDIRS=	$(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
DIST=		$(DISTFILES) $(DISTDIRS)

160 161 162
# Compilation flags for getbuildinfo.c only
CFLAGS=		$(OPT) -I. $(DEFS)

163
LIBRARY=	libpython$(VERSION).a
164
LDLIBRARY=      @LDLIBRARY@
165

166
# Default target
167
all:		$(LIBRARY) python$(EXE) sharedmods
168 169

# Build the interpreter
170
python$(EXE):		$(LIBRARY) buildno Modules/python.o
171 172
		expr `cat buildno` + 1 >buildno1
		mv -f buildno1 buildno
173 174 175 176
		$(CC) -c $(CFLAGS) -DBUILD=`cat buildno` \
		      $(srcdir)/Modules/getbuildinfo.c
		$(AR) cr $(LIBRARY) getbuildinfo.o
		$(RANLIB) $(LIBRARY)
177
		@MAKE_LDLIBRARY@
178 179
		cd Modules;  $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
			prefix="$(prefix)" exec_prefix="$(exec_prefix)" \
180
			LIBRARY=../$(LDLIBRARY) link
181

182 183 184
Modules/python.o: $(srcdir)/Modules/python.c
		cd Modules; $(MAKE) OPT="$(OPT)" python.o

185 186 187
buildno:
		echo 0 >buildno

188
# Build the shared modules
189
sharedmods: 	python$(EXE)
190 191 192 193
		cd Modules;  $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
			prefix="$(prefix)" exec_prefix="$(exec_prefix)" \
			sharedmods

194 195 196 197 198 199 200
# Build the library
$(LIBRARY):	$(SUBDIRS)
		if test ! -f $(LIBRARY); \
		then for i in $(SUBDIRS); do rm -f $$i/add2lib; done; true; \
		else true; fi
		for i in $(SUBDIRS); do \
			(cd $$i; $(MAKE) VERSION="$(VERSION)" add2lib); done
201

202 203
# This rule is only here for DG/UX!!!
libpython$(VERSION).so:	$(LIBRARY)
204 205 206 207 208 209 210
		case `uname -s | tr -d '/ ' | tr '[A-Z]' '[a-z]'` in \
		*dgux*) \
		    test -d dgux || mkdir dgux; \
		    (cd dgux;ar x ../$^;ld -G -o ../$@ * ); \
		    /bin/rm -rf ./dgux \
		    ;; \
		esac
211

212 213 214 215
# This rule is here for OPENSTEP/Rhapsody/MacOSX
libpython$(VERSION).dylib: $(LIBRARY)
		libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) -framework System @LIBTOOL_CRUFT@ 

216 217 218 219 220 221 222 223 224 225 226 227 228 229
$(SUBDIRS):	Makefiles

Parser:
		cd Parser ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
			prefix="$(prefix)" exec_prefix="$(exec_prefix)" all

Python:
		cd Python ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
			prefix="$(prefix)" exec_prefix="$(exec_prefix)" all

Objects:
		cd Objects ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
			prefix="$(prefix)" exec_prefix="$(exec_prefix)" all

230
Modules:	Parser Python Objects
231 232
		cd Modules ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
			prefix="$(prefix)" exec_prefix="$(exec_prefix)" all
233 234

# Test the interpreter (twice, once without .pyc files, once with)
235
TESTOPTS=	
236
TESTPROG=	$(srcdir)/Lib/test/regrtest.py
237
TESTPYTHON=	./python$(EXE)
238
test:		all
239
		-rm -f $(srcdir)/Lib/test/*.py[co]
240 241
		-PYTHONPATH= $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
		PYTHONPATH= $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
242

243
# Install everything
244
install:	altinstall bininstall maninstall
245

246
# Install almost everything without disturbing previous versions
247
altinstall:	altbininstall libinstall inclinstall libainstall sharedinstall
248

249 250
# Install the interpreter (by creating a hard link to python$(VERSION))
bininstall:	altbininstall
251 252
		-if test -f $(BINDIR)/python$(EXE); \
		then rm -f $(BINDIR)/python$(EXE); \
253 254
		else true; \
		fi
255
		(cd $(BINDIR); $(LN) python$(VERSION)$(EXE) python$(EXE))
256

257
# Install the interpreter with $(VERSION) affixed
258
# This goes into $(exec_prefix)
259
altbininstall:	python$(EXE)
260 261 262 263 264
		@for i in $(BINDIR); \
		do \
			if test ! -d $$i; then \
				echo "Creating directory $$i"; \
				mkdir $$i; \
265
				chmod $(DIRMODE) $$i; \
266 267 268
			else	true; \
			fi; \
		done
269
		$(INSTALL_PROGRAM) python$(EXE) $(BINDIR)/python$(VERSION)$(EXE)
270 271 272 273
		if test -f libpython$(VERSION).so; then \
			$(INSTALL_DATA) libpython$(VERSION).so $(LIBDIR); \
		else	true; \
		fi
274

275 276 277
# Install the manual page
maninstall:
		@for i in $(MANDIR) $(MANDIR)/man1; \
278 279 280 281
		do \
			if test ! -d $$i; then \
				echo "Creating directory $$i"; \
				mkdir $$i; \
282
				chmod $(DIRMODE) $$i; \
283 284 285
			else	true; \
			fi; \
		done
286 287
		$(INSTALL_DATA) $(srcdir)/Misc/python.man \
			$(MANDIR)/man1/python.1
288

289
# Install the library
290 291
PLATDIR=	plat-$(MACHDEP)
MACHDEPS=	$(PLATDIR)
292
LIBSUBDIRS=	lib-stdwin lib-tk test test/output $(MACHDEPS)
293
libinstall:	python $(srcdir)/Lib/$(PLATDIR)
294
		@for i in $(SCRIPTDIR) $(LIBDEST); \
295 296 297 298
		do \
			if test ! -d $$i; then \
				echo "Creating directory $$i"; \
				mkdir $$i; \
299
				chmod $(DIRMODE) $$i; \
300 301 302
			else	true; \
			fi; \
		done
303 304 305 306 307 308 309 310
		@for d in $(LIBSUBDIRS); \
		do \
			a=$(srcdir)/Lib/$$d; \
			if test ! -d $$a; then continue; else true; fi; \
			b=$(LIBDEST)/$$d; \
			if test ! -d $$b; then \
				echo "Creating directory $$b"; \
				mkdir $$b; \
311
				chmod $(DIRMODE) $$b; \
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
			else	true; \
			fi; \
		done
		@for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
		do \
			if test -x $$i; then \
				$(INSTALL_PROGRAM) $$i $(LIBDEST); \
				echo $(INSTALL_PROGRAM) $$i $(LIBDEST); \
			else \
				$(INSTALL_DATA) $$i $(LIBDEST); \
				echo $(INSTALL_DATA) $$i $(LIBDEST); \
			fi; \
		done
		@for d in $(LIBSUBDIRS); \
		do \
			a=$(srcdir)/Lib/$$d; \
			if test ! -d $$a; then continue; else true; fi; \
			b=$(LIBDEST)/$$d; \
			for i in $$a/*; \
			do \
				case $$i in \
				*CVS) ;; \
334
				*.py[co]) ;; \
335 336
				*~) ;; \
				*) \
337
					if test -d $$i; then continue; fi; \
338 339 340 341 342 343 344 345 346 347 348
					if test -x $$i; then \
					    echo $(INSTALL_PROGRAM) $$i $$b; \
					    $(INSTALL_PROGRAM) $$i $$b; \
					else \
					    echo $(INSTALL_DATA) $$i $$b; \
					    $(INSTALL_DATA) $$i $$b; \
					fi;; \
				esac; \
			done; \
		done
		PYTHONPATH=$(LIBDEST) \
349
			./python$(EXE) $(LIBDEST)/compileall.py $(LIBDEST)
Fred Drake's avatar
Fred Drake committed
350
		PYTHONPATH=$(LIBDEST) \
351
			./python$(EXE) -O $(LIBDEST)/compileall.py $(LIBDEST)
352

353 354 355 356
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
		mkdir $(srcdir)/Lib/$(PLATDIR)
		cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
357
		export PATH; PATH="`pwd`:$$PATH"; \
358
		export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
359
		cd $(srcdir)/Lib/$(PLATDIR); ./regen
360

361
# Install the include files
362
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
363
inclinstall:
364
		@for i in $(INCLDIRSTOMAKE); \
365 366 367 368
		do \
			if test ! -d $$i; then \
				echo "Creating directory $$i"; \
				mkdir $$i; \
369
				chmod $(DIRMODE) $$i; \
370 371 372
			else	true; \
			fi; \
		done
373 374 375 376 377
		@for i in $(srcdir)/Include/*.h; \
		do \
			echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
			$(INSTALL_DATA) $$i $(INCLUDEPY); \
		done
378
		$(INSTALL_DATA) config.h $(CONFINCLUDEPY)/config.h
379

380
# Install the library and miscellaneous stuff needed for extending/embedding
381
# This goes into $(exec_prefix)
382
LIBPL=		$(LIBP)/config
383
libainstall:	all
384
		@for i in $(LIBDIR) $(LIBP) $(LIBPL); \
385 386 387 388
		do \
			if test ! -d $$i; then \
				echo "Creating directory $$i"; \
				mkdir $$i; \
389
				chmod $(DIRMODE) $$i; \
390 391 392
			else	true; \
			fi; \
		done
393 394 395 396
		@if [ "$(MACHDEP)" != "beos" ] ; then \
			$(INSTALL_DATA) $(LIBRARY) $(LIBPL)/$(LIBRARY) ; \
			$(RANLIB) $(LIBPL)/$(LIBRARY) ; \
		fi
397
		$(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
398
		$(INSTALL_DATA) Modules/python.o $(LIBPL)/python.o
399 400 401
		$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
		$(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile
		$(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
402
		$(INSTALL_DATA) Modules/Setup.local $(LIBPL)/Setup.local
403
		$(INSTALL_DATA) Modules/Setup.thread $(LIBPL)/Setup.thread
404
		$(INSTALL_PROGRAM) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
405
		$(INSTALL_PROGRAM) $(srcdir)/install-sh $(LIBPL)/install-sh
406
		$(INSTALL_DATA) $(srcdir)/Misc/Makefile.pre.in $(LIBPL)/Makefile.pre.in
407
		@if [ -s Modules/python.exp -a \
408
			"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
409 410 411 412 413 414 415 416 417 418 419 420 421
			echo; echo "Installing support files for building shared extension modules on AIX:"; \
			$(INSTALL_DATA) Modules/python.exp		\
					$(LIBPL)/python.exp;		\
			echo; echo "$(LIBPL)/python.exp";		\
			$(INSTALL_PROGRAM) $(srcdir)/Modules/makexp_aix	\
					$(LIBPL)/makexp_aix;		\
			echo "$(LIBPL)/makexp_aix";			\
			$(INSTALL_PROGRAM) $(srcdir)/Modules/ld_so_aix	\
					$(LIBPL)/ld_so_aix;		\
			echo "$(LIBPL)/ld_so_aix";			\
			echo; echo "See Misc/AIX-NOTES for details.";	\
		else true; \
		fi
422

423
# Install the dynamically loadable modules
424
# This goes into $(exec_prefix)
425 426 427
sharedinstall:
		cd Modules; $(MAKE) \
			OPT="$(OPT)" \
428
			VERSION="$(VERSION)" \
429 430 431 432 433
			SO="$(SO)" \
			LDSHARED="$(LDSHARED)" \
			CCSHARED="$(CCSHARED)" \
			LINKFORSHARED="$(LINKFORSHARED)" \
			DESTSHARED="$(DESTSHARED)" \
434 435
			prefix="$(prefix)" \
			exec_prefix="$(exec_prefix)" \
436 437
			sharedinstall

438
# Build the sub-Makefiles
439
Makefiles:	config.status Modules/Makefile.pre
440
		(cd Modules; $(MAKE) -f Makefile.pre Makefile)
441 442 443
		@for i in . $(SUBDIRS); do \
			(echo making Makefile in subdirectory $$i; cd $$i; \
			 $(MAKE) Makefile); \
444
		done
445
		-(rm -f Modules/hassignal; cd Modules; $(MAKE) hassignal)
446

447 448 449 450
# Build the intermediate Makefile in Modules
Modules/Makefile.pre: config.status
		$(SHELL) config.status

451 452 453 454 455 456 457 458 459 460 461
# Build the toplevel Makefile
Makefile:	Makefile.in config.status
		CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status

# Run the configure script.  If config.status already exists,
# call it with the --recheck argument, which reruns configure with the
# same options as it was run last time; otherwise run the configure
# script with options taken from the $(WITH) variable
config.status:	$(srcdir)/configure
		if test -f config.status; \
		then $(SHELL) config.status --recheck; \
462
		     $(SHELL) config.status; \
463 464 465
		else $(SHELL) $(srcdir)/configure $(WITH); \
		fi

466
.PRECIOUS:	config.status python$(EXE)
467

468 469 470 471
# Rerun configure with the same options as it was run last time,
# provided the config.status script exists
recheck:
		$(SHELL) config.status --recheck
472
		$(SHELL) config.status
473

474 475
# Rebuild the configure script from configure.in; also rebuild config.h.in
autoconf:
476 477
		(cd $(srcdir); autoconf)
		(cd $(srcdir); autoheader)
478 479 480 481 482 483 484 485 486

# Create a tags file for vi
tags::
		ctags -w -t Include/*.h
		for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
		sort tags -o tags

# Create a tags file for GNU Emacs
TAGS::
487 488
		etags Include/*.h
		for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
489 490

# Add dependencies to sub-Makefiles
491
depend:
492 493 494
		@for i in $(SUBDIRS); do \
			(echo making depend in subdirectory $$i; cd $$i; \
			 $(MAKE) depend); \
495
		done
Guido van Rossum's avatar
Guido van Rossum committed
496

497 498 499
# Sanitation targets -- clean leaves libraries, executables and tags
# files, which clobber removes those as well

Guido van Rossum's avatar
Guido van Rossum committed
500 501 502 503 504
localclean:
		-rm -f core *~ [@,#]* *.old *.orig *.rej

clean:		localclean
		-for i in $(SUBDIRS); do \
505
		    if test -d $$i; then \
506
			(echo making clean in subdirectory $$i; cd $$i; \
507 508 509 510
			 if test -f Makefile; \
			 then $(MAKE) clean; \
			 else $(MAKE) -f Makefile.*in clean; \
			 fi); \
511
		    else true; fi; \
Guido van Rossum's avatar
Guido van Rossum committed
512 513
		done

514
localclobber:	localclean
515
		-rm -f tags TAGS python$(EXE) $(LIBRARY) $(LDLIBRARY) *.o
516
		-rm -f config.log config.cache config.h
517 518

clobber:	localclobber
Guido van Rossum's avatar
Guido van Rossum committed
519
		-for i in $(SUBDIRS); do \
520
		    if test -d $$i; then \
521
			(echo clobbering subdirectory $$i; cd $$i; \
522 523
			 if test -f Makefile; \
			 then $(MAKE) clobber; \
524
			 else $(MAKE) -f $(srcdir)/Makefile*.in clobber; \
525
			 fi); \
526
		    else true; fi; \
Guido van Rossum's avatar
Guido van Rossum committed
527 528
		done

529 530
# Make things extra clean, before making a distribution:
# remove all generated files, even Makefile[.pre]
Guido van Rossum's avatar
Guido van Rossum committed
531
distclean:	clobber
Guido van Rossum's avatar
Guido van Rossum committed
532 533
		-$(MAKE) -f $(srcdir)/Makefile.in \
			SUBDIRS="$(SUBDIRSTOO)" clobber
534
		-rm -f config.status config.log config.cache config.h Makefile
535
		-rm -f buildno
536
		-rm -f Modules/Makefile
537 538 539 540 541 542 543 544
		-for i in $(SUBDIRS) $(SUBDIRSTOO); do \
			 for f in $$i/*.in; do \
				f=`basename "$$f" .in`; \
			 	if test "$$f" != "*"; then \
					echo rm -f "$$i/$$f"; \
				 	rm -f "$$i/$$f"; \
				fi; \
			 done; \
Guido van Rossum's avatar
Guido van Rossum committed
545 546
		done

547 548 549 550 551 552 553 554
# Check for smelly exported symbols (not starting with Py/_Py)
smelly: all
	for i in $(SUBDIRS); do \
		echo --- $$i ---; \
		nm -p $$i/lib$$i.a | \
		sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
	done

555
# Find files with funny names
556
funny:
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
		find $(DISTDIRS) -type d \
			-o -name '*.[chs]' \
			-o -name '*.py' \
			-o -name '*.doc' \
			-o -name '*.sty' \
			-o -name '*.bib' \
			-o -name '*.dat' \
			-o -name '*.el' \
			-o -name '*.fd' \
			-o -name '*.in' \
			-o -name '*.tex' \
			-o -name '*,[vpt]' \
			-o -name 'Setup' \
			-o -name 'Setup.*' \
			-o -name README \
			-o -name Makefile \
			-o -name ChangeLog \
			-o -name Repository \
575
			-o -name Root \
576 577 578 579 580 581 582
			-o -name Entries \
			-o -name Tag \
			-o -name tags \
			-o -name TAGS \
			-o -name .cvsignore \
			-o -name MANIFEST \
			-o -print