blob: 80fc894a6816c3104552426817433621b652d280 [file] [log] [blame]
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001# Top-level Makefile for Python
Guido van Rossum7cb32ae2001-08-17 15:32:31 +00002#
Neil Schemenauer85515ad2001-01-24 17:11:43 +00003# As distributed, this file is called Makefile.pre.in; it is processed
4# into the real Makefile by running the script ./configure, which
5# replaces things like @spam@ with values appropriate for your system.
6# This means that if you edit Makefile, your changes get lost the next
7# time you run the configure script. Ideally, you can do:
Guido van Rossum7cb32ae2001-08-17 15:32:31 +00008#
Neil Schemenauer85515ad2001-01-24 17:11:43 +00009# ./configure
10# make
11# make test
12# make install
Guido van Rossum7cb32ae2001-08-17 15:32:31 +000013#
Neil Schemenauer85515ad2001-01-24 17:11:43 +000014# If you have a previous version of Python installed that you don't
15# want to overwrite, you can use "make altinstall" instead of "make
Neil Schemenauer2b2681a2001-02-16 04:16:34 +000016# install". Refer to the "Installing" section in the README file for
17# additional details.
Guido van Rossum7cb32ae2001-08-17 15:32:31 +000018#
Neil Schemenauer85515ad2001-01-24 17:11:43 +000019# See also the section "Build instructions" in the README file.
20
21# === Variables set by makesetup ===
22
23MODOBJS= _MODOBJS_
24MODLIBS= _MODLIBS_
25
26# === Variables set by configure
27VERSION= @VERSION@
28srcdir= @srcdir@
29VPATH= @srcdir@
30
31CC= @CC@
32CXX= @CXX@
33LINKCC= @LINKCC@
34AR= @AR@
35RANLIB= @RANLIB@
36
37# Shell used by make (some versions default to the login shell, which is bad)
38SHELL= /bin/sh
39
40# Use this to make a link between python$(VERSION) and python in $(BINDIR)
41LN= @LN@
42
43# Portable install script (configure doesn't always guess right)
44INSTALL= @INSTALL@
45INSTALL_PROGRAM=@INSTALL_PROGRAM@
Neil Schemenauer3f5cc202001-04-10 23:03:35 +000046INSTALL_SCRIPT= @INSTALL_SCRIPT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000047INSTALL_DATA= @INSTALL_DATA@
48# Shared libraries must be installed with executable mode on some systems;
49# rather than figuring out exactly which, we always give them executable mode.
50# Also, making them read-only seems to be a good idea...
51INSTALL_SHARED= ${INSTALL} -m 555
52
53MAKESETUP= $(srcdir)/Modules/makesetup
54
55# Compiler options
56OPT= @OPT@
Skip Montanarodecc6a42003-01-01 20:07:49 +000057BASECFLAGS= @BASECFLAGS@
Brett Cannon08cd5982005-04-24 22:26:38 +000058CFLAGS= $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)
Brett Cannon516592f2004-12-07 00:42:59 +000059# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
60# be able to build extension modules using the directories specified in the
61# environment variables
62CPPFLAGS= -I. -I$(srcdir)/Include @CPPFLAGS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000063LDFLAGS= @LDFLAGS@
64LDLAST= @LDLAST@
65SGI_ABI= @SGI_ABI@
Neil Schemenauer7ac954b2001-01-26 16:14:41 +000066CCSHARED= @CCSHARED@
67LINKFORSHARED= @LINKFORSHARED@
68# Extra C flags added for building the interpreter object files.
69CFLAGSFORSHARED=@CFLAGSFORSHARED@
70# C flags used for building the interpreter object files
Mark Hammond8235ea12002-07-19 06:55:41 +000071PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
Neil Schemenauer7ac954b2001-01-26 16:14:41 +000072
Neil Schemenauer85515ad2001-01-24 17:11:43 +000073
74# Machine-dependent subdirectories
75MACHDEP= @MACHDEP@
76
77# Install prefix for architecture-independent files
78prefix= @prefix@
79
80# Install prefix for architecture-dependent files
81exec_prefix= @exec_prefix@
82
83# Expanded directories
84BINDIR= $(exec_prefix)/bin
85LIBDIR= $(exec_prefix)/lib
Martin v. Löwisd429ab62001-08-02 06:20:20 +000086MANDIR= @mandir@
87INCLUDEDIR= @includedir@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000088CONFINCLUDEDIR= $(exec_prefix)/include
89SCRIPTDIR= $(prefix)/lib
90
91# Detailed destination directories
92BINLIBDEST= $(LIBDIR)/python$(VERSION)
93LIBDEST= $(SCRIPTDIR)/python$(VERSION)
94INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
95CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
96LIBP= $(LIBDIR)/python$(VERSION)
97
98# Symbols used for using shared libraries
99SO= @SO@
100LDSHARED= @LDSHARED@
Neil Schemenauer75e33892001-02-16 03:36:53 +0000101BLDSHARED= @BLDSHARED@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000102DESTSHARED= $(BINLIBDEST)/lib-dynload
103
104# Executable suffix (.exe on Windows and Mac OS X)
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000105EXE= @EXEEXT@
Jack Jansen1999ef42001-12-06 21:47:20 +0000106BUILDEXE= @BUILDEXEEXT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000107
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000108# Short name and location for Mac OS X Python framework
109PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
110PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
111PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
112PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
Jack Jansen6b08a402004-06-03 12:41:45 +0000113# Deployment target selected during configure, to be checked
114# by distutils
115CONFIGURE_MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
Bob Ippolito7026a0a2005-03-28 23:23:47 +0000116# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
117OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000118
Martin v. Löwis1142de32002-03-29 16:28:31 +0000119# Environment to run shared python without installed libraries
120RUNSHARED= @RUNSHARED@
121
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000122# Modes for directories, executables and data files created by the
123# install process. Default to user-only-writable for all file types.
124DIRMODE= 755
125EXEMODE= 755
126FILEMODE= 644
127
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000128# configure script arguments
129CONFIG_ARGS= @CONFIG_ARGS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000130
131
132# Subdirectories with code
133SRCDIRS= @SRCDIRS@
134
135# Other subdirectories
136SUBDIRSTOO= Include Lib Misc Demo
137
138# Files and directories to be distributed
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000139CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000140DISTFILES= README ChangeLog $(CONFIGFILES)
141DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
142DIST= $(DISTFILES) $(DISTDIRS)
143
144
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000145LIBRARY= @LIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000146LDLIBRARY= @LDLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000147BLDLIBRARY= @BLDLIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000148DLLLIBRARY= @DLLLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000149LDLIBRARYDIR= @LDLIBRARYDIR@
Martin v. Löwis1142de32002-03-29 16:28:31 +0000150INSTSONAME= @INSTSONAME@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000151
152
153LIBS= @LIBS@
154LIBM= @LIBM@
155LIBC= @LIBC@
156SYSLIBS= $(LIBM) $(LIBC)
Martin v. Löwisf90ae202002-06-11 06:22:31 +0000157SHLIBS= @SHLIBS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000158
159MAINOBJ= @MAINOBJ@
Martin v. Löwis2d7e2642002-04-05 16:50:53 +0000160THREADOBJ= @THREADOBJ@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000161DLINCLDIR= @DLINCLDIR@
162DYNLOADFILE= @DYNLOADFILE@
Jack Jansenc49e5b72001-06-19 15:00:23 +0000163MACHDEP_OBJS= @MACHDEP_OBJS@
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000164UNICODE_OBJS= @UNICODE_OBJS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000165
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000166PYTHON= python$(EXE)
Jack Jansen1999ef42001-12-06 21:47:20 +0000167BUILDPYTHON= python$(BUILDEXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000168
169# === Definitions added by makesetup ===
170
171
172##########################################################################
173# Modules
174MODULE_OBJS= \
175 Modules/config.o \
176 Modules/getpath.o \
Neil Schemenauer9c63e6d2001-08-29 23:44:38 +0000177 Modules/main.o \
178 Modules/gcmodule.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000179
180# Used of signalmodule.o is not available
181SIGNAL_OBJS= @SIGNAL_OBJS@
182
183
184##########################################################################
185# Grammar
Neil Schemenauer7cd124c2001-02-27 02:19:16 +0000186GRAMMAR_H= $(srcdir)/Include/graminit.h
187GRAMMAR_C= $(srcdir)/Python/graminit.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000188GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
189
190
191##########################################################################
192# Parser
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000193PGEN= Parser/pgen$(EXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000194
195POBJS= \
196 Parser/acceler.o \
197 Parser/grammar1.o \
198 Parser/listnode.o \
199 Parser/node.o \
200 Parser/parser.o \
201 Parser/parsetok.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000202 Parser/bitset.o \
Guido van Rossumd3ab37f2003-04-17 14:55:42 +0000203 Parser/metagrammar.o \
204 Parser/firstsets.o \
205 Parser/grammar.o \
206 Parser/pgen.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000207
Martin v. Löwis00f1e3f2002-08-04 17:29:52 +0000208PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000209
210PGOBJS= \
Neil Schemenauerfd1030e2002-04-22 03:05:25 +0000211 Objects/obmalloc.o \
Guido van Rossumf2272522001-12-04 03:54:08 +0000212 Python/mysnprintf.o \
Martin v. Löwis00f1e3f2002-08-04 17:29:52 +0000213 Parser/tokenizer_pgen.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000214 Parser/printgrammar.o \
215 Parser/pgenmain.o
216
217PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
218
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000219##########################################################################
220# AST
221AST_H= $(srcdir)/Include/Python-ast.h
222AST_C= $(srcdir)/Python/Python-ast.c
223AST_ASDL= $(srcdir)/Parser/Python.asdl
224
225ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
226# XXX Note that a build now requires Python exist before the build starts
227ASDLGEN= $(srcdir)/Parser/asdl_c.py -h $(srcdir)/Include -c $(srcdir)/Python
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000228
229##########################################################################
230# Python
231PYTHON_OBJS= \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000232 Python/Python-ast.o \
233 Python/asdl.o \
234 Python/ast.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000235 Python/bltinmodule.o \
236 Python/exceptions.o \
237 Python/ceval.o \
238 Python/compile.o \
239 Python/codecs.o \
240 Python/errors.o \
241 Python/frozen.o \
242 Python/frozenmain.o \
Jeremy Hylton4db62b12001-02-27 19:07:02 +0000243 Python/future.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000244 Python/getargs.o \
245 Python/getcompiler.o \
246 Python/getcopyright.o \
247 Python/getmtime.o \
248 Python/getplatform.o \
249 Python/getversion.o \
250 Python/graminit.o \
251 Python/import.o \
252 Python/importdl.o \
253 Python/marshal.o \
254 Python/modsupport.o \
255 Python/mystrtoul.o \
Marc-André Lemburge5006eb2001-07-31 13:24:44 +0000256 Python/mysnprintf.o \
Neal Norwitzadb69fc2005-12-17 20:54:49 +0000257 Python/pyarena.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000258 Python/pyfpe.o \
259 Python/pystate.o \
260 Python/pythonrun.o \
261 Python/structmember.o \
Jeremy Hyltoncb17ae82001-02-09 22:22:18 +0000262 Python/symtable.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000263 Python/sysmodule.o \
264 Python/traceback.o \
265 Python/getopt.o \
Martin v. Löwis737ea822004-06-08 18:52:54 +0000266 Python/pystrtod.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000267 Python/$(DYNLOADFILE) \
Jack Jansenc49e5b72001-06-19 15:00:23 +0000268 $(MACHDEP_OBJS) \
Martin v. Löwis2d7e2642002-04-05 16:50:53 +0000269 $(THREADOBJ)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000270
271
272##########################################################################
273# Objects
274OBJECT_OBJS= \
275 Objects/abstract.o \
Guido van Rossum77f6a652002-04-03 22:41:51 +0000276 Objects/boolobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000277 Objects/bufferobject.o \
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +0000278 Objects/cellobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000279 Objects/classobject.o \
280 Objects/cobject.o \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000281 Objects/codeobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000282 Objects/complexobject.o \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000283 Objects/descrobject.o \
Guido van Rossum7dab2422002-04-26 19:40:56 +0000284 Objects/enumobject.o \
Martin v. Löwise440e472004-06-01 15:22:42 +0000285 Objects/genobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000286 Objects/fileobject.o \
287 Objects/floatobject.o \
288 Objects/frameobject.o \
289 Objects/funcobject.o \
290 Objects/intobject.o \
Guido van Rossum59d1d2b2001-04-20 19:13:02 +0000291 Objects/iterobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000292 Objects/listobject.o \
293 Objects/longobject.o \
294 Objects/dictobject.o \
295 Objects/methodobject.o \
296 Objects/moduleobject.o \
297 Objects/object.o \
Tim Peters1221c0a2002-03-23 00:20:15 +0000298 Objects/obmalloc.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000299 Objects/rangeobject.o \
Raymond Hettingera690a992003-11-16 16:17:49 +0000300 Objects/setobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000301 Objects/sliceobject.o \
302 Objects/stringobject.o \
Guido van Rossum98bf58f2001-10-18 20:34:25 +0000303 Objects/structseq.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000304 Objects/tupleobject.o \
305 Objects/typeobject.o \
Fred Drake502ed822001-10-05 21:56:02 +0000306 Objects/weakrefobject.o \
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000307 $(UNICODE_OBJS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000308
309
310##########################################################################
311# objects that get linked into the Python library
312LIBRARY_OBJS= \
Neil Schemenauer18821822001-01-27 21:42:38 +0000313 Modules/getbuildinfo.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000314 $(PARSER_OBJS) \
315 $(OBJECT_OBJS) \
316 $(PYTHON_OBJS) \
317 $(MODULE_OBJS) \
318 $(SIGNAL_OBJS) \
319 $(MODOBJS)
320
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000321#########################################################################
322# Rules
323
324# Default target
Jack Jansen1999ef42001-12-06 21:47:20 +0000325all: $(BUILDPYTHON) oldsharedmods sharedmods
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000326
327# Build the interpreter
Martin v. Löwis1142de32002-03-29 16:28:31 +0000328$(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
Fred Drakea1a84e72001-03-06 05:52:16 +0000329 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
330 Modules/$(MAINOBJ) \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000331 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000332
Jack Jansen1999ef42001-12-06 21:47:20 +0000333platform: $(BUILDPYTHON)
Martin v. Löwis1142de32002-03-29 16:28:31 +0000334 $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000335
336
337# Build the shared modules
Jack Jansen1999ef42001-12-06 21:47:20 +0000338sharedmods: $(BUILDPYTHON)
Guido van Rossum1140cb22001-09-12 18:59:25 +0000339 case $$MAKEFLAGS in \
Martin v. Löwis1142de32002-03-29 16:28:31 +0000340 *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
341 *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
Guido van Rossum1140cb22001-09-12 18:59:25 +0000342 esac
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000343
Neil Schemenauer18821822001-01-27 21:42:38 +0000344# buildno should really depend on something like LIBRARY_SRC
345buildno: $(PARSER_OBJS) \
346 $(OBJECT_OBJS) \
347 $(PYTHON_OBJS) \
348 $(MODULE_OBJS) \
349 $(SIGNAL_OBJS) \
350 $(MODOBJS) \
351 $(srcdir)/Modules/getbuildinfo.c
Barry Warsawa3bdc2c2005-12-18 22:46:35 +0000352 if test -d $(srcdir)/.svn; then \
353 svnversion $(srcdir) >buildno; \
Barry Warsawce3a9132005-12-19 14:43:44 +0000354 elif test -f buildno; then \
355 expr `cat buildno` + 1 >buildno1; \
356 mv -f buildno1 buildno; \
357 else echo 1 >buildno; fi
Neil Schemenauer18821822001-01-27 21:42:38 +0000358
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000359# Build static library
Guido van Rossum4e6a7a62001-04-09 22:23:22 +0000360# avoid long command lines, same as LIBRARY_OBJS
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000361$(LIBRARY): $(LIBRARY_OBJS)
362 -rm -f $@
Neil Schemenauer18821822001-01-27 21:42:38 +0000363 $(AR) cr $@ Modules/getbuildinfo.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000364 $(AR) cr $@ $(PARSER_OBJS)
365 $(AR) cr $@ $(OBJECT_OBJS)
366 $(AR) cr $@ $(PYTHON_OBJS)
367 $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
368 $(AR) cr $@ $(MODOBJS)
369 $(RANLIB) $@
370
Martin v. Löwis1142de32002-03-29 16:28:31 +0000371libpython$(VERSION).so: $(LIBRARY_OBJS)
Martin v. Löwisbc122622003-06-14 13:11:24 +0000372 if test $(INSTSONAME) != $(LDLIBRARY); then \
Martin v. Löwis4d9559a2004-09-26 17:26:55 +0000373 $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
Martin v. Löwis45ec95d2003-03-30 15:37:33 +0000374 $(LN) -f $(INSTSONAME) $@; \
375 else\
376 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
377 fi
Martin v. Löwis1142de32002-03-29 16:28:31 +0000378
379libpython$(VERSION).sl: $(LIBRARY_OBJS)
380 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000381
Jack Jansenea0c3822002-08-01 21:57:49 +0000382# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
383# minimal framework (not including the Lib directory and such) in the current
384# directory.
385RESSRCDIR=$(srcdir)/Mac/OSXResources/framework
386$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
387 $(LIBRARY) \
388 $(RESSRCDIR)/Info.plist \
389 $(RESSRCDIR)/version.plist \
390 $(RESSRCDIR)/English.lproj/InfoPlist.strings
Jack Jansen246debb2002-02-12 21:30:53 +0000391 $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000392 libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
Bob Ippolito7026a0a2005-03-28 23:23:47 +0000393 @LIBTOOL_CRUFT@
Jack Jansenea0c3822002-08-01 21:57:49 +0000394 $(INSTALL) -d -m $(DIRMODE) \
395 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
396 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
397 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
398 $(INSTALL_DATA) $(RESSRCDIR)/version.plist \
399 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/version.plist
400 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
401 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj/InfoPlist.strings
Jack Jansenc736b8d2002-08-04 21:17:20 +0000402 $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
Jack Jansenb36687a2004-07-16 08:43:47 +0000403 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
Jack Jansenc736b8d2002-08-04 21:17:20 +0000404 $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
405 $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000406
Jason Tishler30765592003-09-04 11:04:06 +0000407# This rule builds the Cygwin Python DLL and import library if configured
408# for a shared core library; otherwise, this rule is a noop.
409$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
410 if test -n "$(DLLLIBRARY)"; then \
411 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
412 $(LIBS) $(MODLIBS) $(SYSLIBS); \
413 else true; \
414 fi
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000415
416
417oldsharedmods: $(SHAREDMODS)
418
419
420Makefile Modules/config.c: Makefile.pre \
421 $(srcdir)/Modules/config.c.in \
422 $(MAKESETUP) \
423 Modules/Setup.config \
424 Modules/Setup \
425 Modules/Setup.local
426 $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
427 -s Modules \
428 Modules/Setup.config \
429 Modules/Setup.local \
430 Modules/Setup
431 @mv config.c Modules
432 @echo "The Makefile was updated, you may need to re-run make."
433
434
435Modules/Setup: $(srcdir)/Modules/Setup.dist
436 @if test -f Modules/Setup; then \
437 echo "-----------------------------------------------"; \
438 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
439 echo "check to make sure you have all the updates you"; \
440 echo "need in your Modules/Setup file."; \
Guido van Rossumbb29b9c2001-09-29 00:42:19 +0000441 echo "Usually, copying Setup.dist to Setup will work."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000442 echo "-----------------------------------------------"; \
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000443 fi
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000444
445############################################################################
446# Special rules for object files
447
448Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno
Barry Warsawce3a9132005-12-19 14:43:44 +0000449 $(CC) -c $(PY_CFLAGS) -DBUILD=\"`cat buildno`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
Andrew M. Kuchling03184e22001-01-26 22:52:45 +0000450
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000451Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000452 $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
453 -DPREFIX='"$(prefix)"' \
454 -DEXEC_PREFIX='"$(exec_prefix)"' \
455 -DVERSION='"$(VERSION)"' \
456 -DVPATH='"$(VPATH)"' \
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000457 -o $@ $(srcdir)/Modules/getpath.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000458
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000459Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc
460 $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000461
462
463$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
Neil Schemenauer7cd124c2001-02-27 02:19:16 +0000464 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000465
466$(PGEN): $(PGENOBJS)
Martin v. Löwis6702d8a2003-07-13 10:10:42 +0000467 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000468
469Parser/grammar.o: $(srcdir)/Parser/grammar.c \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000470 $(srcdir)/Include/token.h \
471 $(srcdir)/Include/grammar.h
472Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
473
Martin v. Löwis00f1e3f2002-08-04 17:29:52 +0000474Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c
475
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000476$(AST_H) $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
477 $(ASDLGEN) $(AST_ASDL)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000478
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000479Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
Neil Schemenauer40417742001-02-27 02:45:36 +0000480
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000481Python/getplatform.o: $(srcdir)/Python/getplatform.c
Mark Hammond8235ea12002-07-19 06:55:41 +0000482 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000483
484Python/importdl.o: $(srcdir)/Python/importdl.c
Mark Hammond8235ea12002-07-19 06:55:41 +0000485 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000486
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000487Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
488 $(srcdir)/Objects/unicodetype_db.h
489
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000490############################################################################
491# Header files
492
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000493PYTHON_HEADERS= \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000494 Include/Python.h \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000495 Include/Python-ast.h \
496 Include/asdl.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000497 Include/abstract.h \
Guido van Rossum77f6a652002-04-03 22:41:51 +0000498 Include/boolobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000499 Include/bufferobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000500 Include/ceval.h \
501 Include/classobject.h \
502 Include/cobject.h \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000503 Include/code.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000504 Include/codecs.h \
505 Include/compile.h \
506 Include/complexobject.h \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000507 Include/descrobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000508 Include/dictobject.h \
Guido van Rossum7dab2422002-04-26 19:40:56 +0000509 Include/enumobject.h \
Martin v. Löwise440e472004-06-01 15:22:42 +0000510 Include/genobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000511 Include/fileobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000512 Include/floatobject.h \
513 Include/funcobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000514 Include/import.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000515 Include/intobject.h \
516 Include/intrcheck.h \
517 Include/iterobject.h \
518 Include/listobject.h \
519 Include/longobject.h \
520 Include/methodobject.h \
521 Include/modsupport.h \
522 Include/moduleobject.h \
523 Include/object.h \
524 Include/objimpl.h \
525 Include/patchlevel.h \
Neal Norwitzadb69fc2005-12-17 20:54:49 +0000526 Include/pyarena.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000527 Include/pydebug.h \
528 Include/pyerrors.h \
529 Include/pyfpe.h \
530 Include/pymem.h \
531 Include/pyport.h \
532 Include/pystate.h \
533 Include/pythonrun.h \
534 Include/rangeobject.h \
Raymond Hettingera690a992003-11-16 16:17:49 +0000535 Include/setobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000536 Include/sliceobject.h \
537 Include/stringobject.h \
Guido van Rossum98bf58f2001-10-18 20:34:25 +0000538 Include/structseq.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000539 Include/structmember.h \
540 Include/symtable.h \
541 Include/sysmodule.h \
542 Include/traceback.h \
543 Include/tupleobject.h \
544 Include/unicodeobject.h \
Fred Drake502ed822001-10-05 21:56:02 +0000545 Include/weakrefobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000546 pyconfig.h
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000547
Fred Drakea1a84e72001-03-06 05:52:16 +0000548$(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS)
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000549
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000550
551######################################################################
552
553# Test the interpreter (twice, once without .pyc files, once with)
Skip Montanaroc9803ab2003-05-06 16:17:27 +0000554# In the past, we've had problems where bugs in the marshalling or
555# elsewhere caused bytecode read from .pyc files to behave differently
556# than bytecode generated directly from a .py source file. Sometimes
557# the bytecode read from a .pyc file had the bug, somtimes the directly
558# generated bytecode. This is sometimes a very shy bug needing a lot of
559# sample data.
560
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000561TESTOPTS= -l
562TESTPROG= $(srcdir)/Lib/test/regrtest.py
Martin v. Löwis1142de32002-03-29 16:28:31 +0000563TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000564test: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000565 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000566 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
567 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000568
Skip Montanaro446ad712003-05-06 15:30:20 +0000569testall: all platform
570 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
571 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
572 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
573
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000574QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \
Fred Drake042f3132001-02-02 03:03:33 +0000575 test_unicodedata test_re test_sre test_select test_poll \
Guido van Rossumed2f7252002-08-09 19:18:25 +0000576 test_linuxaudiodev test_struct test_sunaudiodev test_zlib
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000577quicktest: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000578 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000579 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
580 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000581
Barry Warsaw42119252001-03-03 04:14:21 +0000582MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
583 test_longexp
584memtest: all platform
585 -rm -f $(srcdir)/Lib/test/*.py[co]
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000586 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
587 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
Barry Warsaw42119252001-03-03 04:14:21 +0000588
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000589# Install everything
Guido van Rossumb1ab4d92003-06-13 20:35:41 +0000590install: altinstall bininstall maninstall
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000591
592# Install almost everything without disturbing previous versions
Andrew M. Kuchlingbddd8782001-01-29 20:18:59 +0000593altinstall: altbininstall libinstall inclinstall libainstall \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000594 sharedinstall oldsharedinstall
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000595
596# Install shared libraries enabled by Setup
597DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
598
599oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
600 @for i in X $(SHAREDMODS); do \
Neil Schemenauerac959772001-02-06 14:50:27 +0000601 if test $$i != X; then \
602 echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000603 $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
Neil Schemenauerac959772001-02-06 14:50:27 +0000604 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000605 done
606
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000607$(DESTSHARED):
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000608 @for i in $(DESTDIRS); \
609 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000610 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000611 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000612 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000613 else true; \
614 fi; \
615 done
616
617
618# Install the interpreter (by creating a hard link to python$(VERSION))
619bininstall: altbininstall
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000620 -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
621 then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000622 else true; \
623 fi
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000624 (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000625
626# Install the interpreter with $(VERSION) affixed
627# This goes into $(exec_prefix)
Jack Jansen1999ef42001-12-06 21:47:20 +0000628altbininstall: $(BUILDPYTHON)
Jack Jansen3a451b12002-08-06 13:40:31 +0000629 @if test "$(PYTHONFRAMEWORKDIR)" != no-framework; then \
Jack Jansen9592fe92003-05-25 22:01:32 +0000630 if test ! -f $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current/Resources/Info.plist; then \
Jack Jansen3a451b12002-08-06 13:40:31 +0000631 echo 'Framework build: use "make frameworkinstall" in stead of "make install"'; \
632 exit 1; \
633 fi; \
634 fi
Martin v. Löwisd8a20d22002-05-08 08:59:59 +0000635 @for i in $(BINDIR) $(LIBDIR); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000636 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000637 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000638 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000639 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000640 else true; \
641 fi; \
642 done
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000643 $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
Martin v. Löwis1142de32002-03-29 16:28:31 +0000644 if test -f libpython$(VERSION)$(SO); then \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000645 if test "$(SO)" = .dll; then \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000646 $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000647 else \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000648 $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
Martin v. Löwise3be8602003-11-18 19:54:20 +0000649 if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
650 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
651 fi \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000652 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000653 else true; \
654 fi
655
656# Install the manual page
657maninstall:
658 @for i in $(MANDIR) $(MANDIR)/man1; \
659 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000660 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000661 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000662 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000663 else true; \
664 fi; \
665 done
666 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000667 $(DESTDIR)$(MANDIR)/man1/python.1
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000668
669# Install the library
670PLATDIR= plat-$(MACHDEP)
Jack Jansen83f898c2002-12-30 22:23:40 +0000671EXTRAPLATDIR= @EXTRAPLATDIR@
Jack Jansen7b59b422003-03-17 15:44:10 +0000672EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@
Jack Jansen83f898c2002-12-30 22:23:40 +0000673MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
Fredrik Lundhd3968332005-12-14 17:36:36 +0000674XMLLIBSUBDIRS= xmlcore xmlcore/dom xmlcore/etree xmlcore/parsers xmlcore/sax
Jack Jansen83f898c2002-12-30 22:23:40 +0000675PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
Jack Jansend68d9292003-01-21 15:05:02 +0000676 plat-mac/lib-scriptpackages/_builtinSuites \
Jack Jansen83f898c2002-12-30 22:23:40 +0000677 plat-mac/lib-scriptpackages/CodeWarrior \
678 plat-mac/lib-scriptpackages/Explorer \
679 plat-mac/lib-scriptpackages/Finder \
680 plat-mac/lib-scriptpackages/Netscape \
681 plat-mac/lib-scriptpackages/StdSuites \
Jack Jansen1fff6972003-03-31 09:39:54 +0000682 plat-mac/lib-scriptpackages/SystemEvents \
Jack Jansen83f898c2002-12-30 22:23:40 +0000683 plat-mac/lib-scriptpackages/Terminal
Jack Jansen7b59b422003-03-17 15:44:10 +0000684PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
Barry Warsawf4c20d32001-12-03 18:51:41 +0000685LIBSUBDIRS= lib-old lib-tk site-packages test test/output test/data \
Anthony Baxter1e2bd5b2004-07-12 09:25:18 +0000686 test/decimaltestdata \
Barry Warsaw2c71ad32003-01-20 01:13:21 +0000687 encodings email email/test email/test/data compiler hotshot \
Guido van Rossumd321efd2003-06-13 20:49:55 +0000688 logging bsddb bsddb/test csv idlelib idlelib/Icons \
Fred Drakee612c8e2005-01-19 06:24:58 +0000689 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
690 curses $(MACHDEPS)
Jack Jansen1999ef42001-12-06 21:47:20 +0000691libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000692 @for i in $(SCRIPTDIR) $(LIBDEST); \
693 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000694 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000695 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000696 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000697 else true; \
698 fi; \
699 done
700 @for d in $(LIBSUBDIRS); \
701 do \
702 a=$(srcdir)/Lib/$$d; \
703 if test ! -d $$a; then continue; else true; fi; \
704 b=$(LIBDEST)/$$d; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000705 if test ! -d $(DESTDIR)$$b; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000706 echo "Creating directory $$b"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000707 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000708 else true; \
709 fi; \
710 done
711 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
712 do \
713 if test -x $$i; then \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000714 $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000715 echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000716 else \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000717 $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000718 echo $(INSTALL_DATA) $$i $(LIBDEST); \
719 fi; \
720 done
721 @for d in $(LIBSUBDIRS); \
722 do \
723 a=$(srcdir)/Lib/$$d; \
724 if test ! -d $$a; then continue; else true; fi; \
725 b=$(LIBDEST)/$$d; \
726 for i in $$a/*; \
727 do \
728 case $$i in \
729 *CVS) ;; \
730 *.py[co]) ;; \
731 *.orig) ;; \
732 *~) ;; \
733 *) \
734 if test -d $$i; then continue; fi; \
735 if test -x $$i; then \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000736 echo $(INSTALL_SCRIPT) $$i $$b; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000737 $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000738 else \
739 echo $(INSTALL_DATA) $$i $$b; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000740 $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000741 fi;; \
742 esac; \
743 done; \
744 done
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000745 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
746 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
747 ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000748 -d $(LIBDEST) -f \
Neal Norwitz892a33f2005-10-04 04:32:42 +0000749 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000750 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
751 ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000752 -d $(LIBDEST) -f \
Neal Norwitz892a33f2005-10-04 04:32:42 +0000753 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
Hye-Shik Chang0e5e6c72004-03-18 07:51:27 +0000754 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000755 ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000756 -d $(LIBDEST)/site-packages -f \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000757 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
Hye-Shik Chang0e5e6c72004-03-18 07:51:27 +0000758 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000759 ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000760 -d $(LIBDEST)/site-packages -f \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000761 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000762
763# Create the PLATDIR source directory, if one wasn't distributed..
764$(srcdir)/Lib/$(PLATDIR):
765 mkdir $(srcdir)/Lib/$(PLATDIR)
766 cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
767 export PATH; PATH="`pwd`:$$PATH"; \
768 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000769 export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
Jack Jansen0d153662001-12-19 09:24:40 +0000770 export EXE; EXE="$(BUILDEXE)"; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000771 cd $(srcdir)/Lib/$(PLATDIR); ./regen
772
773# Install the include files
774INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
775inclinstall:
776 @for i in $(INCLDIRSTOMAKE); \
777 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000778 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000779 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000780 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000781 else true; \
782 fi; \
783 done
784 @for i in $(srcdir)/Include/*.h; \
785 do \
786 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000787 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000788 done
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000789 $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000790
791# Install the library and miscellaneous stuff needed for extending/embedding
792# This goes into $(exec_prefix)
793LIBPL= $(LIBP)/config
794libainstall: all
795 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
796 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000797 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000798 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000799 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000800 else true; \
801 fi; \
802 done
Martin v. Löwis1142de32002-03-29 16:28:31 +0000803 @if test -d $(LIBRARY); then :; else \
Jack Jansen127e56e2001-09-11 14:41:54 +0000804 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000805 if test "$(SO)" = .dll; then \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000806 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000807 else \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000808 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
809 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000810 fi; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000811 else \
Martin v. Löwis1142de32002-03-29 16:28:31 +0000812 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000813 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000814 fi
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000815 $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
816 $(INSTALL_DATA) Modules/$(MAINOBJ) $(DESTDIR)$(LIBPL)/$(MAINOBJ)
817 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
818 $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
819 $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
820 $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
821 $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
822 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
823 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000824 @if [ -s Modules/python.exp -a \
825 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
826 echo; echo "Installing support files for building shared extension modules on AIX:"; \
827 $(INSTALL_DATA) Modules/python.exp \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000828 $(DESTDIR)$(LIBPL)/python.exp; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000829 echo; echo "$(LIBPL)/python.exp"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000830 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000831 $(DESTDIR)$(LIBPL)/makexp_aix; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000832 echo "$(LIBPL)/makexp_aix"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000833 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000834 $(DESTDIR)$(LIBPL)/ld_so_aix; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000835 echo "$(LIBPL)/ld_so_aix"; \
836 echo; echo "See Misc/AIX-NOTES for details."; \
837 else true; \
838 fi
839 @case "$(MACHDEP)" in beos*) \
840 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000841 $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000842 echo; echo "$(LIBPL)/README"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000843 $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000844 echo "$(LIBPL)/ar_beos"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000845 $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000846 echo "$(LIBPL)/ld_so_beos"; \
847 echo; echo "See Misc/BeOS-NOTES for details."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000848 ;; \
849 esac
850
851# Install the dynamically loadable modules
852# This goes into $(exec_prefix)
853sharedinstall:
Martin v. Löwis1142de32002-03-29 16:28:31 +0000854 $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
855 --prefix=$(prefix) \
Guido van Rossumb33e7892001-10-17 06:26:53 +0000856 --install-scripts=$(BINDIR) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000857 --install-platlib=$(DESTSHARED) \
858 --root=/$(DESTDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000859
Jack Jansencb4321e2002-08-09 00:18:21 +0000860# Here are a couple of targets for MacOSX again, to install a full
861# framework-based Python. frameworkinstall installs everything, the
862# subtargets install specific parts. Much of the actual work is offloaded to
863# the Makefile in Mac/OSX
864#
865frameworkinstall: frameworkinstallframework \
866 frameworkinstallapps frameworkinstallunixtools
Guido van Rossumed2f7252002-08-09 19:18:25 +0000867
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000868# On install, we re-make the framework
869# structure in the install location, /Library/Frameworks/ or the argument to
870# --enable-framework. If --enable-framework has been specified then we have
871# automatically set prefix to the location deep down in the framework, so we
872# only have to cater for the structural bits of the framework.
873
Jack Jansencb4321e2002-08-09 00:18:21 +0000874frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
875
876frameworkinstallstructure: $(LDLIBRARY)
Jack Jansen127e56e2001-09-11 14:41:54 +0000877 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000878 echo Not configured with --enable-framework; \
Jack Jansen127e56e2001-09-11 14:41:54 +0000879 exit 1; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000880 else true; \
881 fi
Jack Jansencb4321e2002-08-09 00:18:21 +0000882 @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000883 if test ! -d $(DESTDIR)$$i; then \
Jack Jansen9592fe92003-05-25 22:01:32 +0000884 echo "Creating directory $(DESTDIR)$$i"; \
885 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000886 else true; \
887 fi; \
888 done
Jack Jansen9592fe92003-05-25 22:01:32 +0000889 $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
890 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist
891 $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000892 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
Jack Jansen9592fe92003-05-25 22:01:32 +0000893 $(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings
894 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
895 $(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python
896 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
897 $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
Jack Jansen4735b232003-06-20 20:36:53 +0000898 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000899
Jack Jansencb4321e2002-08-09 00:18:21 +0000900# This installs Mac/Lib into the framework
901frameworkinstallmaclib:
902 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installmacsubtree \
Jack Jansen66b84832003-07-04 12:14:39 +0000903 $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
Jack Jansen9592fe92003-05-25 22:01:32 +0000904 srcdir=$(srcdir) builddir=. prefix=$(prefix) LIBDEST=$(LIBDEST) \
905 DESTDIR=$(DESTDIR)
Jack Jansencb4321e2002-08-09 00:18:21 +0000906
907# This installs the IDE, the Launcher and other apps into /Applications
908frameworkinstallapps:
909 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installapps \
Jack Jansen66b84832003-07-04 12:14:39 +0000910 $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
Jack Jansen48e02e42003-12-07 21:52:07 +0000911 srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix)
Jack Jansencb4321e2002-08-09 00:18:21 +0000912
913# This install the unix python and pythonw tools in /usr/local/bin
914frameworkinstallunixtools:
915 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installunixtools \
Jack Jansena226b572003-05-09 15:08:39 +0000916 DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
Jack Jansen48e02e42003-12-07 21:52:07 +0000917 srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix)
Jack Jansen0b06be72002-06-21 14:48:38 +0000918
Jack Jansena1b77582003-06-19 22:35:20 +0000919# This installs the Demos and Tools into the applications directory.
920# It is not part of a normal frameworkinstall
921frameworkinstallextras:
922 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installextras \
Jack Jansen66b84832003-07-04 12:14:39 +0000923 $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
Jack Jansena1b77582003-06-19 22:35:20 +0000924 srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR)
925
Skip Montanarodecc6a42003-01-01 20:07:49 +0000926# This installs a few of the useful scripts in Tools/scripts
927scriptsinstall:
Martin v. Löwis01f43112003-01-03 20:39:29 +0000928 SRCDIR=$(srcdir) $(RUNSHARED) \
Skip Montanarodecc6a42003-01-01 20:07:49 +0000929 ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
930 --prefix=$(prefix) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000931 --install-scripts=$(BINDIR) \
932 --root=/$(DESTDIR)
Skip Montanarodecc6a42003-01-01 20:07:49 +0000933
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000934# Build the toplevel Makefile
935Makefile.pre: Makefile.pre.in config.status
936 CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
937 $(MAKE) -f Makefile.pre Makefile
938
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000939# Run the configure script.
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000940config.status: $(srcdir)/configure
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000941 $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000942
Jack Jansen1999ef42001-12-06 21:47:20 +0000943.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000944
945# Some make's put the object file in the current directory
946.c.o:
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000947 $(CC) -c $(PY_CFLAGS) -o $@ $<
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000948
949# Rerun configure with the same options as it was run last time,
950# provided the config.status script exists
951recheck:
952 $(SHELL) config.status --recheck
953 $(SHELL) config.status
954
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000955# Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000956autoconf:
957 (cd $(srcdir); autoconf)
958 (cd $(srcdir); autoheader)
959
960# Create a tags file for vi
961tags::
962 cd $(srcdir); \
963 ctags -w -t Include/*.h; \
964 for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
965 done; \
Guido van Rossumc9489662002-02-28 19:26:08 +0000966 sort -o tags tags
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000967
968# Create a tags file for GNU Emacs
969TAGS::
970 cd $(srcdir); \
971 etags Include/*.h; \
972 for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
973
974# Sanitation targets -- clean leaves libraries, executables and tags
975# files, which clobber removes those as well
976
977clean:
Neil Schemenauerc5cfcb42001-02-19 04:35:11 +0000978 find . -name '*.o' -exec rm -f {} ';'
Guido van Rossumcd0ed972001-04-14 17:57:07 +0000979 find . -name '*.s[ol]' -exec rm -f {} ';'
Neil Schemenauere0d43572001-02-03 17:16:29 +0000980 find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000981
982clobber: clean
Jack Jansen1999ef42001-12-06 21:47:20 +0000983 -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
Guido van Rossumcd0ed972001-04-14 17:57:07 +0000984 tags TAGS \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000985 config.cache config.log pyconfig.h Modules/config.c
Guido van Rossum1d88c592001-06-06 17:51:57 +0000986 -rm -rf build platform
Jack Jansenc6096892003-02-27 23:19:46 +0000987 -rm -rf $(PYTHONFRAMEWORKDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000988
989# Make things extra clean, before making a distribution:
990# remove all generated files, even Makefile[.pre]
991distclean: clobber
Neil Schemenauere0d43572001-02-03 17:16:29 +0000992 -rm -f core Makefile Makefile.pre buildno config.status \
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000993 Modules/Setup Modules/Setup.local Modules/Setup.config
Skip Montanarof6a90442005-11-13 15:54:15 +0000994 -rm -f $(AST_H) $(AST_C)
Neil Schemenauere0d43572001-02-03 17:16:29 +0000995 find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
996 -o -name '[@,#]*' -o -name '*.old' \
997 -o -name '*.orig' -o -name '*.rej' \
998 -o -name '*.bak' ')' \
999 -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001000
1001# Check for smelly exported symbols (not starting with Py/_Py)
1002smelly: all
1003 nm -p $(LIBRARY) | \
1004 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1005
1006# Find files with funny names
1007funny:
1008 find $(DISTDIRS) -type d \
1009 -o -name '*.[chs]' \
1010 -o -name '*.py' \
1011 -o -name '*.doc' \
1012 -o -name '*.sty' \
1013 -o -name '*.bib' \
1014 -o -name '*.dat' \
1015 -o -name '*.el' \
1016 -o -name '*.fd' \
1017 -o -name '*.in' \
1018 -o -name '*.tex' \
1019 -o -name '*,[vpt]' \
1020 -o -name 'Setup' \
1021 -o -name 'Setup.*' \
1022 -o -name README \
1023 -o -name Makefile \
1024 -o -name ChangeLog \
1025 -o -name Repository \
1026 -o -name Root \
1027 -o -name Entries \
1028 -o -name Tag \
1029 -o -name tags \
1030 -o -name TAGS \
1031 -o -name .cvsignore \
1032 -o -name MANIFEST \
1033 -o -print
1034
Guido van Rossum9454ad72001-08-18 21:08:22 +00001035# Dependencies
1036
Martin v. Löwis06f15bb2001-12-02 13:02:32 +00001037Python/thread.o: @THREADHEADERS@
Guido van Rossum9454ad72001-08-18 21:08:22 +00001038
Guido van Rossumd4f7da32002-10-10 15:04:04 +00001039# Declare targets that aren't real files
1040.PHONY: all sharedmods oldsharedmods test quicktest memtest
1041.PHONY: install altinstall oldsharedinstall bininstall altbininstall
1042.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1043.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1044.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1045.PHONY: recheck autoconf clean clobber distclean smelly funny
1046
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001047# IF YOU PUT ANYTHING HERE IT WILL GO AWAY