blob: e76172ab95d07a8a8be5ed4a4afedc4e54a57eaa [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
Guido van Rossumd266eb41996-10-25 14:44:06 +000012# Centrum or CWI or Corporation for National Research Initiatives or
13# CNRI not be used in advertising or publicity pertaining to
14# distribution of the software without specific, written prior
15# permission.
16#
17# While CWI is the initial source for this software, a modified version
18# is made available by the Corporation for National Research Initiatives
19# (CNRI) at the Internet address ftp://ftp.python.org.
20#
21# STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
22# REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
23# MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
24# CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
25# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
26# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
27# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28# PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum433c8ad1994-08-01 12:07:07 +000029########################################################################
Guido van Rossum627b2d71993-12-24 10:39:16 +000030
Guido van Rossum586480b1996-05-28 22:49:08 +000031# Top-level Makefile for Python
32#
33# As distributed, this file is called Makefile.in; it is processed
34# into the real Makefile by running the script ./configure, which
35# replaces things like @spam@ with values appropriate for your system.
36# This means that if you edit Makefile, your changes get lost the next
37# time you run the configure script. Ideally, you can do:
38#
39# ./configure
40# make
41# make test
42# make install
43#
44# The top-level Makefile invokes make recursively in a number of
45# subdirectories (see the SUBDIRS variable below). If you want to,
46# you can invoke make in individual subdirectories. However, the
47# sub-Makefiles are also generated by configure, and the quickest way
48# to make sure they are up to date is by running make (or "make
49# Makefiles") at the top level. This is particularly important for
50# Modules/Makefile, which has to be regenerated every time you edit
51# Modules/Setup. The python executable is built in the Modules
52# directory and then moved to the top-level directory. The recursive
53# makes pass three options to subordinate makes: OPT (a quick way to
Guido van Rossumb535da31996-07-30 18:04:22 +000054# change some compiler options; it usually defaults to -O), prefix and
Guido van Rossum586480b1996-05-28 22:49:08 +000055# exec_prefix (the installation paths).
56#
Guido van Rossumb535da31996-07-30 18:04:22 +000057# If you have a previous version of Python installed that you don't
58# want to overwrite, you can use "make altinstall" instead of "make
59# install". This changes the install procedure so it installs the
60# Python binary as "python<version>". The libraries and include files
61# are always installed in a subdirectory called "python<version>".
62# "make altinstall" does not install the manual page. If you want to
63# make this installation the "official" installation but want to keep
64# the old binary around "just in case", rename the installed python
65# binary to "python<oldversion>" before running "make install".
66# (This only works between different versions, e.g. 1.3 and 1.4 --
67# different betas of the same version will overwrite each other in
68# installation unless you override the VERSION Make variable.)
69#
Guido van Rossum64b65671996-07-30 20:42:12 +000070# In fact, "make install" or "make bininstall" installs the binary
71# as python<version> and makes a hard link to python, so when
72# installing a new version in the future, nothing of the current
73# version will be lost (except for the man page).
74#
Guido van Rossum586480b1996-05-28 22:49:08 +000075# If recursive makes fail, try invoking make as "make MAKE=make".
76#
77# See also the section "Build instructions" in the README file.
Guido van Rossum627b2d71993-12-24 10:39:16 +000078
Guido van Rossum3912fd81996-07-24 02:35:43 +000079# Interpreter version number, for library destination pathnames
Guido van Rossumf631d131997-01-22 03:45:38 +000080VERSION= 1.5
Guido van Rossum3912fd81996-07-24 02:35:43 +000081
Guido van Rossum433c8ad1994-08-01 12:07:07 +000082# Substitutions by configure
83srcdir= @srcdir@
84VPATH= @srcdir@
Guido van Rossum4a91df41994-10-10 17:58:27 +000085RANLIB= @RANLIB@
Guido van Rossum433c8ad1994-08-01 12:07:07 +000086
Guido van Rossumac405f61994-09-12 10:56:06 +000087# Machine-dependent subdirectories
88MACHDEP= @MACHDEP@
89
Guido van Rossum433c8ad1994-08-01 12:07:07 +000090# Install prefix for architecture-independent files
Guido van Rossum76be6ed1995-01-02 18:33:54 +000091prefix= @prefix@
Guido van Rossum433c8ad1994-08-01 12:07:07 +000092
93# Install prefix for architecture-dependent files
Guido van Rossum76be6ed1995-01-02 18:33:54 +000094exec_prefix= @exec_prefix@
Guido van Rossum433c8ad1994-08-01 12:07:07 +000095
Guido van Rossum90412791994-10-20 22:04:30 +000096# Expanded directories
Guido van Rossumb535da31996-07-30 18:04:22 +000097BINDIR= $(exec_prefix)/bin
98LIBDIR= $(exec_prefix)/lib
99MANDIR= $(prefix)/man
100INCLUDEDIR= $(prefix)/include
101SCRIPTDIR= $(prefix)/lib
Guido van Rossum90412791994-10-20 22:04:30 +0000102
Guido van Rossumbed23fe1996-07-31 17:30:37 +0000103# Detailed destination directories
104BINLIBDEST= $(LIBDIR)/python$(VERSION)
105LIBDEST= $(SCRIPTDIR)/python$(VERSION)
106INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
107LIBP= $(LIBDIR)/python$(VERSION)
108
Guido van Rossumac405f61994-09-12 10:56:06 +0000109# Symbols used for using shared libraries
110SO= @SO@
111LDSHARED= @LDSHARED@
112CCSHARED= @CCSHARED@
113LINKFORSHARED= @LINKFORSHARED@
Guido van Rossumbed23fe1996-07-31 17:30:37 +0000114DESTSHARED= $(BINLIBDEST)/sharedmodules
Guido van Rossumac405f61994-09-12 10:56:06 +0000115
Guido van Rossum586480b1996-05-28 22:49:08 +0000116# Shell used by make (some versions default to the login shell, which is bad)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000117SHELL= /bin/sh
118
Guido van Rossum586480b1996-05-28 22:49:08 +0000119# Portable install script (configure doesn't always guess right)
120INSTALL= @srcdir@/install-sh -c
Guido van Rossumb535da31996-07-30 18:04:22 +0000121INSTALL_PROGRAM=${INSTALL} -m 755
Guido van Rossum586480b1996-05-28 22:49:08 +0000122INSTALL_DATA= ${INSTALL} -m 644
123
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000124# --with-PACKAGE options for configure script
125# e.g. --with-readline --with-svr5 --with-solaris --with-thread
126# (see README for an explanation)
127WITH=
128
129# Compiler options passed to subordinate makes
Guido van Rossum4e8af441994-08-19 15:33:54 +0000130OPT= @OPT@
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000131
132# Subdirectories where to run make recursively
133SUBDIRS= Parser Objects Python Modules
134
135# Other subdirectories
Guido van Rossumb535da31996-07-30 18:04:22 +0000136SUBDIRSTOO= Include Lib Doc Misc Demo Grammar
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000137
138# Files and directories to be distributed
139CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.in
140DISTFILES= README ChangeLog $(CONFIGFILES)
141DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
142DIST= $(DISTFILES) $(DISTDIRS)
143
144# Default target
145all: python
146
147# Build the interpreter
Guido van Rossum4246edd1997-04-23 15:14:24 +0000148python: $(SUBDIRS)
149
150$(SUBDIRS): Makefiles
151
152Parser:
153 cd Parser ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
154 prefix="$(prefix)" exec_prefix="$(exec_prefix)" all
155
156Python:
157 cd Python ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
158 prefix="$(prefix)" exec_prefix="$(exec_prefix)" all
159
160Objects:
161 cd Objects ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
162 prefix="$(prefix)" exec_prefix="$(exec_prefix)" all
163
164Modules: Parser Python Objects
165 cd Modules ; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
166 prefix="$(prefix)" exec_prefix="$(exec_prefix)" all
Guido van Rossum810a92f1993-12-28 19:39:56 +0000167
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000168# Test the interpreter (twice, once without .pyc files, once with)
Guido van Rossumfde462e1997-01-11 19:59:17 +0000169TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/$(MACHDEP):$(srcdir)/Lib/test:./Modules
Barry Warsaw9121ab91997-01-02 20:01:44 +0000170TESTOPTS=
Guido van Rossum042a0511997-01-03 15:54:36 +0000171TESTPROG= $(srcdir)/Lib/test/regrtest.py
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000172test: python
173 -rm -f $(srcdir)/Lib/test/*.pyc
Barry Warsaw9121ab91997-01-02 20:01:44 +0000174 PYTHONPATH=$(TESTPATH) ./python $(TESTPROG) $(TESTOPTS)
175 PYTHONPATH=$(TESTPATH) ./python $(TESTPROG) $(TESTOPTS)
Guido van Rossum810a92f1993-12-28 19:39:56 +0000176
Guido van Rossum586480b1996-05-28 22:49:08 +0000177# Install everything
Guido van Rossum6d472981996-07-30 21:41:56 +0000178install: altinstall bininstall maninstall
Guido van Rossum586480b1996-05-28 22:49:08 +0000179
Guido van Rossum64b65671996-07-30 20:42:12 +0000180# Install almost everything without disturbing previous versions
Guido van Rossumb535da31996-07-30 18:04:22 +0000181altinstall: altbininstall libinstall inclinstall libainstall sharedinstall
Guido van Rossum3912fd81996-07-24 02:35:43 +0000182
Guido van Rossum64b65671996-07-30 20:42:12 +0000183# Install the interpreter (by creating a hard link to python$(VERSION))
184bininstall: altbininstall
185 -if test -f $(BINDIR)/python; \
186 then rm -f $(BINDIR)/python; \
187 else true; \
188 fi
189 (cd $(BINDIR); ln python$(VERSION) python)
Guido van Rossum810a92f1993-12-28 19:39:56 +0000190
Guido van Rossum3912fd81996-07-24 02:35:43 +0000191# Install the interpreter with $(VERSION) affixed
Guido van Rossum64b65671996-07-30 20:42:12 +0000192# This goes into $(exec_prefix)
Guido van Rossum3912fd81996-07-24 02:35:43 +0000193altbininstall: python
194 @for i in $(BINDIR); \
195 do \
196 if test ! -d $$i; then \
197 echo "Creating directory $$i"; \
198 mkdir $$i; \
199 chmod 755 $$i; \
200 else true; \
201 fi; \
202 done
203 $(INSTALL_PROGRAM) python $(BINDIR)/python$(VERSION)
204
Guido van Rossum586480b1996-05-28 22:49:08 +0000205# Install the manual page
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000206maninstall:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000207 @for i in $(MANDIR) $(MANDIR)/man1; \
Guido van Rossum586480b1996-05-28 22:49:08 +0000208 do \
209 if test ! -d $$i; then \
210 echo "Creating directory $$i"; \
211 mkdir $$i; \
212 chmod 755 $$i; \
213 else true; \
214 fi; \
215 done
Guido van Rossum6403d281995-01-20 16:51:32 +0000216 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
Guido van Rossum90412791994-10-20 22:04:30 +0000217 $(MANDIR)/man1/python.1
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000218
Guido van Rossumb535da31996-07-30 18:04:22 +0000219# Install the library
Guido van Rossumb8dccd21996-07-30 21:55:17 +0000220MACHDEPS= $(MACHDEP)
221LIBSUBDIRS= stdwin tkinter test $(MACHDEPS)
Guido van Rossum64b65671996-07-30 20:42:12 +0000222libinstall: python $(srcdir)/Lib/$(MACHDEP)
Guido van Rossumb535da31996-07-30 18:04:22 +0000223 @for i in $(SCRIPTDIR) $(LIBDEST); \
224 do \
225 if test ! -d $$i; then \
226 echo "Creating directory $$i"; \
227 mkdir $$i; \
228 chmod 755 $$i; \
229 else true; \
230 fi; \
231 done
232 @for d in $(LIBSUBDIRS); \
233 do \
234 a=$(srcdir)/Lib/$$d; \
235 if test ! -d $$a; then continue; else true; fi; \
236 b=$(LIBDEST)/$$d; \
237 if test ! -d $$b; then \
238 echo "Creating directory $$b"; \
239 mkdir $$b; \
240 chmod 755 $$b; \
241 else true; \
242 fi; \
243 done
244 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
245 do \
246 if test -x $$i; then \
247 $(INSTALL_PROGRAM) $$i $(LIBDEST); \
248 echo $(INSTALL_PROGRAM) $$i $(LIBDEST); \
249 else \
250 $(INSTALL_DATA) $$i $(LIBDEST); \
251 echo $(INSTALL_DATA) $$i $(LIBDEST); \
252 fi; \
253 done
254 @for d in $(LIBSUBDIRS); \
255 do \
256 a=$(srcdir)/Lib/$$d; \
257 if test ! -d $$a; then continue; else true; fi; \
258 b=$(LIBDEST)/$$d; \
259 for i in $$a/*; \
260 do \
261 case $$i in \
262 *CVS) ;; \
263 *.pyc) ;; \
264 *~) ;; \
265 *) \
266 if test -x $$i; then \
267 echo $(INSTALL_PROGRAM) $$i $$b; \
268 $(INSTALL_PROGRAM) $$i $$b; \
269 else \
270 echo $(INSTALL_DATA) $$i $$b; \
271 $(INSTALL_DATA) $$i $$b; \
272 fi;; \
273 esac; \
274 done; \
275 done
276 PYTHONPATH=$(LIBDEST) \
277 ./python $(LIBDEST)/compileall.py $(LIBDEST)
Fred Drakedb5a41f1997-03-13 14:14:29 +0000278 PYTHONPATH=$(LIBDEST) \
279 ./python -O $(LIBDEST)/compileall.py $(LIBDEST)
Guido van Rossumb535da31996-07-30 18:04:22 +0000280
Guido van Rossum64b65671996-07-30 20:42:12 +0000281# Create the MACHDEP source directory, if one wasn't distributed..
Guido van Rossumcda848f1996-08-21 20:18:29 +0000282$(srcdir)/Lib/$(MACHDEP):
Guido van Rossum64b65671996-07-30 20:42:12 +0000283 mkdir $(srcdir)/Lib/$(MACHDEP)
284 cp $(srcdir)/Lib/generic/regen $(srcdir)/Lib/$(MACHDEP)/regen
Guido van Rossum04831d11996-09-10 18:21:32 +0000285 export PATH; PATH="`pwd`:$$PATH"; \
Guido van Rossumf71bd681996-08-28 19:23:01 +0000286 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
Guido van Rossumfc8ebb11996-08-19 21:51:24 +0000287 cd $(srcdir)/Lib/$(MACHDEP); ./regen
Guido van Rossum64b65671996-07-30 20:42:12 +0000288
Guido van Rossum586480b1996-05-28 22:49:08 +0000289# Install the include files
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000290inclinstall:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000291 @for i in $(INCLUDEDIR) $(INCLUDEPY); \
Guido van Rossum586480b1996-05-28 22:49:08 +0000292 do \
293 if test ! -d $$i; then \
294 echo "Creating directory $$i"; \
295 mkdir $$i; \
296 chmod 755 $$i; \
297 else true; \
298 fi; \
299 done
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000300 @for i in $(srcdir)/Include/*.h; \
301 do \
302 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
303 $(INSTALL_DATA) $$i $(INCLUDEPY); \
304 done
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000305
Guido van Rossum586480b1996-05-28 22:49:08 +0000306# Install the lib*.a files and miscellaneous stuff needed by extensions
Guido van Rossum64b65671996-07-30 20:42:12 +0000307# This goes into $(exec_prefix)
Guido van Rossumb535da31996-07-30 18:04:22 +0000308LIBPL= $(LIBP)/config
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000309libainstall: all
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000310 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
Guido van Rossum586480b1996-05-28 22:49:08 +0000311 do \
312 if test ! -d $$i; then \
313 echo "Creating directory $$i"; \
314 mkdir $$i; \
315 chmod 755 $$i; \
316 else true; \
317 fi; \
318 done
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000319 @for i in $(SUBDIRS); do \
320 echo Installing in subdirectory $$i; \
Guido van Rossum586480b1996-05-28 22:49:08 +0000321 $(INSTALL_DATA) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \
Guido van Rossum4a91df41994-10-10 17:58:27 +0000322 $(RANLIB) $(LIBPL)/lib$$i.a; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000323 done
Guido van Rossum6403d281995-01-20 16:51:32 +0000324 $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
Guido van Rossum6d47d0d1995-08-07 21:58:40 +0000325 $(INSTALL_DATA) $(srcdir)/Modules/getpath.c $(LIBPL)/getpath.c
Guido van Rossum5ad7aaf1997-04-11 15:25:08 +0000326 $(INSTALL_DATA) $(srcdir)/Modules/getbuildinfo.c $(LIBPL)/getbuildinfo.c
Guido van Rossum6403d281995-01-20 16:51:32 +0000327 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
328 $(INSTALL_DATA) Modules/Makefile $(LIBPL)/Makefile
329 $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
Guido van Rossum70a86591996-07-21 02:46:47 +0000330 $(INSTALL_PROGRAM) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
Guido van Rossum6403d281995-01-20 16:51:32 +0000331 $(INSTALL_DATA) config.h $(LIBPL)/config.h
332 $(INSTALL_DATA) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c
Sjoerd Mullenderad5d2cf1995-08-09 09:18:20 +0000333 $(INSTALL_DATA) Modules/main.o $(LIBPL)/main.o
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000334
Guido van Rossum586480b1996-05-28 22:49:08 +0000335# Install the dynamically loadable modules
Guido van Rossum64b65671996-07-30 20:42:12 +0000336# This goes into $(exec_prefix)
Guido van Rossumac405f61994-09-12 10:56:06 +0000337sharedinstall:
338 cd Modules; $(MAKE) \
339 OPT="$(OPT)" \
Guido van Rossumb535da31996-07-30 18:04:22 +0000340 VERSION="$(VERSION)" \
Guido van Rossumac405f61994-09-12 10:56:06 +0000341 SO="$(SO)" \
342 LDSHARED="$(LDSHARED)" \
343 CCSHARED="$(CCSHARED)" \
344 LINKFORSHARED="$(LINKFORSHARED)" \
345 DESTSHARED="$(DESTSHARED)" \
Guido van Rossum3912fd81996-07-24 02:35:43 +0000346 prefix="$(prefix)" \
347 exec_prefix="$(exec_prefix)" \
Guido van Rossumac405f61994-09-12 10:56:06 +0000348 sharedinstall
349
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000350# Build the sub-Makefiles
Guido van Rossumd09119e1995-01-17 16:45:08 +0000351Makefiles: config.status Modules/Makefile.pre
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000352 (cd Modules; $(MAKE) -f Makefile.pre Makefile)
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000353 @for i in . $(SUBDIRS); do \
354 (echo making Makefile in subdirectory $$i; cd $$i; \
355 $(MAKE) Makefile); \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000356 done
357
Guido van Rossumd09119e1995-01-17 16:45:08 +0000358# Build the intermediate Makefile in Modules
359Modules/Makefile.pre: config.status
360 $(SHELL) config.status
361
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000362# Build the toplevel Makefile
363Makefile: Makefile.in config.status
364 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status
365
366# Run the configure script. If config.status already exists,
367# call it with the --recheck argument, which reruns configure with the
368# same options as it was run last time; otherwise run the configure
369# script with options taken from the $(WITH) variable
370config.status: $(srcdir)/configure
371 if test -f config.status; \
372 then $(SHELL) config.status --recheck; \
Guido van Rossumfb00a991995-01-12 12:26:50 +0000373 $(SHELL) config.status; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000374 else $(SHELL) $(srcdir)/configure $(WITH); \
375 fi
376
377.PRECIOUS: config.status python
378
379# Rerun configure with the same options as it was run last time,
380# provided the config.status script exists
381recheck:
382 $(SHELL) config.status --recheck
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000383 $(SHELL) config.status
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000384
385# Rebuild the configure script from configure.in; also rebuild config.h.in
386autoconf:
Guido van Rossum00682671996-06-28 20:15:41 +0000387 (cd $(srcdir); autoconf)
388 (cd $(srcdir); autoheader)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000389
390# Create a tags file for vi
391tags::
392 ctags -w -t Include/*.h
393 for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
394 sort tags -o tags
395
396# Create a tags file for GNU Emacs
397TAGS::
Guido van Rossum5552eb71994-08-05 15:51:00 +0000398 etags Include/*.h
399 for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000400
401# Add dependencies to sub-Makefiles
Guido van Rossum810a92f1993-12-28 19:39:56 +0000402depend:
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000403 @for i in $(SUBDIRS); do \
404 (echo making depend in subdirectory $$i; cd $$i; \
405 $(MAKE) depend); \
Guido van Rossum810a92f1993-12-28 19:39:56 +0000406 done
Guido van Rossum627b2d71993-12-24 10:39:16 +0000407
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000408# Sanitation targets -- clean leaves libraries, executables and tags
409# files, which clobber removes those as well
410
Guido van Rossum627b2d71993-12-24 10:39:16 +0000411localclean:
412 -rm -f core *~ [@,#]* *.old *.orig *.rej
Guido van Rossum627b2d71993-12-24 10:39:16 +0000413
414clean: localclean
415 -for i in $(SUBDIRS); do \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000416 (echo making clean in subdirectory $$i; cd $$i; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000417 if test -f Makefile; \
418 then $(MAKE) clean; \
419 else $(MAKE) -f Makefile.*in clean; \
420 fi); \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000421 done
422
Guido van Rossum810a92f1993-12-28 19:39:56 +0000423localclobber: localclean
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000424 -rm -f tags TAGS python
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000425 -rm -f config.log config.cache config.h
Guido van Rossum810a92f1993-12-28 19:39:56 +0000426
427clobber: localclobber
Guido van Rossum627b2d71993-12-24 10:39:16 +0000428 -for i in $(SUBDIRS); do \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000429 (echo clobbering subdirectory $$i; cd $$i; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000430 if test -f Makefile; \
431 then $(MAKE) clobber; \
Guido van Rossum7b4d4601995-03-22 12:27:16 +0000432 else $(MAKE) -f $(srcdir)/Makefile.in clobber; \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000433 fi); \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000434 done
435
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000436# Make things extra clean, before making a distribution:
437# remove all generated files, even Makefile[.pre]
Guido van Rossum627b2d71993-12-24 10:39:16 +0000438distclean: clobber
Guido van Rossum7b4d4601995-03-22 12:27:16 +0000439 -$(MAKE) -f $(srcdir)/Makefile.in \
440 SUBDIRS="$(SUBDIRSTOO)" clobber
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000441 -rm -f config.status config.log config.cache config.h Makefile
Guido van Rossume7abf4e1995-09-18 22:12:20 +0000442 -rm -f Modules/Makefile
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000443 -for i in $(SUBDIRS) $(SUBDIRSTOO); do \
444 for f in $$i/*.in; do \
445 f=`basename "$$f" .in`; \
446 if test "$$f" != "*"; then \
447 echo rm -f "$$i/$$f"; \
448 rm -f "$$i/$$f"; \
449 fi; \
450 done; \
Guido van Rossum627b2d71993-12-24 10:39:16 +0000451 done
Guido van Rossum627b2d71993-12-24 10:39:16 +0000452
Guido van Rossum586480b1996-05-28 22:49:08 +0000453# Check for smelly exported symbols (not starting with Py/_Py)
454smelly: all
455 for i in $(SUBDIRS); do \
456 echo --- $$i ---; \
457 nm -p $$i/lib$$i.a | \
458 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
459 done
460
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000461# Find files with funny names
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000462funny:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000463 find $(DISTDIRS) -type d \
464 -o -name '*.[chs]' \
465 -o -name '*.py' \
466 -o -name '*.doc' \
467 -o -name '*.sty' \
468 -o -name '*.bib' \
469 -o -name '*.dat' \
470 -o -name '*.el' \
471 -o -name '*.fd' \
472 -o -name '*.in' \
473 -o -name '*.tex' \
474 -o -name '*,[vpt]' \
475 -o -name 'Setup' \
476 -o -name 'Setup.*' \
477 -o -name README \
478 -o -name Makefile \
479 -o -name ChangeLog \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000480 -o -name Repository \
Guido van Rossumbfc1bbe1996-06-20 14:30:38 +0000481 -o -name Root \
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000482 -o -name Entries \
483 -o -name Tag \
484 -o -name tags \
485 -o -name TAGS \
486 -o -name .cvsignore \
487 -o -name MANIFEST \
488 -o -print