blob: b6578dec082c71eeb30813e6197fdb7b370a762b [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@
Trent Nelsonabf20512012-10-17 04:32:49 -040030abs_srcdir= @abs_srcdir@
31abs_builddir= @abs_builddir@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000032
33CC= @CC@
34CXX= @CXX@
Martin v. Löwis0f48d982006-04-14 14:34:26 +000035MAINCC= @MAINCC@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000036LINKCC= @LINKCC@
37AR= @AR@
38RANLIB= @RANLIB@
Martin v. Löwisdea59e52006-01-05 10:00:36 +000039SVNVERSION= @SVNVERSION@
Georg Brandl3a5508e2011-03-06 10:42:21 +010040HGVERSION= @HGVERSION@
41HGTAG= @HGTAG@
42HGBRANCH= @HGBRANCH@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000043
Tarek Ziadée2be83d2009-05-09 08:28:53 +000044GNULD= @GNULD@
45
Neil Schemenauer85515ad2001-01-24 17:11:43 +000046# Shell used by make (some versions default to the login shell, which is bad)
47SHELL= /bin/sh
48
49# Use this to make a link between python$(VERSION) and python in $(BINDIR)
50LN= @LN@
51
52# Portable install script (configure doesn't always guess right)
53INSTALL= @INSTALL@
54INSTALL_PROGRAM=@INSTALL_PROGRAM@
Neil Schemenauer3f5cc202001-04-10 23:03:35 +000055INSTALL_SCRIPT= @INSTALL_SCRIPT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000056INSTALL_DATA= @INSTALL_DATA@
57# Shared libraries must be installed with executable mode on some systems;
58# rather than figuring out exactly which, we always give them executable mode.
59# Also, making them read-only seems to be a good idea...
60INSTALL_SHARED= ${INSTALL} -m 555
61
Trent Nelsonf6407a12012-08-30 14:56:13 +000062MKDIR_P= @MKDIR_P@
63
Neil Schemenauer85515ad2001-01-24 17:11:43 +000064MAKESETUP= $(srcdir)/Modules/makesetup
65
66# Compiler options
67OPT= @OPT@
Skip Montanarodecc6a42003-01-01 20:07:49 +000068BASECFLAGS= @BASECFLAGS@
Antoine Pitrouf83b3082010-03-21 19:19:41 +000069CFLAGS= $(BASECFLAGS) @CFLAGS@ $(OPT) $(EXTRA_CFLAGS)
Brett Cannon516592f2004-12-07 00:42:59 +000070# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
71# be able to build extension modules using the directories specified in the
72# environment variables
Martin v. Löwisd44a4e92007-09-05 11:47:34 +000073CPPFLAGS= -I. -IInclude -I$(srcdir)/Include @CPPFLAGS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000074LDFLAGS= @LDFLAGS@
75LDLAST= @LDLAST@
76SGI_ABI= @SGI_ABI@
Neil Schemenauer7ac954b2001-01-26 16:14:41 +000077CCSHARED= @CCSHARED@
78LINKFORSHARED= @LINKFORSHARED@
Tarek Ziadé99f660a2009-05-07 21:20:34 +000079ARFLAGS= @ARFLAGS@
Neil Schemenauer7ac954b2001-01-26 16:14:41 +000080# Extra C flags added for building the interpreter object files.
81CFLAGSFORSHARED=@CFLAGSFORSHARED@
82# C flags used for building the interpreter object files
Mark Hammond8235ea12002-07-19 06:55:41 +000083PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
Neil Schemenauer7ac954b2001-01-26 16:14:41 +000084
Neil Schemenauer85515ad2001-01-24 17:11:43 +000085
86# Machine-dependent subdirectories
87MACHDEP= @MACHDEP@
88
89# Install prefix for architecture-independent files
90prefix= @prefix@
91
92# Install prefix for architecture-dependent files
93exec_prefix= @exec_prefix@
94
Ronald Oussoren9bc2dd62007-09-09 11:13:42 +000095# Install prefix for data files
96datarootdir= @datarootdir@
97
Neil Schemenauer85515ad2001-01-24 17:11:43 +000098# Expanded directories
Antoine Pitrouf83b3082010-03-21 19:19:41 +000099BINDIR= @bindir@
100LIBDIR= @libdir@
Martin v. Löwisd429ab62001-08-02 06:20:20 +0000101MANDIR= @mandir@
102INCLUDEDIR= @includedir@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000103CONFINCLUDEDIR= $(exec_prefix)/include
104SCRIPTDIR= $(prefix)/lib
105
106# Detailed destination directories
107BINLIBDEST= $(LIBDIR)/python$(VERSION)
108LIBDEST= $(SCRIPTDIR)/python$(VERSION)
109INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
110CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
111LIBP= $(LIBDIR)/python$(VERSION)
112
113# Symbols used for using shared libraries
114SO= @SO@
Antoine Pitrou58dab672010-10-10 09:54:59 +0000115LDSHARED= @LDSHARED@ $(LDFLAGS)
116BLDSHARED= @BLDSHARED@ $(LDFLAGS)
Tarek Ziadé00002952010-04-03 08:37:59 +0000117LDCXXSHARED= @LDCXXSHARED@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000118DESTSHARED= $(BINLIBDEST)/lib-dynload
119
120# Executable suffix (.exe on Windows and Mac OS X)
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000121EXE= @EXEEXT@
Jack Jansen1999ef42001-12-06 21:47:20 +0000122BUILDEXE= @BUILDEXEEXT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000123
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000124# Short name and location for Mac OS X Python framework
Ronald Oussoren988117f2006-04-29 11:31:35 +0000125UNIVERSALSDK=@UNIVERSALSDK@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000126PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
127PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
128PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
129PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
Jack Jansen6b08a402004-06-03 12:41:45 +0000130# Deployment target selected during configure, to be checked
Ronald Oussoren988117f2006-04-29 11:31:35 +0000131# by distutils. The export statement is needed to ensure that the
132# deployment target is active during build.
133MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
134@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
135
Bob Ippolito7026a0a2005-03-28 23:23:47 +0000136# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
137OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000138
Martin v. Löwis1142de32002-03-29 16:28:31 +0000139# Environment to run shared python without installed libraries
140RUNSHARED= @RUNSHARED@
141
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000142# Modes for directories, executables and data files created by the
143# install process. Default to user-only-writable for all file types.
144DIRMODE= 755
145EXEMODE= 755
146FILEMODE= 644
147
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000148# configure script arguments
149CONFIG_ARGS= @CONFIG_ARGS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000150
151
152# Subdirectories with code
153SRCDIRS= @SRCDIRS@
154
155# Other subdirectories
156SUBDIRSTOO= Include Lib Misc Demo
157
158# Files and directories to be distributed
Matthias Klose3cef2a92012-03-14 23:39:33 +0100159CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000160DISTFILES= README ChangeLog $(CONFIGFILES)
161DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
162DIST= $(DISTFILES) $(DISTDIRS)
163
164
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000165LIBRARY= @LIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000166LDLIBRARY= @LDLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000167BLDLIBRARY= @BLDLIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000168DLLLIBRARY= @DLLLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000169LDLIBRARYDIR= @LDLIBRARYDIR@
Martin v. Löwis1142de32002-03-29 16:28:31 +0000170INSTSONAME= @INSTSONAME@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000171
172
173LIBS= @LIBS@
174LIBM= @LIBM@
175LIBC= @LIBC@
176SYSLIBS= $(LIBM) $(LIBC)
Martin v. Löwisf90ae202002-06-11 06:22:31 +0000177SHLIBS= @SHLIBS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000178
Martin v. Löwis2d7e2642002-04-05 16:50:53 +0000179THREADOBJ= @THREADOBJ@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000180DLINCLDIR= @DLINCLDIR@
181DYNLOADFILE= @DYNLOADFILE@
Jack Jansenc49e5b72001-06-19 15:00:23 +0000182MACHDEP_OBJS= @MACHDEP_OBJS@
Martin v. Löwis63bf1492007-11-12 05:14:05 +0000183LIBOBJDIR= Python/
184LIBOBJS= @LIBOBJS@
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000185UNICODE_OBJS= @UNICODE_OBJS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000186
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000187PYTHON= python$(EXE)
Jack Jansen1999ef42001-12-06 21:47:20 +0000188BUILDPYTHON= python$(BUILDEXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000189
Gregory P. Smithb2693e02008-04-13 00:03:25 +0000190# The task to run while instrument when building the profile-opt target
Matthias Klose922d1fd2008-10-10 07:24:20 +0000191PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
192#PROFILE_TASK= $(srcdir)/Lib/test/regrtest.py
Gregory P. Smithb2693e02008-04-13 00:03:25 +0000193
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000194# === Definitions added by makesetup ===
195
196
197##########################################################################
198# Modules
199MODULE_OBJS= \
200 Modules/config.o \
201 Modules/getpath.o \
Neil Schemenauer9c63e6d2001-08-29 23:44:38 +0000202 Modules/main.o \
203 Modules/gcmodule.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000204
205# Used of signalmodule.o is not available
206SIGNAL_OBJS= @SIGNAL_OBJS@
207
208
209##########################################################################
210# Grammar
Trent Nelsonf6407a12012-08-30 14:56:13 +0000211GRAMMAR_H= Include/graminit.h
212GRAMMAR_C= Python/graminit.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000213GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
214
215
Benjamin Peterson1c335e62010-01-01 15:16:29 +0000216LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
217
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000218##########################################################################
219# Parser
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000220PGEN= Parser/pgen$(EXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000221
222POBJS= \
223 Parser/acceler.o \
224 Parser/grammar1.o \
225 Parser/listnode.o \
226 Parser/node.o \
227 Parser/parser.o \
228 Parser/parsetok.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000229 Parser/bitset.o \
Guido van Rossumd3ab37f2003-04-17 14:55:42 +0000230 Parser/metagrammar.o \
231 Parser/firstsets.o \
232 Parser/grammar.o \
233 Parser/pgen.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000234
Martin v. Löwis00f1e3f2002-08-04 17:29:52 +0000235PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000236
237PGOBJS= \
Neil Schemenauerfd1030e2002-04-22 03:05:25 +0000238 Objects/obmalloc.o \
Guido van Rossumf2272522001-12-04 03:54:08 +0000239 Python/mysnprintf.o \
Benjamin Peterson51fd5862010-04-04 23:01:03 +0000240 Python/pyctype.o \
Martin v. Löwis00f1e3f2002-08-04 17:29:52 +0000241 Parser/tokenizer_pgen.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000242 Parser/printgrammar.o \
243 Parser/pgenmain.o
244
Christian Heimes3beae9b2008-01-21 13:11:15 +0000245PARSER_HEADERS= \
246 Parser/parser.h \
247 Parser/tokenizer.h
248
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000249PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
250
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000251##########################################################################
252# AST
Trent Nelsonf6407a12012-08-30 14:56:13 +0000253AST_H_DIR= Include
Martin v. Löwis75801492006-04-14 15:02:32 +0000254AST_H= $(AST_H_DIR)/Python-ast.h
Trent Nelsonf6407a12012-08-30 14:56:13 +0000255AST_C_DIR= Python
Martin v. Löwis75801492006-04-14 15:02:32 +0000256AST_C= $(AST_C_DIR)/Python-ast.c
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000257AST_ASDL= $(srcdir)/Parser/Python.asdl
258
259ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
260# XXX Note that a build now requires Python exist before the build starts
Martin v. Löwis75801492006-04-14 15:02:32 +0000261ASDLGEN= $(srcdir)/Parser/asdl_c.py
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000262
263##########################################################################
264# Python
265PYTHON_OBJS= \
Brett Cannone9746892008-04-12 23:44:07 +0000266 Python/_warnings.o \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000267 Python/Python-ast.o \
268 Python/asdl.o \
269 Python/ast.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000270 Python/bltinmodule.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000271 Python/ceval.o \
272 Python/compile.o \
273 Python/codecs.o \
274 Python/errors.o \
275 Python/frozen.o \
276 Python/frozenmain.o \
Jeremy Hylton4db62b12001-02-27 19:07:02 +0000277 Python/future.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000278 Python/getargs.o \
279 Python/getcompiler.o \
280 Python/getcopyright.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000281 Python/getplatform.o \
282 Python/getversion.o \
283 Python/graminit.o \
284 Python/import.o \
285 Python/importdl.o \
286 Python/marshal.o \
287 Python/modsupport.o \
288 Python/mystrtoul.o \
Marc-André Lemburge5006eb2001-07-31 13:24:44 +0000289 Python/mysnprintf.o \
Jeremy Hylton644dddc2006-08-21 16:19:37 +0000290 Python/peephole.o \
Neal Norwitzadb69fc2005-12-17 20:54:49 +0000291 Python/pyarena.o \
Eric Smithcac7af62009-04-27 19:04:37 +0000292 Python/pyctype.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000293 Python/pyfpe.o \
Christian Heimes6f341092008-04-18 23:13:07 +0000294 Python/pymath.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000295 Python/pystate.o \
296 Python/pythonrun.o \
Barry Warsaw1e13eb02012-02-20 20:42:21 -0500297 Python/random.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000298 Python/structmember.o \
Jeremy Hyltoncb17ae82001-02-09 22:22:18 +0000299 Python/symtable.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000300 Python/sysmodule.o \
301 Python/traceback.o \
302 Python/getopt.o \
Christian Heimes0a8143f2007-12-18 23:22:54 +0000303 Python/pystrcmp.o \
Martin v. Löwis737ea822004-06-08 18:52:54 +0000304 Python/pystrtod.o \
Mark Dickinsonbb282852009-10-24 12:13:30 +0000305 Python/dtoa.o \
Eric Smitha9f7d622008-02-17 19:46:49 +0000306 Python/formatter_unicode.o \
307 Python/formatter_string.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000308 Python/$(DYNLOADFILE) \
Martin v. Löwis63bf1492007-11-12 05:14:05 +0000309 $(LIBOBJS) \
Jack Jansenc49e5b72001-06-19 15:00:23 +0000310 $(MACHDEP_OBJS) \
Martin v. Löwis2d7e2642002-04-05 16:50:53 +0000311 $(THREADOBJ)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000312
313
314##########################################################################
315# Objects
316OBJECT_OBJS= \
317 Objects/abstract.o \
Guido van Rossum77f6a652002-04-03 22:41:51 +0000318 Objects/boolobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000319 Objects/bufferobject.o \
Christian Heimes1a6387e2008-03-26 12:49:49 +0000320 Objects/bytes_methods.o \
Christian Heimes44720832008-05-26 13:01:01 +0000321 Objects/bytearrayobject.o \
Larry Hastings402b73f2010-03-25 00:54:54 +0000322 Objects/capsule.o \
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +0000323 Objects/cellobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000324 Objects/classobject.o \
325 Objects/cobject.o \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000326 Objects/codeobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000327 Objects/complexobject.o \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000328 Objects/descrobject.o \
Guido van Rossum7dab2422002-04-26 19:40:56 +0000329 Objects/enumobject.o \
Richard Jones7b9558d2006-05-27 12:29:24 +0000330 Objects/exceptions.o \
Martin v. Löwise440e472004-06-01 15:22:42 +0000331 Objects/genobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000332 Objects/fileobject.o \
333 Objects/floatobject.o \
334 Objects/frameobject.o \
335 Objects/funcobject.o \
336 Objects/intobject.o \
Guido van Rossum59d1d2b2001-04-20 19:13:02 +0000337 Objects/iterobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000338 Objects/listobject.o \
339 Objects/longobject.o \
340 Objects/dictobject.o \
Antoine Pitrou789be0c2009-04-02 21:18:34 +0000341 Objects/memoryobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000342 Objects/methodobject.o \
343 Objects/moduleobject.o \
344 Objects/object.o \
Tim Peters1221c0a2002-03-23 00:20:15 +0000345 Objects/obmalloc.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000346 Objects/rangeobject.o \
Gregory P. Smithb7fea622008-06-10 21:23:22 +0000347 Objects/setobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000348 Objects/sliceobject.o \
Gregory P. Smithb7fea622008-06-10 21:23:22 +0000349 Objects/stringobject.o \
Guido van Rossum98bf58f2001-10-18 20:34:25 +0000350 Objects/structseq.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000351 Objects/tupleobject.o \
352 Objects/typeobject.o \
Fred Drake502ed822001-10-05 21:56:02 +0000353 Objects/weakrefobject.o \
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000354 $(UNICODE_OBJS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000355
356
357##########################################################################
358# objects that get linked into the Python library
359LIBRARY_OBJS= \
Neil Schemenauer18821822001-01-27 21:42:38 +0000360 Modules/getbuildinfo.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000361 $(PARSER_OBJS) \
362 $(OBJECT_OBJS) \
363 $(PYTHON_OBJS) \
364 $(MODULE_OBJS) \
365 $(SIGNAL_OBJS) \
366 $(MODOBJS)
367
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000368#########################################################################
369# Rules
370
371# Default target
Sean Reifscheideraaad0d62007-09-21 06:33:28 +0000372all: build_all
Martin v. Löwisbf0dfb32010-04-01 07:40:51 +0000373build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000374
Gregory P. Smithb2693e02008-04-13 00:03:25 +0000375# Compile a binary with gcc profile guided optimization.
376profile-opt:
377 @echo "Building with support for profile generation:"
378 $(MAKE) clean
379 $(MAKE) build_all_generate_profile
380 @echo "Running benchmark to generate profile data:"
381 $(MAKE) profile-removal
382 $(MAKE) run_profile_task
383 @echo "Rebuilding with profile guided optimizations:"
384 $(MAKE) clean
385 $(MAKE) build_all_use_profile
386
387build_all_generate_profile:
388 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
389
390run_profile_task:
391 ./$(BUILDPYTHON) $(PROFILE_TASK)
392
393build_all_use_profile:
394 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
395
Georg Brandl405b5f32008-05-18 11:46:51 +0000396coverage:
397 @echo "Building with support for coverage checking:"
398 $(MAKE) clean
399 $(MAKE) all CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"
400
401
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000402# Build the interpreter
Martin v. Löwis0f48d982006-04-14 14:34:26 +0000403$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
Fred Drakea1a84e72001-03-06 05:52:16 +0000404 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
Martin v. Löwis0f48d982006-04-14 14:34:26 +0000405 Modules/python.o \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000406 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000407
Jack Jansen1999ef42001-12-06 21:47:20 +0000408platform: $(BUILDPYTHON)
Tarek Ziadé5633a802010-01-23 09:23:15 +0000409 $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000410
411
412# Build the shared modules
Christian Heimesf84dcff2012-09-07 02:24:58 +0200413# MAKEFLAGS are sorted and normalized. Under GNU make the 's' for
414# -s, --silent or --quiet is always the first char.
Jack Jansen1999ef42001-12-06 21:47:20 +0000415sharedmods: $(BUILDPYTHON)
Christian Heimesf84dcff2012-09-07 02:24:58 +0200416 @case "$$MAKEFLAGS" in \
417 s*) quiet="-q";; \
418 *) quiet="";; \
419 esac; \
Matthias Klose63c6f512012-08-28 18:52:28 +0200420 $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
Christian Heimesf84dcff2012-09-07 02:24:58 +0200421 ./$(BUILDPYTHON) -E $(srcdir)/setup.py $$quiet build
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000422
423# Build static library
Guido van Rossum4e6a7a62001-04-09 22:23:22 +0000424# avoid long command lines, same as LIBRARY_OBJS
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000425$(LIBRARY): $(LIBRARY_OBJS)
426 -rm -f $@
Tarek Ziadé99f660a2009-05-07 21:20:34 +0000427 $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
428 $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
429 $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
430 $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
431 $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
432 $(AR) $(ARFLAGS) $@ $(MODOBJS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000433 $(RANLIB) $@
434
Martin v. Löwis1142de32002-03-29 16:28:31 +0000435libpython$(VERSION).so: $(LIBRARY_OBJS)
Martin v. Löwisbc122622003-06-14 13:11:24 +0000436 if test $(INSTSONAME) != $(LDLIBRARY); then \
Antoine Pitrou58dab672010-10-10 09:54:59 +0000437 $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
Martin v. Löwis45ec95d2003-03-30 15:37:33 +0000438 $(LN) -f $(INSTSONAME) $@; \
Ronald Oussoren79f90492009-01-02 10:44:46 +0000439 else \
Antoine Pitrou58dab672010-10-10 09:54:59 +0000440 $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
Martin v. Löwis45ec95d2003-03-30 15:37:33 +0000441 fi
Martin v. Löwis1142de32002-03-29 16:28:31 +0000442
Ronald Oussoren79f90492009-01-02 10:44:46 +0000443libpython$(VERSION).dylib: $(LIBRARY_OBJS)
444 $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
445
446
Martin v. Löwis1142de32002-03-29 16:28:31 +0000447libpython$(VERSION).sl: $(LIBRARY_OBJS)
Antoine Pitrou58dab672010-10-10 09:54:59 +0000448 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000449
Martin v. Löwisbf0dfb32010-04-01 07:40:51 +0000450# Copy up the gdb python hooks into a position where they can be automatically
451# loaded by gdb during Lib/test/test_gdb.py
452#
453# Distributors are likely to want to install this somewhere else e.g. relative
454# to the stripped DWARF data for the shared library.
455gdbhooks: $(BUILDPYTHON)-gdb.py
456
Ronald Oussoren891cd832010-04-05 11:21:21 +0000457SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
R. David Murraydd194ab2010-04-05 01:34:50 +0000458$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
459 $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
Martin v. Löwisbf0dfb32010-04-01 07:40:51 +0000460
Jack Jansenea0c3822002-08-01 21:57:49 +0000461# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
462# minimal framework (not including the Lib directory and such) in the current
463# directory.
Ronald Oussoren580c7fe2008-05-02 19:45:11 +0000464RESSRCDIR=Mac/Resources/framework
Jack Jansenea0c3822002-08-01 21:57:49 +0000465$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
466 $(LIBRARY) \
Ronald Oussoren580c7fe2008-05-02 19:45:11 +0000467 $(RESSRCDIR)/Info.plist
Jack Jansen246debb2002-02-12 21:30:53 +0000468 $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
Ronald Oussoren19199832011-03-14 11:57:39 -0400469 $(CC) -o $(LDLIBRARY) $(LDFLAGS) -dynamiclib \
470 -all_load $(LIBRARY) -Wl,-single_module \
471 -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
472 -compatibility_version $(VERSION) \
473 -current_version $(VERSION);
Jack Jansenea0c3822002-08-01 21:57:49 +0000474 $(INSTALL) -d -m $(DIRMODE) \
475 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
476 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
477 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
Jack Jansenc736b8d2002-08-04 21:17:20 +0000478 $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
Jack Jansenb36687a2004-07-16 08:43:47 +0000479 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
Jack Jansenc736b8d2002-08-04 21:17:20 +0000480 $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
481 $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000482
Jason Tishler30765592003-09-04 11:04:06 +0000483# This rule builds the Cygwin Python DLL and import library if configured
484# for a shared core library; otherwise, this rule is a noop.
485$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
486 if test -n "$(DLLLIBRARY)"; then \
Antoine Pitrou58dab672010-10-10 09:54:59 +0000487 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
Gregory P. Smith2bb25cc2008-09-02 05:29:51 +0000488 $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \
Jason Tishler30765592003-09-04 11:04:06 +0000489 else true; \
490 fi
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000491
492
493oldsharedmods: $(SHAREDMODS)
494
495
496Makefile Modules/config.c: Makefile.pre \
497 $(srcdir)/Modules/config.c.in \
498 $(MAKESETUP) \
499 Modules/Setup.config \
500 Modules/Setup \
501 Modules/Setup.local
502 $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
503 -s Modules \
504 Modules/Setup.config \
505 Modules/Setup.local \
506 Modules/Setup
507 @mv config.c Modules
508 @echo "The Makefile was updated, you may need to re-run make."
509
510
511Modules/Setup: $(srcdir)/Modules/Setup.dist
512 @if test -f Modules/Setup; then \
513 echo "-----------------------------------------------"; \
514 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
515 echo "check to make sure you have all the updates you"; \
516 echo "need in your Modules/Setup file."; \
Benjamin Petersoned02e512008-05-12 00:46:49 +0000517 echo "Usually, copying Modules/Setup.dist to Modules/Setup will work."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000518 echo "-----------------------------------------------"; \
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000519 fi
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000520
521############################################################################
522# Special rules for object files
523
Martin v. Löwisdea59e52006-01-05 10:00:36 +0000524Modules/getbuildinfo.o: $(PARSER_OBJS) \
525 $(OBJECT_OBJS) \
526 $(PYTHON_OBJS) \
527 $(MODULE_OBJS) \
528 $(SIGNAL_OBJS) \
529 $(MODOBJS) \
530 $(srcdir)/Modules/getbuildinfo.c
Georg Brandl3a5508e2011-03-06 10:42:21 +0100531 $(CC) -c $(PY_CFLAGS) \
532 -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" \
533 -DHGVERSION="\"`LC_ALL=C $(HGVERSION)`\"" \
534 -DHGTAG="\"`LC_ALL=C $(HGTAG)`\"" \
535 -DHGBRANCH="\"`LC_ALL=C $(HGBRANCH)`\"" \
536 -o $@ $(srcdir)/Modules/getbuildinfo.c
Andrew M. Kuchling03184e22001-01-26 22:52:45 +0000537
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000538Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000539 $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
540 -DPREFIX='"$(prefix)"' \
541 -DEXEC_PREFIX='"$(exec_prefix)"' \
542 -DVERSION='"$(VERSION)"' \
543 -DVPATH='"$(VPATH)"' \
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000544 -o $@ $(srcdir)/Modules/getpath.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000545
Martin v. Löwis0f48d982006-04-14 14:34:26 +0000546Modules/python.o: $(srcdir)/Modules/python.c
547 $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000548
549
Antoine Pitrou9828b562011-01-03 19:11:32 +0000550# Use a stamp file to prevent make -j invoking pgen twice
551$(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
552Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
Neal Norwitze77d1032007-10-12 03:01:01 +0000553 -@$(INSTALL) -d Include
Antoine Pitrou9828b562011-01-03 19:11:32 +0000554 $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
555 -touch Parser/pgen.stamp
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000556
557$(PGEN): $(PGENOBJS)
Martin v. Löwis6702d8a2003-07-13 10:10:42 +0000558 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000559
560Parser/grammar.o: $(srcdir)/Parser/grammar.c \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000561 $(srcdir)/Include/token.h \
562 $(srcdir)/Include/grammar.h
563Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
564
Martin v. Löwis00f1e3f2002-08-04 17:29:52 +0000565Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c
566
Anthony Baxter24640872007-01-12 09:35:56 +0000567Parser/pgenmain.o: $(srcdir)/Include/parsetok.h
568
Martin v. Löwis75801492006-04-14 15:02:32 +0000569$(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
Trent Nelsonf6407a12012-08-30 14:56:13 +0000570 $(MKDIR_P) $(AST_H_DIR)
Martin v. Löwis75801492006-04-14 15:02:32 +0000571 $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000572
Martin v. Löwis75801492006-04-14 15:02:32 +0000573$(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
Trent Nelsonf6407a12012-08-30 14:56:13 +0000574 $(MKDIR_P) $(AST_C_DIR)
Martin v. Löwis75801492006-04-14 15:02:32 +0000575 $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
Barry Warsaw00decd72006-07-27 23:43:15 +0000576
Benjamin Peterson80ce61c2009-06-09 17:24:26 +0000577Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
Neil Schemenauer40417742001-02-27 02:45:36 +0000578
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000579Python/getplatform.o: $(srcdir)/Python/getplatform.c
Mark Hammond8235ea12002-07-19 06:55:41 +0000580 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000581
582Python/importdl.o: $(srcdir)/Python/importdl.c
Mark Hammond8235ea12002-07-19 06:55:41 +0000583 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000584
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000585Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
586 $(srcdir)/Objects/unicodetype_db.h
587
Christian Heimes3376d642008-02-24 22:48:05 +0000588STRINGLIB_HEADERS= \
Christian Heimes1a6387e2008-03-26 12:49:49 +0000589 $(srcdir)/Include/bytes_methods.h \
Christian Heimes3376d642008-02-24 22:48:05 +0000590 $(srcdir)/Objects/stringlib/count.h \
Christian Heimes1a6387e2008-03-26 12:49:49 +0000591 $(srcdir)/Objects/stringlib/ctype.h \
Christian Heimes3376d642008-02-24 22:48:05 +0000592 $(srcdir)/Objects/stringlib/fastsearch.h \
593 $(srcdir)/Objects/stringlib/find.h \
594 $(srcdir)/Objects/stringlib/formatter.h \
595 $(srcdir)/Objects/stringlib/partition.h \
Antoine Pitrou64672132010-01-13 07:55:48 +0000596 $(srcdir)/Objects/stringlib/split.h \
Christian Heimes3376d642008-02-24 22:48:05 +0000597 $(srcdir)/Objects/stringlib/stringdefs.h \
598 $(srcdir)/Objects/stringlib/string_format.h \
Christian Heimes1a6387e2008-03-26 12:49:49 +0000599 $(srcdir)/Objects/stringlib/transmogrify.h \
Eric Smithcf537ff2008-05-11 19:52:48 +0000600 $(srcdir)/Objects/stringlib/unicodedefs.h \
601 $(srcdir)/Objects/stringlib/localeutil.h
Christian Heimes3376d642008-02-24 22:48:05 +0000602
Eric Smitha9f7d622008-02-17 19:46:49 +0000603Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
Christian Heimes3376d642008-02-24 22:48:05 +0000604 $(STRINGLIB_HEADERS)
Eric Smitha9f7d622008-02-17 19:46:49 +0000605
Benjamin Petersonfac1bc62009-01-13 21:42:23 +0000606Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \
Benjamin Peterson3a5067c2009-01-13 22:22:41 +0000607 $(STRINGLIB_HEADERS)
Benjamin Petersonfac1bc62009-01-13 21:42:23 +0000608
Eric Smithba486c52008-02-19 12:27:59 +0000609Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \
Christian Heimes3376d642008-02-24 22:48:05 +0000610 $(STRINGLIB_HEADERS)
Eric Smithba486c52008-02-19 12:27:59 +0000611
Eric Smitha9f7d622008-02-17 19:46:49 +0000612Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
Christian Heimes3376d642008-02-24 22:48:05 +0000613 $(STRINGLIB_HEADERS)
Eric Smitha9f7d622008-02-17 19:46:49 +0000614
615Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
Christian Heimes3376d642008-02-24 22:48:05 +0000616 $(STRINGLIB_HEADERS)
Eric Smitha9f7d622008-02-17 19:46:49 +0000617
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000618############################################################################
619# Header files
620
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000621PYTHON_HEADERS= \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000622 Include/Python-ast.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000623 Include/Python.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000624 Include/abstract.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000625 Include/asdl.h \
626 Include/ast.h \
627 Include/bitset.h \
Guido van Rossum77f6a652002-04-03 22:41:51 +0000628 Include/boolobject.h \
Benjamin Peterson3a5067c2009-01-13 22:22:41 +0000629 Include/bytearrayobject.h \
Christian Heimes1a6387e2008-03-26 12:49:49 +0000630 Include/bytes_methods.h \
631 Include/bytesobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000632 Include/bufferobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000633 Include/cellobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000634 Include/ceval.h \
635 Include/classobject.h \
636 Include/cobject.h \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000637 Include/code.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000638 Include/codecs.h \
639 Include/compile.h \
640 Include/complexobject.h \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000641 Include/descrobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000642 Include/dictobject.h \
Mark Dickinsonbb282852009-10-24 12:13:30 +0000643 Include/dtoa.h \
Guido van Rossum7dab2422002-04-26 19:40:56 +0000644 Include/enumobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000645 Include/errcode.h \
646 Include/eval.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000647 Include/fileobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000648 Include/floatobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000649 Include/frameobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000650 Include/funcobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000651 Include/genobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000652 Include/import.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000653 Include/intobject.h \
654 Include/intrcheck.h \
655 Include/iterobject.h \
656 Include/listobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000657 Include/longintrepr.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000658 Include/longobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000659 Include/marshal.h \
Antoine Pitrou789be0c2009-04-02 21:18:34 +0000660 Include/memoryobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000661 Include/metagrammar.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000662 Include/methodobject.h \
663 Include/modsupport.h \
664 Include/moduleobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000665 Include/node.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000666 Include/object.h \
667 Include/objimpl.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000668 Include/opcode.h \
669 Include/osdefs.h \
Anthony Baxter24640872007-01-12 09:35:56 +0000670 Include/parsetok.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000671 Include/patchlevel.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000672 Include/pgen.h \
673 Include/pgenheaders.h \
Neal Norwitzadb69fc2005-12-17 20:54:49 +0000674 Include/pyarena.h \
Larry Hastings402b73f2010-03-25 00:54:54 +0000675 Include/pycapsule.h \
Eric Smithcac7af62009-04-27 19:04:37 +0000676 Include/pyctype.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000677 Include/pydebug.h \
678 Include/pyerrors.h \
679 Include/pyfpe.h \
Christian Heimes6f341092008-04-18 23:13:07 +0000680 Include/pymath.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000681 Include/pygetopt.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000682 Include/pymem.h \
683 Include/pyport.h \
684 Include/pystate.h \
Christian Heimes0a8143f2007-12-18 23:22:54 +0000685 Include/pystrcmp.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000686 Include/pystrtod.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000687 Include/pythonrun.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000688 Include/pythread.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000689 Include/rangeobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000690 Include/setobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000691 Include/sliceobject.h \
692 Include/stringobject.h \
693 Include/structmember.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000694 Include/structseq.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000695 Include/symtable.h \
696 Include/sysmodule.h \
697 Include/traceback.h \
698 Include/tupleobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000699 Include/ucnhash.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000700 Include/unicodeobject.h \
Brett Cannone9746892008-04-12 23:44:07 +0000701 Include/warnings.h \
Fred Drake502ed822001-10-05 21:56:02 +0000702 Include/weakrefobject.h \
Christian Heimes3beae9b2008-01-21 13:11:15 +0000703 pyconfig.h \
704 $(PARSER_HEADERS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000705
Martin v. Löwis0f48d982006-04-14 14:34:26 +0000706$(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000707
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000708
709######################################################################
710
711# Test the interpreter (twice, once without .pyc files, once with)
Skip Montanaroc9803ab2003-05-06 16:17:27 +0000712# In the past, we've had problems where bugs in the marshalling or
713# elsewhere caused bytecode read from .pyc files to behave differently
714# than bytecode generated directly from a .py source file. Sometimes
Ezio Melotti90fd01b2010-03-31 22:18:09 +0000715# the bytecode read from a .pyc file had the bug, sometimes the directly
Skip Montanaroc9803ab2003-05-06 16:17:27 +0000716# generated bytecode. This is sometimes a very shy bug needing a lot of
717# sample data.
718
Neal Norwitzdf431652006-02-22 07:24:06 +0000719TESTOPTS= -l $(EXTRATESTOPTS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000720TESTPROG= $(srcdir)/Lib/test/regrtest.py
Antoine Pitrou3125f502010-10-14 11:37:30 +0000721TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000722test: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000723 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000724 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
725 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000726
Skip Montanaro446ad712003-05-06 15:30:20 +0000727testall: all platform
728 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Thomas Wouters00417a32008-01-26 01:47:05 +0000729 $(TESTPYTHON) $(srcdir)/Lib/compileall.py
Christian Heimescc7f26b2007-11-21 02:50:06 +0000730 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Antoine Pitrou98431782010-04-12 00:10:46 +0000731 -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
732 $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
Skip Montanaro446ad712003-05-06 15:30:20 +0000733
Ronald Oussoren988117f2006-04-29 11:31:35 +0000734# Run the unitests for both architectures in a Universal build on OSX
735# Must be run on an Intel box.
736testuniversal: all platform
737 if [ `arch` != 'i386' ];then \
738 echo "This can only be used on OSX/i386" ;\
739 exit 1 ;\
740 fi
741 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Antoine Pitrou98431782010-04-12 00:10:46 +0000742 -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
743 $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
744 $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS)
Ronald Oussoren988117f2006-04-29 11:31:35 +0000745
746
Martin v. Löwisbfa8bd72006-03-13 10:59:32 +0000747# Like testall, but with a single pass only
Matthias Klose642ac852007-09-04 18:17:36 +0000748# run an optional script to include some information about the build environment
Neal Norwitz377f54e2006-05-31 08:01:08 +0000749buildbottest: all platform
Matthias Klose4f2ba552007-09-04 19:05:38 +0000750 -@if which pybuildbot.identify >/dev/null 2>&1; then \
751 pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
752 fi
Benjamin Petersonaee9dfb2012-02-20 21:44:56 -0500753 $(TESTPYTHON) -R $(TESTPROG) -uall -rwW $(TESTOPTS)
Martin v. Löwisbfa8bd72006-03-13 10:59:32 +0000754
Jeremy Hylton1e6da5c2009-03-31 13:31:00 +0000755QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
756 test_multibytecodec test_urllib2_localnet test_itertools \
757 test_multiprocessing test_mailbox test_socket test_poll \
758 test_select test_zipfile
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000759quicktest: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000760 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000761 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
762 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000763
Barry Warsaw42119252001-03-03 04:14:21 +0000764MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
765 test_longexp
766memtest: all platform
767 -rm -f $(srcdir)/Lib/test/*.py[co]
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000768 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
769 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
Barry Warsaw42119252001-03-03 04:14:21 +0000770
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000771# Install everything
Ronald Oussoren567a8ff2006-05-26 11:43:26 +0000772install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000773
774# Install almost everything without disturbing previous versions
Ronald Oussoren5b787322006-06-06 19:50:24 +0000775altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
776 sharedinstall oldsharedinstall @FRAMEWORKALTINSTALLLAST@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000777
778# Install shared libraries enabled by Setup
779DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
780
781oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
782 @for i in X $(SHAREDMODS); do \
Neil Schemenauerac959772001-02-06 14:50:27 +0000783 if test $$i != X; then \
784 echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000785 $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
Neil Schemenauerac959772001-02-06 14:50:27 +0000786 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000787 done
788
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000789$(DESTSHARED):
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000790 @for i in $(DESTDIRS); \
791 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000792 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000793 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000794 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000795 else true; \
796 fi; \
797 done
798
799
Nick Coghlane6010062012-02-17 22:10:38 +1000800# Install the interpreter by creating a symlink chain:
801# $(PYTHON) -> python2 -> python$(VERSION))
802# Also create equivalent chains for other installed files
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000803bininstall: altbininstall
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000804 -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
805 then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000806 else true; \
807 fi
Nick Coghlane6010062012-02-17 22:10:38 +1000808 (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
809 -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
810 (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
811 -rm -f $(DESTDIR)$(BINDIR)/python2-config
812 (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config)
Georg Brandlbd9d5442007-09-07 20:10:49 +0000813 -rm -f $(DESTDIR)$(BINDIR)/python-config
Nick Coghlane6010062012-02-17 22:10:38 +1000814 (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
Ronald Oussoren25967582009-09-06 10:00:26 +0000815 -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
Nick Coghlane6010062012-02-17 22:10:38 +1000816 -rm -f $(DESTDIR)$(LIBPC)/python2.pc
817 (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
Antoine Pitrouf2caeed2009-05-24 20:23:57 +0000818 -rm -f $(DESTDIR)$(LIBPC)/python.pc
Nick Coghlane6010062012-02-17 22:10:38 +1000819 (cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000820
821# Install the interpreter with $(VERSION) affixed
822# This goes into $(exec_prefix)
Jack Jansen1999ef42001-12-06 21:47:20 +0000823altbininstall: $(BUILDPYTHON)
Martin v. Löwisd8a20d22002-05-08 08:59:59 +0000824 @for i in $(BINDIR) $(LIBDIR); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000825 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000826 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000827 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000828 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000829 else true; \
830 fi; \
831 done
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000832 $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
Ronald Oussoren79f90492009-01-02 10:44:46 +0000833 if test -f $(LDLIBRARY); then \
Ronald Oussoren0bbebbb2009-01-02 15:06:00 +0000834 if test -n "$(DLLLIBRARY)" ; then \
835 $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000836 else \
Ronald Oussoren79f90492009-01-02 10:44:46 +0000837 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
838 if test $(LDLIBRARY) != $(INSTSONAME); then \
839 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
Martin v. Löwise3be8602003-11-18 19:54:20 +0000840 fi \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000841 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000842 else true; \
843 fi
844
845# Install the manual page
846maninstall:
847 @for i in $(MANDIR) $(MANDIR)/man1; \
848 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000849 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000850 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000851 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000852 else true; \
853 fi; \
854 done
855 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
Matthias Klose015c84b2008-10-21 09:12:25 +0000856 $(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000857
858# Install the library
859PLATDIR= plat-$(MACHDEP)
Jack Jansen83f898c2002-12-30 22:23:40 +0000860EXTRAPLATDIR= @EXTRAPLATDIR@
Jack Jansen7b59b422003-03-17 15:44:10 +0000861EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@
Jack Jansen83f898c2002-12-30 22:23:40 +0000862MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
Fred Drakefbdeaad2006-07-29 16:56:15 +0000863XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
Jack Jansen83f898c2002-12-30 22:23:40 +0000864PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
Jack Jansend68d9292003-01-21 15:05:02 +0000865 plat-mac/lib-scriptpackages/_builtinSuites \
Jack Jansen83f898c2002-12-30 22:23:40 +0000866 plat-mac/lib-scriptpackages/CodeWarrior \
867 plat-mac/lib-scriptpackages/Explorer \
868 plat-mac/lib-scriptpackages/Finder \
869 plat-mac/lib-scriptpackages/Netscape \
870 plat-mac/lib-scriptpackages/StdSuites \
Jack Jansen1fff6972003-03-31 09:39:54 +0000871 plat-mac/lib-scriptpackages/SystemEvents \
Neal Norwitzc315a0f2006-06-27 04:28:56 +0000872 plat-mac/lib-scriptpackages/Terminal
Jack Jansen7b59b422003-03-17 15:44:10 +0000873PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
Benjamin Petersondecd14b2010-03-18 21:32:38 +0000874LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
Victor Stinnere2d9e262011-05-25 01:19:57 +0200875 lib-tk/test/test_ttk site-packages test test/data \
Ned Deilyc4f97f42011-05-29 02:36:17 -0700876 test/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
Alexander Belopolsky7a848772010-09-14 14:24:58 +0000877 test/tracedmodules \
Barry Warsawd6316a92006-03-22 14:57:54 +0000878 encodings compiler hotshot \
879 email email/mime email/test email/test/data \
Georg Brandlb1527ab2008-05-20 07:52:27 +0000880 json json/tests \
Skip Montanaro353aa872006-04-03 16:40:10 +0000881 sqlite3 sqlite3/test \
Brett Cannon94196532009-02-03 04:58:29 +0000882 logging bsddb bsddb/test csv importlib wsgiref \
Benjamin Petersonb3efcbc2009-04-08 13:29:41 +0000883 lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
Benjamin Peterson82d1cf12009-04-19 03:02:54 +0000884 lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
Thomas Hellerfc9fc472006-04-03 20:10:50 +0000885 ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
Fred Drakee612c8e2005-01-19 06:24:58 +0000886 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
Benjamin Petersone0f12442008-06-20 02:47:03 +0000887 multiprocessing multiprocessing/dummy \
Michael Foord79d1fa92010-03-26 13:07:38 +0000888 unittest unittest/test \
Brett Cannonb61d8012008-05-11 23:39:04 +0000889 lib-old \
Ronald Oussorenf44c6542009-05-19 19:06:38 +0000890 curses pydoc_data $(MACHDEPS)
Ned Deily63144c62011-06-28 00:39:19 -0700891libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000892 @for i in $(SCRIPTDIR) $(LIBDEST); \
893 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000894 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000895 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000896 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000897 else true; \
898 fi; \
899 done
900 @for d in $(LIBSUBDIRS); \
901 do \
902 a=$(srcdir)/Lib/$$d; \
903 if test ! -d $$a; then continue; else true; fi; \
904 b=$(LIBDEST)/$$d; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000905 if test ! -d $(DESTDIR)$$b; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000906 echo "Creating directory $$b"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000907 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000908 else true; \
909 fi; \
910 done
Ronald Oussorenfb322cd2006-06-25 21:19:06 +0000911 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000912 do \
913 if test -x $$i; then \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000914 $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000915 echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000916 else \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000917 $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000918 echo $(INSTALL_DATA) $$i $(LIBDEST); \
919 fi; \
920 done
921 @for d in $(LIBSUBDIRS); \
922 do \
923 a=$(srcdir)/Lib/$$d; \
924 if test ! -d $$a; then continue; else true; fi; \
Hye-Shik Changdfbd34c2006-03-23 12:12:44 +0000925 if test `ls $$a | wc -l` -lt 1; then continue; fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000926 b=$(LIBDEST)/$$d; \
927 for i in $$a/*; \
928 do \
929 case $$i in \
930 *CVS) ;; \
931 *.py[co]) ;; \
932 *.orig) ;; \
933 *~) ;; \
934 *) \
935 if test -d $$i; then continue; fi; \
936 if test -x $$i; then \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000937 echo $(INSTALL_SCRIPT) $$i $$b; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000938 $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000939 else \
940 echo $(INSTALL_DATA) $$i $$b; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000941 $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000942 fi;; \
943 esac; \
944 done; \
945 done
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000946 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
Ned Deily63144c62011-06-28 00:39:19 -0700947 if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
948 $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
949 $(DESTDIR)$(LIBDEST)/distutils/tests ; \
950 fi
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000951 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
952 ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000953 -d $(LIBDEST) -f \
Benjamin Petersond8fdd7e2010-03-18 22:55:46 +0000954 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
Benjamin Petersone753abd2009-04-11 19:31:00 +0000955 $(DESTDIR)$(LIBDEST)
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000956 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
957 ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000958 -d $(LIBDEST) -f \
Benjamin Petersond8fdd7e2010-03-18 22:55:46 +0000959 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
Benjamin Petersone753abd2009-04-11 19:31:00 +0000960 $(DESTDIR)$(LIBDEST)
Hye-Shik Chang0e5e6c72004-03-18 07:51:27 +0000961 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000962 ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000963 -d $(LIBDEST)/site-packages -f \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000964 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
Hye-Shik Chang0e5e6c72004-03-18 07:51:27 +0000965 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000966 ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000967 -d $(LIBDEST)/site-packages -f \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000968 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
Ned Deily10fc1042012-09-08 18:47:27 -0700969 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
970 ./$(BUILDPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
971 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
972 ./$(BUILDPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000973
974# Create the PLATDIR source directory, if one wasn't distributed..
975$(srcdir)/Lib/$(PLATDIR):
976 mkdir $(srcdir)/Lib/$(PLATDIR)
977 cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
978 export PATH; PATH="`pwd`:$$PATH"; \
979 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000980 export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
Jack Jansen0d153662001-12-19 09:24:40 +0000981 export EXE; EXE="$(BUILDEXE)"; \
Ronald Oussoren5a5c7392009-01-02 10:50:48 +0000982 cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000983
Collin Winter00dd3f52010-03-19 00:00:30 +0000984python-config: $(srcdir)/Misc/python-config.in
985 # Substitution happens here, as the completely-expanded BINDIR
986 # is not available in configure
987 sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
988
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000989# Install the include files
990INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
991inclinstall:
992 @for i in $(INCLDIRSTOMAKE); \
993 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000994 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000995 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000996 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000997 else true; \
998 fi; \
999 done
1000 @for i in $(srcdir)/Include/*.h; \
1001 do \
1002 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001003 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001004 done
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001005 $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001006
1007# Install the library and miscellaneous stuff needed for extending/embedding
1008# This goes into $(exec_prefix)
1009LIBPL= $(LIBP)/config
Antoine Pitrouf2caeed2009-05-24 20:23:57 +00001010
1011# pkgconfig directory
1012LIBPC= $(LIBDIR)/pkgconfig
1013
Collin Winter00dd3f52010-03-19 00:00:30 +00001014libainstall: all python-config
Antoine Pitrouf2caeed2009-05-24 20:23:57 +00001015 @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001016 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001017 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001018 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001019 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001020 else true; \
1021 fi; \
1022 done
Martin v. Löwis1142de32002-03-29 16:28:31 +00001023 @if test -d $(LIBRARY); then :; else \
Jack Jansen127e56e2001-09-11 14:41:54 +00001024 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jason Tishlerc0f1e772002-07-29 16:18:23 +00001025 if test "$(SO)" = .dll; then \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001026 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
Jason Tishlerc0f1e772002-07-29 16:18:23 +00001027 else \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001028 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
1029 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
Jason Tishlerc0f1e772002-07-29 16:18:23 +00001030 fi; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +00001031 else \
Martin v. Löwis1142de32002-03-29 16:28:31 +00001032 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +00001033 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001034 fi
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001035 $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
Martin v. Löwis0f48d982006-04-14 14:34:26 +00001036 $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001037 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
1038 $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
1039 $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
1040 $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
1041 $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
Antoine Pitrouf2caeed2009-05-24 20:23:57 +00001042 $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001043 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
1044 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
Georg Brandlb142c632006-07-30 16:20:10 +00001045 $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
Martin v. Löwisc90b17e2006-04-15 08:13:05 +00001046 rm python-config
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001047 @if [ -s Modules/python.exp -a \
1048 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
1049 echo; echo "Installing support files for building shared extension modules on AIX:"; \
1050 $(INSTALL_DATA) Modules/python.exp \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001051 $(DESTDIR)$(LIBPL)/python.exp; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001052 echo; echo "$(LIBPL)/python.exp"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +00001053 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001054 $(DESTDIR)$(LIBPL)/makexp_aix; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001055 echo "$(LIBPL)/makexp_aix"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +00001056 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001057 $(DESTDIR)$(LIBPL)/ld_so_aix; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001058 echo "$(LIBPL)/ld_so_aix"; \
1059 echo; echo "See Misc/AIX-NOTES for details."; \
1060 else true; \
1061 fi
1062 @case "$(MACHDEP)" in beos*) \
1063 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001064 $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001065 echo; echo "$(LIBPL)/README"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001066 $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +00001067 echo "$(LIBPL)/ar_beos"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001068 $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +00001069 echo "$(LIBPL)/ld_so_beos"; \
1070 echo; echo "See Misc/BeOS-NOTES for details."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001071 ;; \
1072 esac
1073
1074# Install the dynamically loadable modules
1075# This goes into $(exec_prefix)
Benjamin Peterson4082d9b2010-07-17 20:41:16 +00001076sharedinstall: sharedmods
Martin v. Löwis1142de32002-03-29 16:28:31 +00001077 $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
1078 --prefix=$(prefix) \
Guido van Rossumb33e7892001-10-17 06:26:53 +00001079 --install-scripts=$(BINDIR) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001080 --install-platlib=$(DESTSHARED) \
Thomas Wouters5edae7e2011-03-06 11:48:05 -08001081 --root=$(DESTDIR)/
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001082
Jack Jansencb4321e2002-08-09 00:18:21 +00001083# Here are a couple of targets for MacOSX again, to install a full
1084# framework-based Python. frameworkinstall installs everything, the
1085# subtargets install specific parts. Much of the actual work is offloaded to
Ronald Oussoren2db3a8f2006-06-07 19:06:01 +00001086# the Makefile in Mac
Jack Jansencb4321e2002-08-09 00:18:21 +00001087#
Ronald Oussoren567a8ff2006-05-26 11:43:26 +00001088#
1089# This target is here for backward compatiblity, previous versions of Python
1090# hadn't integrated framework installation in the normal install process.
1091frameworkinstall: install
Guido van Rossumed2f7252002-08-09 19:18:25 +00001092
Jack Jansenb6e9cad2001-08-15 01:26:28 +00001093# On install, we re-make the framework
1094# structure in the install location, /Library/Frameworks/ or the argument to
1095# --enable-framework. If --enable-framework has been specified then we have
1096# automatically set prefix to the location deep down in the framework, so we
1097# only have to cater for the structural bits of the framework.
1098
Jack Jansencb4321e2002-08-09 00:18:21 +00001099frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
1100
1101frameworkinstallstructure: $(LDLIBRARY)
Jack Jansen127e56e2001-09-11 14:41:54 +00001102 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jack Jansenb6e9cad2001-08-15 01:26:28 +00001103 echo Not configured with --enable-framework; \
Jack Jansen127e56e2001-09-11 14:41:54 +00001104 exit 1; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +00001105 else true; \
1106 fi
Jack Jansencb4321e2002-08-09 00:18:21 +00001107 @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001108 if test ! -d $(DESTDIR)$$i; then \
Jack Jansen9592fe92003-05-25 22:01:32 +00001109 echo "Creating directory $(DESTDIR)$$i"; \
1110 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +00001111 else true; \
1112 fi; \
1113 done
Jack Jansen9592fe92003-05-25 22:01:32 +00001114 $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
Ronald Oussoren580c7fe2008-05-02 19:45:11 +00001115 sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
Jack Jansen9592fe92003-05-25 22:01:32 +00001116 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
Ronald Oussoren580c7fe2008-05-02 19:45:11 +00001117 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
Jack Jansen9592fe92003-05-25 22:01:32 +00001118 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
1119 $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
Jack Jansen4735b232003-06-20 20:36:53 +00001120 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
Guido van Rossum7cb32ae2001-08-17 15:32:31 +00001121
Jack Jansencb4321e2002-08-09 00:18:21 +00001122# This installs Mac/Lib into the framework
Ronald Oussoren0350f812006-06-27 15:45:32 +00001123# Install a number of symlinks to keep software that expects a normal unix
1124# install (which includes python-config) happy.
Jack Jansencb4321e2002-08-09 00:18:21 +00001125frameworkinstallmaclib:
Ronald Oussoren580c7fe2008-05-02 19:45:11 +00001126 ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
Ronald Oussorenb5afe542009-12-24 14:17:19 +00001127 ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).dylib"
Ronald Oussoren8e631252009-06-08 20:54:59 +00001128 ln -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
Ronald Oussoren2db3a8f2006-06-07 19:06:01 +00001129 cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)"
Jack Jansencb4321e2002-08-09 00:18:21 +00001130
1131# This installs the IDE, the Launcher and other apps into /Applications
1132frameworkinstallapps:
Ronald Oussoren2db3a8f2006-06-07 19:06:01 +00001133 cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
Jack Jansencb4321e2002-08-09 00:18:21 +00001134
1135# This install the unix python and pythonw tools in /usr/local/bin
1136frameworkinstallunixtools:
Ronald Oussoren2db3a8f2006-06-07 19:06:01 +00001137 cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
Jack Jansen0b06be72002-06-21 14:48:38 +00001138
Ronald Oussoren5b787322006-06-06 19:50:24 +00001139frameworkaltinstallunixtools:
Ronald Oussoren2db3a8f2006-06-07 19:06:01 +00001140 cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
Ronald Oussoren5b787322006-06-06 19:50:24 +00001141
Jack Jansena1b77582003-06-19 22:35:20 +00001142# This installs the Demos and Tools into the applications directory.
1143# It is not part of a normal frameworkinstall
1144frameworkinstallextras:
Mark Dickinsond66c6d32008-12-18 19:46:21 +00001145 cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
Jack Jansena1b77582003-06-19 22:35:20 +00001146
Skip Montanarodecc6a42003-01-01 20:07:49 +00001147# This installs a few of the useful scripts in Tools/scripts
1148scriptsinstall:
Martin v. Löwis01f43112003-01-03 20:39:29 +00001149 SRCDIR=$(srcdir) $(RUNSHARED) \
Skip Montanarodecc6a42003-01-01 20:07:49 +00001150 ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
1151 --prefix=$(prefix) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +00001152 --install-scripts=$(BINDIR) \
Thomas Wouters5edae7e2011-03-06 11:48:05 -08001153 --root=$(DESTDIR)/
Skip Montanarodecc6a42003-01-01 20:07:49 +00001154
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001155# Build the toplevel Makefile
1156Makefile.pre: Makefile.pre.in config.status
1157 CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
1158 $(MAKE) -f Makefile.pre Makefile
1159
Neil Schemenauer64b1b682001-03-22 00:32:32 +00001160# Run the configure script.
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001161config.status: $(srcdir)/configure
Neil Schemenauer64b1b682001-03-22 00:32:32 +00001162 $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001163
Jack Jansen1999ef42001-12-06 21:47:20 +00001164.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001165
1166# Some make's put the object file in the current directory
1167.c.o:
Neil Schemenauer7ac954b2001-01-26 16:14:41 +00001168 $(CC) -c $(PY_CFLAGS) -o $@ $<
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001169
Martin v. Löwis4be4e652006-04-17 19:25:49 +00001170# Run reindent on the library
1171reindent:
Brett Cannon870d0c22008-01-29 04:13:07 +00001172 ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
Martin v. Löwis4be4e652006-04-17 19:25:49 +00001173
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001174# Rerun configure with the same options as it was run last time,
1175# provided the config.status script exists
1176recheck:
1177 $(SHELL) config.status --recheck
1178 $(SHELL) config.status
1179
Matthias Klose3cef2a92012-03-14 23:39:33 +01001180# Rebuild the configure script from configure.ac; also rebuild pyconfig.h.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001181autoconf:
1182 (cd $(srcdir); autoconf)
1183 (cd $(srcdir); autoheader)
1184
1185# Create a tags file for vi
1186tags::
1187 cd $(srcdir); \
1188 ctags -w -t Include/*.h; \
1189 for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
1190 done; \
Guido van Rossumc9489662002-02-28 19:26:08 +00001191 sort -o tags tags
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001192
1193# Create a tags file for GNU Emacs
1194TAGS::
1195 cd $(srcdir); \
1196 etags Include/*.h; \
1197 for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
1198
1199# Sanitation targets -- clean leaves libraries, executables and tags
Mark Dickinson143d4332009-09-24 19:21:07 +00001200# files, which clobber removes as well
Brett Cannonab012af2006-04-18 23:58:52 +00001201pycremoval:
1202 find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001203
Brett Cannonab012af2006-04-18 23:58:52 +00001204clean: pycremoval
Georg Brandl004c74d2010-08-01 19:06:51 +00001205 find . -name '*.[oa]' -exec rm -f {} ';'
Guido van Rossumcd0ed972001-04-14 17:57:07 +00001206 find . -name '*.s[ol]' -exec rm -f {} ';'
Georg Brandl004c74d2010-08-01 19:06:51 +00001207 find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
Thomas Helleraddfe222009-04-24 18:10:46 +00001208 find build -name 'fficonfig.h' -exec rm -f {} ';' || true
1209 find build -name 'fficonfig.py' -exec rm -f {} ';' || true
Ned Deily10fc1042012-09-08 18:47:27 -07001210 -rm -f Lib/lib2to3/*Grammar*.pickle
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001211
Gregory P. Smithb2693e02008-04-13 00:03:25 +00001212profile-removal:
1213 find . -name '*.gc??' -exec rm -f {} ';'
1214
1215clobber: clean profile-removal
Jack Jansen1999ef42001-12-06 21:47:20 +00001216 -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
Antoine Pitrou9828b562011-01-03 19:11:32 +00001217 tags TAGS Parser/pgen.stamp \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +00001218 config.cache config.log pyconfig.h Modules/config.c
Guido van Rossum1d88c592001-06-06 17:51:57 +00001219 -rm -rf build platform
Jack Jansenc6096892003-02-27 23:19:46 +00001220 -rm -rf $(PYTHONFRAMEWORKDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001221
1222# Make things extra clean, before making a distribution:
1223# remove all generated files, even Makefile[.pre]
Neal Norwitz1a196b52006-01-03 01:38:53 +00001224# Keep configure and Python-ast.[ch], it's possible they can't be generated
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001225distclean: clobber
Mark Dickinson890499c2010-08-01 21:36:26 +00001226 for file in Lib/test/data/* ; do \
1227 if test "$$file" != "Lib/test/data/README"; then rm "$$file"; fi; \
1228 done
Martin v. Löwisdea59e52006-01-05 10:00:36 +00001229 -rm -f core Makefile Makefile.pre config.status \
Mark Dickinson8dcd06f2009-08-31 14:46:07 +00001230 Modules/Setup Modules/Setup.local Modules/Setup.config \
Georg Brandl71f4fbb2011-02-25 11:04:50 +00001231 Modules/ld_so_aix Modules/python.exp Misc/python.pc
Mark Dickinsona1ffe652010-04-02 20:34:26 +00001232 -rm -f python*-gdb.py
Neil Schemenauere0d43572001-02-03 17:16:29 +00001233 find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
1234 -o -name '[@,#]*' -o -name '*.old' \
1235 -o -name '*.orig' -o -name '*.rej' \
1236 -o -name '*.bak' ')' \
1237 -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001238
1239# Check for smelly exported symbols (not starting with Py/_Py)
1240smelly: all
1241 nm -p $(LIBRARY) | \
1242 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1243
1244# Find files with funny names
1245funny:
Éric Araujofe5c2972011-08-19 08:40:10 +02001246 find $(SUBDIRS) $(SUBDIRSTOO) -type d \
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001247 -o -name '*.[chs]' \
1248 -o -name '*.py' \
1249 -o -name '*.doc' \
1250 -o -name '*.sty' \
1251 -o -name '*.bib' \
1252 -o -name '*.dat' \
1253 -o -name '*.el' \
1254 -o -name '*.fd' \
1255 -o -name '*.in' \
1256 -o -name '*.tex' \
1257 -o -name '*,[vpt]' \
1258 -o -name 'Setup' \
1259 -o -name 'Setup.*' \
1260 -o -name README \
1261 -o -name Makefile \
1262 -o -name ChangeLog \
1263 -o -name Repository \
1264 -o -name Root \
1265 -o -name Entries \
1266 -o -name Tag \
1267 -o -name tags \
1268 -o -name TAGS \
1269 -o -name .cvsignore \
1270 -o -name MANIFEST \
1271 -o -print
1272
Brett Cannona8b09fd2008-03-18 17:25:13 +00001273# Perform some verification checks on any modified files.
Brett Cannoncdeb24b2008-09-05 22:59:17 +00001274patchcheck:
Ronald Oussoren5640ce22008-06-05 12:58:24 +00001275 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
Brett Cannona8b09fd2008-03-18 17:25:13 +00001276
Guido van Rossum9454ad72001-08-18 21:08:22 +00001277# Dependencies
1278
Martin v. Löwis06f15bb2001-12-02 13:02:32 +00001279Python/thread.o: @THREADHEADERS@
Guido van Rossum9454ad72001-08-18 21:08:22 +00001280
Guido van Rossumd4f7da32002-10-10 15:04:04 +00001281# Declare targets that aren't real files
Sean Reifscheideraaad0d62007-09-21 06:33:28 +00001282.PHONY: all build_all sharedmods oldsharedmods test quicktest memtest
Guido van Rossumd4f7da32002-10-10 15:04:04 +00001283.PHONY: install altinstall oldsharedinstall bininstall altbininstall
1284.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1285.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1286.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
Ronald Oussoren5b787322006-06-06 19:50:24 +00001287.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
Brett Cannon60b15d22008-10-06 22:44:37 +00001288.PHONY: smelly funny patchcheck
Martin v. Löwisbf0dfb32010-04-01 07:40:51 +00001289.PHONY: gdbhooks
Guido van Rossumd4f7da32002-10-10 15:04:04 +00001290
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001291# IF YOU PUT ANYTHING HERE IT WILL GO AWAY