blob: 1cc43e60cba32794389d5b4f52a920e1e96db299 [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@
Martin v. Löwisdea59e52006-01-05 10:00:36 +000036SVNVERSION= @SVNVERSION@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000037
38# Shell used by make (some versions default to the login shell, which is bad)
39SHELL= /bin/sh
40
41# Use this to make a link between python$(VERSION) and python in $(BINDIR)
42LN= @LN@
43
44# Portable install script (configure doesn't always guess right)
45INSTALL= @INSTALL@
46INSTALL_PROGRAM=@INSTALL_PROGRAM@
Neil Schemenauer3f5cc202001-04-10 23:03:35 +000047INSTALL_SCRIPT= @INSTALL_SCRIPT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000048INSTALL_DATA= @INSTALL_DATA@
49# Shared libraries must be installed with executable mode on some systems;
50# rather than figuring out exactly which, we always give them executable mode.
51# Also, making them read-only seems to be a good idea...
52INSTALL_SHARED= ${INSTALL} -m 555
53
54MAKESETUP= $(srcdir)/Modules/makesetup
55
56# Compiler options
57OPT= @OPT@
Skip Montanarodecc6a42003-01-01 20:07:49 +000058BASECFLAGS= @BASECFLAGS@
Brett Cannon08cd5982005-04-24 22:26:38 +000059CFLAGS= $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)
Brett Cannon516592f2004-12-07 00:42:59 +000060# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
61# be able to build extension modules using the directories specified in the
62# environment variables
63CPPFLAGS= -I. -I$(srcdir)/Include @CPPFLAGS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000064LDFLAGS= @LDFLAGS@
65LDLAST= @LDLAST@
66SGI_ABI= @SGI_ABI@
Neil Schemenauer7ac954b2001-01-26 16:14:41 +000067CCSHARED= @CCSHARED@
68LINKFORSHARED= @LINKFORSHARED@
69# Extra C flags added for building the interpreter object files.
70CFLAGSFORSHARED=@CFLAGSFORSHARED@
71# C flags used for building the interpreter object files
Mark Hammond8235ea12002-07-19 06:55:41 +000072PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
Neil Schemenauer7ac954b2001-01-26 16:14:41 +000073
Neil Schemenauer85515ad2001-01-24 17:11:43 +000074
75# Machine-dependent subdirectories
76MACHDEP= @MACHDEP@
77
78# Install prefix for architecture-independent files
79prefix= @prefix@
80
81# Install prefix for architecture-dependent files
82exec_prefix= @exec_prefix@
83
84# Expanded directories
85BINDIR= $(exec_prefix)/bin
86LIBDIR= $(exec_prefix)/lib
Martin v. Löwisd429ab62001-08-02 06:20:20 +000087MANDIR= @mandir@
88INCLUDEDIR= @includedir@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000089CONFINCLUDEDIR= $(exec_prefix)/include
90SCRIPTDIR= $(prefix)/lib
91
92# Detailed destination directories
93BINLIBDEST= $(LIBDIR)/python$(VERSION)
94LIBDEST= $(SCRIPTDIR)/python$(VERSION)
95INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
96CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
97LIBP= $(LIBDIR)/python$(VERSION)
98
99# Symbols used for using shared libraries
100SO= @SO@
101LDSHARED= @LDSHARED@
Neil Schemenauer75e33892001-02-16 03:36:53 +0000102BLDSHARED= @BLDSHARED@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000103DESTSHARED= $(BINLIBDEST)/lib-dynload
104
105# Executable suffix (.exe on Windows and Mac OS X)
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000106EXE= @EXEEXT@
Jack Jansen1999ef42001-12-06 21:47:20 +0000107BUILDEXE= @BUILDEXEEXT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000108
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000109# Short name and location for Mac OS X Python framework
110PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
111PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
112PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
113PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
Jack Jansen6b08a402004-06-03 12:41:45 +0000114# Deployment target selected during configure, to be checked
115# by distutils
116CONFIGURE_MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
Bob Ippolito7026a0a2005-03-28 23:23:47 +0000117# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
118OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000119
Martin v. Löwis1142de32002-03-29 16:28:31 +0000120# Environment to run shared python without installed libraries
121RUNSHARED= @RUNSHARED@
122
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000123# Modes for directories, executables and data files created by the
124# install process. Default to user-only-writable for all file types.
125DIRMODE= 755
126EXEMODE= 755
127FILEMODE= 644
128
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000129# configure script arguments
130CONFIG_ARGS= @CONFIG_ARGS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000131
132
133# Subdirectories with code
134SRCDIRS= @SRCDIRS@
135
136# Other subdirectories
137SUBDIRSTOO= Include Lib Misc Demo
138
139# Files and directories to be distributed
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000140CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000141DISTFILES= README ChangeLog $(CONFIGFILES)
142DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
143DIST= $(DISTFILES) $(DISTDIRS)
144
145
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000146LIBRARY= @LIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000147LDLIBRARY= @LDLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000148BLDLIBRARY= @BLDLIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000149DLLLIBRARY= @DLLLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000150LDLIBRARYDIR= @LDLIBRARYDIR@
Martin v. Löwis1142de32002-03-29 16:28:31 +0000151INSTSONAME= @INSTSONAME@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000152
153
154LIBS= @LIBS@
155LIBM= @LIBM@
156LIBC= @LIBC@
157SYSLIBS= $(LIBM) $(LIBC)
Martin v. Löwisf90ae202002-06-11 06:22:31 +0000158SHLIBS= @SHLIBS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000159
160MAINOBJ= @MAINOBJ@
Martin v. Löwis2d7e2642002-04-05 16:50:53 +0000161THREADOBJ= @THREADOBJ@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000162DLINCLDIR= @DLINCLDIR@
163DYNLOADFILE= @DYNLOADFILE@
Jack Jansenc49e5b72001-06-19 15:00:23 +0000164MACHDEP_OBJS= @MACHDEP_OBJS@
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000165UNICODE_OBJS= @UNICODE_OBJS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000166
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000167PYTHON= python$(EXE)
Jack Jansen1999ef42001-12-06 21:47:20 +0000168BUILDPYTHON= python$(BUILDEXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000169
170# === Definitions added by makesetup ===
171
172
173##########################################################################
174# Modules
175MODULE_OBJS= \
176 Modules/config.o \
177 Modules/getpath.o \
Neil Schemenauer9c63e6d2001-08-29 23:44:38 +0000178 Modules/main.o \
179 Modules/gcmodule.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000180
181# Used of signalmodule.o is not available
182SIGNAL_OBJS= @SIGNAL_OBJS@
183
184
185##########################################################################
186# Grammar
Neil Schemenauer7cd124c2001-02-27 02:19:16 +0000187GRAMMAR_H= $(srcdir)/Include/graminit.h
188GRAMMAR_C= $(srcdir)/Python/graminit.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000189GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
190
191
192##########################################################################
193# Parser
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000194PGEN= Parser/pgen$(EXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000195
196POBJS= \
197 Parser/acceler.o \
198 Parser/grammar1.o \
199 Parser/listnode.o \
200 Parser/node.o \
201 Parser/parser.o \
202 Parser/parsetok.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000203 Parser/bitset.o \
Guido van Rossumd3ab37f2003-04-17 14:55:42 +0000204 Parser/metagrammar.o \
205 Parser/firstsets.o \
206 Parser/grammar.o \
207 Parser/pgen.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000208
Martin v. Löwis00f1e3f2002-08-04 17:29:52 +0000209PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000210
211PGOBJS= \
Neil Schemenauerfd1030e2002-04-22 03:05:25 +0000212 Objects/obmalloc.o \
Guido van Rossumf2272522001-12-04 03:54:08 +0000213 Python/mysnprintf.o \
Martin v. Löwis00f1e3f2002-08-04 17:29:52 +0000214 Parser/tokenizer_pgen.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000215 Parser/printgrammar.o \
216 Parser/pgenmain.o
217
218PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
219
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000220##########################################################################
221# AST
222AST_H= $(srcdir)/Include/Python-ast.h
223AST_C= $(srcdir)/Python/Python-ast.c
224AST_ASDL= $(srcdir)/Parser/Python.asdl
225
226ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
227# XXX Note that a build now requires Python exist before the build starts
228ASDLGEN= $(srcdir)/Parser/asdl_c.py -h $(srcdir)/Include -c $(srcdir)/Python
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000229
230##########################################################################
231# Python
232PYTHON_OBJS= \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000233 Python/Python-ast.o \
234 Python/asdl.o \
235 Python/ast.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000236 Python/bltinmodule.o \
237 Python/exceptions.o \
238 Python/ceval.o \
239 Python/compile.o \
240 Python/codecs.o \
241 Python/errors.o \
242 Python/frozen.o \
243 Python/frozenmain.o \
Jeremy Hylton4db62b12001-02-27 19:07:02 +0000244 Python/future.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000245 Python/getargs.o \
246 Python/getcompiler.o \
247 Python/getcopyright.o \
248 Python/getmtime.o \
249 Python/getplatform.o \
250 Python/getversion.o \
251 Python/graminit.o \
252 Python/import.o \
253 Python/importdl.o \
254 Python/marshal.o \
255 Python/modsupport.o \
256 Python/mystrtoul.o \
Marc-André Lemburge5006eb2001-07-31 13:24:44 +0000257 Python/mysnprintf.o \
Neal Norwitzadb69fc2005-12-17 20:54:49 +0000258 Python/pyarena.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000259 Python/pyfpe.o \
260 Python/pystate.o \
261 Python/pythonrun.o \
262 Python/structmember.o \
Jeremy Hyltoncb17ae82001-02-09 22:22:18 +0000263 Python/symtable.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000264 Python/sysmodule.o \
265 Python/traceback.o \
266 Python/getopt.o \
Martin v. Löwis737ea822004-06-08 18:52:54 +0000267 Python/pystrtod.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000268 Python/$(DYNLOADFILE) \
Jack Jansenc49e5b72001-06-19 15:00:23 +0000269 $(MACHDEP_OBJS) \
Martin v. Löwis2d7e2642002-04-05 16:50:53 +0000270 $(THREADOBJ)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000271
272
273##########################################################################
274# Objects
275OBJECT_OBJS= \
276 Objects/abstract.o \
Guido van Rossum77f6a652002-04-03 22:41:51 +0000277 Objects/boolobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000278 Objects/bufferobject.o \
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +0000279 Objects/cellobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000280 Objects/classobject.o \
281 Objects/cobject.o \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000282 Objects/codeobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000283 Objects/complexobject.o \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000284 Objects/descrobject.o \
Guido van Rossum7dab2422002-04-26 19:40:56 +0000285 Objects/enumobject.o \
Martin v. Löwise440e472004-06-01 15:22:42 +0000286 Objects/genobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000287 Objects/fileobject.o \
288 Objects/floatobject.o \
289 Objects/frameobject.o \
290 Objects/funcobject.o \
291 Objects/intobject.o \
Guido van Rossum59d1d2b2001-04-20 19:13:02 +0000292 Objects/iterobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000293 Objects/listobject.o \
294 Objects/longobject.o \
295 Objects/dictobject.o \
296 Objects/methodobject.o \
297 Objects/moduleobject.o \
298 Objects/object.o \
Tim Peters1221c0a2002-03-23 00:20:15 +0000299 Objects/obmalloc.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000300 Objects/rangeobject.o \
Raymond Hettingera690a992003-11-16 16:17:49 +0000301 Objects/setobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000302 Objects/sliceobject.o \
303 Objects/stringobject.o \
Guido van Rossum98bf58f2001-10-18 20:34:25 +0000304 Objects/structseq.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000305 Objects/tupleobject.o \
306 Objects/typeobject.o \
Fred Drake502ed822001-10-05 21:56:02 +0000307 Objects/weakrefobject.o \
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000308 $(UNICODE_OBJS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000309
310
311##########################################################################
312# objects that get linked into the Python library
313LIBRARY_OBJS= \
Neil Schemenauer18821822001-01-27 21:42:38 +0000314 Modules/getbuildinfo.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000315 $(PARSER_OBJS) \
316 $(OBJECT_OBJS) \
317 $(PYTHON_OBJS) \
318 $(MODULE_OBJS) \
319 $(SIGNAL_OBJS) \
320 $(MODOBJS)
321
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000322#########################################################################
323# Rules
324
325# Default target
Jack Jansen1999ef42001-12-06 21:47:20 +0000326all: $(BUILDPYTHON) oldsharedmods sharedmods
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000327
328# Build the interpreter
Martin v. Löwis1142de32002-03-29 16:28:31 +0000329$(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
Fred Drakea1a84e72001-03-06 05:52:16 +0000330 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
331 Modules/$(MAINOBJ) \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000332 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000333
Jack Jansen1999ef42001-12-06 21:47:20 +0000334platform: $(BUILDPYTHON)
Martin v. Löwis1142de32002-03-29 16:28:31 +0000335 $(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 +0000336
337
338# Build the shared modules
Jack Jansen1999ef42001-12-06 21:47:20 +0000339sharedmods: $(BUILDPYTHON)
Guido van Rossum1140cb22001-09-12 18:59:25 +0000340 case $$MAKEFLAGS in \
Martin v. Löwis1142de32002-03-29 16:28:31 +0000341 *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
342 *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
Guido van Rossum1140cb22001-09-12 18:59:25 +0000343 esac
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000344
345# Build static library
Guido van Rossum4e6a7a62001-04-09 22:23:22 +0000346# avoid long command lines, same as LIBRARY_OBJS
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000347$(LIBRARY): $(LIBRARY_OBJS)
348 -rm -f $@
Neil Schemenauer18821822001-01-27 21:42:38 +0000349 $(AR) cr $@ Modules/getbuildinfo.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000350 $(AR) cr $@ $(PARSER_OBJS)
351 $(AR) cr $@ $(OBJECT_OBJS)
352 $(AR) cr $@ $(PYTHON_OBJS)
353 $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
354 $(AR) cr $@ $(MODOBJS)
355 $(RANLIB) $@
356
Martin v. Löwis1142de32002-03-29 16:28:31 +0000357libpython$(VERSION).so: $(LIBRARY_OBJS)
Martin v. Löwisbc122622003-06-14 13:11:24 +0000358 if test $(INSTSONAME) != $(LDLIBRARY); then \
Martin v. Löwis4d9559a2004-09-26 17:26:55 +0000359 $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
Martin v. Löwis45ec95d2003-03-30 15:37:33 +0000360 $(LN) -f $(INSTSONAME) $@; \
361 else\
362 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
363 fi
Martin v. Löwis1142de32002-03-29 16:28:31 +0000364
365libpython$(VERSION).sl: $(LIBRARY_OBJS)
366 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000367
Jack Jansenea0c3822002-08-01 21:57:49 +0000368# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
369# minimal framework (not including the Lib directory and such) in the current
370# directory.
371RESSRCDIR=$(srcdir)/Mac/OSXResources/framework
372$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
373 $(LIBRARY) \
374 $(RESSRCDIR)/Info.plist \
375 $(RESSRCDIR)/version.plist \
376 $(RESSRCDIR)/English.lproj/InfoPlist.strings
Jack Jansen246debb2002-02-12 21:30:53 +0000377 $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000378 libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
Bob Ippolito7026a0a2005-03-28 23:23:47 +0000379 @LIBTOOL_CRUFT@
Jack Jansenea0c3822002-08-01 21:57:49 +0000380 $(INSTALL) -d -m $(DIRMODE) \
381 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
382 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
383 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
384 $(INSTALL_DATA) $(RESSRCDIR)/version.plist \
385 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/version.plist
386 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
387 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj/InfoPlist.strings
Jack Jansenc736b8d2002-08-04 21:17:20 +0000388 $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
Jack Jansenb36687a2004-07-16 08:43:47 +0000389 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
Jack Jansenc736b8d2002-08-04 21:17:20 +0000390 $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
391 $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000392
Jason Tishler30765592003-09-04 11:04:06 +0000393# This rule builds the Cygwin Python DLL and import library if configured
394# for a shared core library; otherwise, this rule is a noop.
395$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
396 if test -n "$(DLLLIBRARY)"; then \
397 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
398 $(LIBS) $(MODLIBS) $(SYSLIBS); \
399 else true; \
400 fi
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000401
402
403oldsharedmods: $(SHAREDMODS)
404
405
406Makefile Modules/config.c: Makefile.pre \
407 $(srcdir)/Modules/config.c.in \
408 $(MAKESETUP) \
409 Modules/Setup.config \
410 Modules/Setup \
411 Modules/Setup.local
412 $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
413 -s Modules \
414 Modules/Setup.config \
415 Modules/Setup.local \
416 Modules/Setup
417 @mv config.c Modules
418 @echo "The Makefile was updated, you may need to re-run make."
419
420
421Modules/Setup: $(srcdir)/Modules/Setup.dist
422 @if test -f Modules/Setup; then \
423 echo "-----------------------------------------------"; \
424 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
425 echo "check to make sure you have all the updates you"; \
426 echo "need in your Modules/Setup file."; \
Guido van Rossumbb29b9c2001-09-29 00:42:19 +0000427 echo "Usually, copying Setup.dist to Setup will work."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000428 echo "-----------------------------------------------"; \
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000429 fi
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000430
431############################################################################
432# Special rules for object files
433
Martin v. Löwisdea59e52006-01-05 10:00:36 +0000434Modules/getbuildinfo.o: $(PARSER_OBJS) \
435 $(OBJECT_OBJS) \
436 $(PYTHON_OBJS) \
437 $(MODULE_OBJS) \
438 $(SIGNAL_OBJS) \
439 $(MODOBJS) \
440 $(srcdir)/Modules/getbuildinfo.c
Martin v. Löwisc5bf5a02006-01-05 10:33:59 +0000441 $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LANG=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
Andrew M. Kuchling03184e22001-01-26 22:52:45 +0000442
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000443Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000444 $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
445 -DPREFIX='"$(prefix)"' \
446 -DEXEC_PREFIX='"$(exec_prefix)"' \
447 -DVERSION='"$(VERSION)"' \
448 -DVPATH='"$(VPATH)"' \
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000449 -o $@ $(srcdir)/Modules/getpath.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000450
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000451Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc
452 $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000453
454
455$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
Neil Schemenauer7cd124c2001-02-27 02:19:16 +0000456 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000457
458$(PGEN): $(PGENOBJS)
Martin v. Löwis6702d8a2003-07-13 10:10:42 +0000459 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000460
461Parser/grammar.o: $(srcdir)/Parser/grammar.c \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000462 $(srcdir)/Include/token.h \
463 $(srcdir)/Include/grammar.h
464Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
465
Martin v. Löwis00f1e3f2002-08-04 17:29:52 +0000466Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c
467
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000468$(AST_H) $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
469 $(ASDLGEN) $(AST_ASDL)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000470
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000471Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
Neil Schemenauer40417742001-02-27 02:45:36 +0000472
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000473Python/getplatform.o: $(srcdir)/Python/getplatform.c
Mark Hammond8235ea12002-07-19 06:55:41 +0000474 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000475
476Python/importdl.o: $(srcdir)/Python/importdl.c
Mark Hammond8235ea12002-07-19 06:55:41 +0000477 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000478
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000479Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
480 $(srcdir)/Objects/unicodetype_db.h
481
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000482############################################################################
483# Header files
484
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000485PYTHON_HEADERS= \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000486 Include/Python.h \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000487 Include/Python-ast.h \
488 Include/asdl.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000489 Include/abstract.h \
Guido van Rossum77f6a652002-04-03 22:41:51 +0000490 Include/boolobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000491 Include/bufferobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000492 Include/ceval.h \
493 Include/classobject.h \
494 Include/cobject.h \
Jeremy Hylton3e0055f2005-10-20 19:59:25 +0000495 Include/code.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000496 Include/codecs.h \
497 Include/compile.h \
498 Include/complexobject.h \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000499 Include/descrobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000500 Include/dictobject.h \
Guido van Rossum7dab2422002-04-26 19:40:56 +0000501 Include/enumobject.h \
Martin v. Löwise440e472004-06-01 15:22:42 +0000502 Include/genobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000503 Include/fileobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000504 Include/floatobject.h \
505 Include/funcobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000506 Include/import.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000507 Include/intobject.h \
508 Include/intrcheck.h \
509 Include/iterobject.h \
510 Include/listobject.h \
511 Include/longobject.h \
512 Include/methodobject.h \
513 Include/modsupport.h \
514 Include/moduleobject.h \
515 Include/object.h \
516 Include/objimpl.h \
517 Include/patchlevel.h \
Neal Norwitzadb69fc2005-12-17 20:54:49 +0000518 Include/pyarena.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000519 Include/pydebug.h \
520 Include/pyerrors.h \
521 Include/pyfpe.h \
522 Include/pymem.h \
523 Include/pyport.h \
524 Include/pystate.h \
525 Include/pythonrun.h \
526 Include/rangeobject.h \
Raymond Hettingera690a992003-11-16 16:17:49 +0000527 Include/setobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000528 Include/sliceobject.h \
529 Include/stringobject.h \
Guido van Rossum98bf58f2001-10-18 20:34:25 +0000530 Include/structseq.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000531 Include/structmember.h \
532 Include/symtable.h \
533 Include/sysmodule.h \
534 Include/traceback.h \
535 Include/tupleobject.h \
536 Include/unicodeobject.h \
Fred Drake502ed822001-10-05 21:56:02 +0000537 Include/weakrefobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000538 pyconfig.h
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000539
Fred Drakea1a84e72001-03-06 05:52:16 +0000540$(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS)
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000541
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000542
543######################################################################
544
545# Test the interpreter (twice, once without .pyc files, once with)
Skip Montanaroc9803ab2003-05-06 16:17:27 +0000546# In the past, we've had problems where bugs in the marshalling or
547# elsewhere caused bytecode read from .pyc files to behave differently
548# than bytecode generated directly from a .py source file. Sometimes
549# the bytecode read from a .pyc file had the bug, somtimes the directly
550# generated bytecode. This is sometimes a very shy bug needing a lot of
551# sample data.
552
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000553TESTOPTS= -l
554TESTPROG= $(srcdir)/Lib/test/regrtest.py
Martin v. Löwis1142de32002-03-29 16:28:31 +0000555TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000556test: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000557 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000558 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
559 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000560
Skip Montanaro446ad712003-05-06 15:30:20 +0000561testall: all platform
562 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
563 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
564 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
565
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000566QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \
Fred Drake042f3132001-02-02 03:03:33 +0000567 test_unicodedata test_re test_sre test_select test_poll \
Guido van Rossumed2f7252002-08-09 19:18:25 +0000568 test_linuxaudiodev test_struct test_sunaudiodev test_zlib
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000569quicktest: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000570 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000571 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
572 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000573
Barry Warsaw42119252001-03-03 04:14:21 +0000574MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
575 test_longexp
576memtest: all platform
577 -rm -f $(srcdir)/Lib/test/*.py[co]
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000578 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
579 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
Barry Warsaw42119252001-03-03 04:14:21 +0000580
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000581# Install everything
Guido van Rossumb1ab4d92003-06-13 20:35:41 +0000582install: altinstall bininstall maninstall
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000583
584# Install almost everything without disturbing previous versions
Andrew M. Kuchlingbddd8782001-01-29 20:18:59 +0000585altinstall: altbininstall libinstall inclinstall libainstall \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000586 sharedinstall oldsharedinstall
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000587
588# Install shared libraries enabled by Setup
589DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
590
591oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
592 @for i in X $(SHAREDMODS); do \
Neil Schemenauerac959772001-02-06 14:50:27 +0000593 if test $$i != X; then \
594 echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000595 $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
Neil Schemenauerac959772001-02-06 14:50:27 +0000596 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000597 done
598
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000599$(DESTSHARED):
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000600 @for i in $(DESTDIRS); \
601 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000602 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000603 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000604 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000605 else true; \
606 fi; \
607 done
608
609
610# Install the interpreter (by creating a hard link to python$(VERSION))
611bininstall: altbininstall
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000612 -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
613 then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000614 else true; \
615 fi
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000616 (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000617
618# Install the interpreter with $(VERSION) affixed
619# This goes into $(exec_prefix)
Jack Jansen1999ef42001-12-06 21:47:20 +0000620altbininstall: $(BUILDPYTHON)
Jack Jansen3a451b12002-08-06 13:40:31 +0000621 @if test "$(PYTHONFRAMEWORKDIR)" != no-framework; then \
Jack Jansen9592fe92003-05-25 22:01:32 +0000622 if test ! -f $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current/Resources/Info.plist; then \
Jack Jansen3a451b12002-08-06 13:40:31 +0000623 echo 'Framework build: use "make frameworkinstall" in stead of "make install"'; \
624 exit 1; \
625 fi; \
626 fi
Martin v. Löwisd8a20d22002-05-08 08:59:59 +0000627 @for i in $(BINDIR) $(LIBDIR); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000628 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000629 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000630 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000631 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000632 else true; \
633 fi; \
634 done
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000635 $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
Martin v. Löwis1142de32002-03-29 16:28:31 +0000636 if test -f libpython$(VERSION)$(SO); then \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000637 if test "$(SO)" = .dll; then \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000638 $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000639 else \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000640 $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
Martin v. Löwise3be8602003-11-18 19:54:20 +0000641 if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
642 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
643 fi \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000644 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000645 else true; \
646 fi
647
648# Install the manual page
649maninstall:
650 @for i in $(MANDIR) $(MANDIR)/man1; \
651 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000652 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000653 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000654 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000655 else true; \
656 fi; \
657 done
658 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000659 $(DESTDIR)$(MANDIR)/man1/python.1
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000660
661# Install the library
662PLATDIR= plat-$(MACHDEP)
Jack Jansen83f898c2002-12-30 22:23:40 +0000663EXTRAPLATDIR= @EXTRAPLATDIR@
Jack Jansen7b59b422003-03-17 15:44:10 +0000664EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@
Jack Jansen83f898c2002-12-30 22:23:40 +0000665MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
Fredrik Lundhd3968332005-12-14 17:36:36 +0000666XMLLIBSUBDIRS= xmlcore xmlcore/dom xmlcore/etree xmlcore/parsers xmlcore/sax
Jack Jansen83f898c2002-12-30 22:23:40 +0000667PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
Jack Jansend68d9292003-01-21 15:05:02 +0000668 plat-mac/lib-scriptpackages/_builtinSuites \
Jack Jansen83f898c2002-12-30 22:23:40 +0000669 plat-mac/lib-scriptpackages/CodeWarrior \
670 plat-mac/lib-scriptpackages/Explorer \
671 plat-mac/lib-scriptpackages/Finder \
672 plat-mac/lib-scriptpackages/Netscape \
673 plat-mac/lib-scriptpackages/StdSuites \
Jack Jansen1fff6972003-03-31 09:39:54 +0000674 plat-mac/lib-scriptpackages/SystemEvents \
Jack Jansen83f898c2002-12-30 22:23:40 +0000675 plat-mac/lib-scriptpackages/Terminal
Jack Jansen7b59b422003-03-17 15:44:10 +0000676PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
Barry Warsawf4c20d32001-12-03 18:51:41 +0000677LIBSUBDIRS= lib-old lib-tk site-packages test test/output test/data \
Anthony Baxter1e2bd5b2004-07-12 09:25:18 +0000678 test/decimaltestdata \
Barry Warsaw2c71ad32003-01-20 01:13:21 +0000679 encodings email email/test email/test/data compiler hotshot \
Guido van Rossumd321efd2003-06-13 20:49:55 +0000680 logging bsddb bsddb/test csv idlelib idlelib/Icons \
Fred Drakee612c8e2005-01-19 06:24:58 +0000681 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
682 curses $(MACHDEPS)
Jack Jansen1999ef42001-12-06 21:47:20 +0000683libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000684 @for i in $(SCRIPTDIR) $(LIBDEST); \
685 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000686 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000687 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000688 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000689 else true; \
690 fi; \
691 done
692 @for d in $(LIBSUBDIRS); \
693 do \
694 a=$(srcdir)/Lib/$$d; \
695 if test ! -d $$a; then continue; else true; fi; \
696 b=$(LIBDEST)/$$d; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000697 if test ! -d $(DESTDIR)$$b; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000698 echo "Creating directory $$b"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000699 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000700 else true; \
701 fi; \
702 done
703 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
704 do \
705 if test -x $$i; then \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000706 $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000707 echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000708 else \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000709 $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000710 echo $(INSTALL_DATA) $$i $(LIBDEST); \
711 fi; \
712 done
713 @for d in $(LIBSUBDIRS); \
714 do \
715 a=$(srcdir)/Lib/$$d; \
716 if test ! -d $$a; then continue; else true; fi; \
717 b=$(LIBDEST)/$$d; \
718 for i in $$a/*; \
719 do \
720 case $$i in \
721 *CVS) ;; \
722 *.py[co]) ;; \
723 *.orig) ;; \
724 *~) ;; \
725 *) \
726 if test -d $$i; then continue; fi; \
727 if test -x $$i; then \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000728 echo $(INSTALL_SCRIPT) $$i $$b; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000729 $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000730 else \
731 echo $(INSTALL_DATA) $$i $$b; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000732 $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000733 fi;; \
734 esac; \
735 done; \
736 done
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000737 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
738 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
739 ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000740 -d $(LIBDEST) -f \
Neal Norwitz892a33f2005-10-04 04:32:42 +0000741 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000742 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
743 ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000744 -d $(LIBDEST) -f \
Neal Norwitz892a33f2005-10-04 04:32:42 +0000745 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
Hye-Shik Chang0e5e6c72004-03-18 07:51:27 +0000746 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000747 ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000748 -d $(LIBDEST)/site-packages -f \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000749 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
Hye-Shik Chang0e5e6c72004-03-18 07:51:27 +0000750 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000751 ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
Martin v. Löwis975302d2003-06-21 13:26:28 +0000752 -d $(LIBDEST)/site-packages -f \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000753 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000754
755# Create the PLATDIR source directory, if one wasn't distributed..
756$(srcdir)/Lib/$(PLATDIR):
757 mkdir $(srcdir)/Lib/$(PLATDIR)
758 cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
759 export PATH; PATH="`pwd`:$$PATH"; \
760 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000761 export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
Jack Jansen0d153662001-12-19 09:24:40 +0000762 export EXE; EXE="$(BUILDEXE)"; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000763 cd $(srcdir)/Lib/$(PLATDIR); ./regen
764
765# Install the include files
766INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
767inclinstall:
768 @for i in $(INCLDIRSTOMAKE); \
769 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000770 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000771 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000772 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000773 else true; \
774 fi; \
775 done
776 @for i in $(srcdir)/Include/*.h; \
777 do \
778 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000779 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000780 done
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000781 $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000782
783# Install the library and miscellaneous stuff needed for extending/embedding
784# This goes into $(exec_prefix)
785LIBPL= $(LIBP)/config
786libainstall: all
787 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
788 do \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000789 if test ! -d $(DESTDIR)$$i; then \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000790 echo "Creating directory $$i"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000791 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000792 else true; \
793 fi; \
794 done
Martin v. Löwis1142de32002-03-29 16:28:31 +0000795 @if test -d $(LIBRARY); then :; else \
Jack Jansen127e56e2001-09-11 14:41:54 +0000796 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000797 if test "$(SO)" = .dll; then \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000798 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000799 else \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000800 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
801 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
Jason Tishlerc0f1e772002-07-29 16:18:23 +0000802 fi; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000803 else \
Martin v. Löwis1142de32002-03-29 16:28:31 +0000804 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000805 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000806 fi
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000807 $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
808 $(INSTALL_DATA) Modules/$(MAINOBJ) $(DESTDIR)$(LIBPL)/$(MAINOBJ)
809 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
810 $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
811 $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
812 $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
813 $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
814 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
815 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000816 @if [ -s Modules/python.exp -a \
817 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
818 echo; echo "Installing support files for building shared extension modules on AIX:"; \
819 $(INSTALL_DATA) Modules/python.exp \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000820 $(DESTDIR)$(LIBPL)/python.exp; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000821 echo; echo "$(LIBPL)/python.exp"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000822 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000823 $(DESTDIR)$(LIBPL)/makexp_aix; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000824 echo "$(LIBPL)/makexp_aix"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000825 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000826 $(DESTDIR)$(LIBPL)/ld_so_aix; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000827 echo "$(LIBPL)/ld_so_aix"; \
828 echo; echo "See Misc/AIX-NOTES for details."; \
829 else true; \
830 fi
831 @case "$(MACHDEP)" in beos*) \
832 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000833 $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000834 echo; echo "$(LIBPL)/README"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000835 $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000836 echo "$(LIBPL)/ar_beos"; \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000837 $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000838 echo "$(LIBPL)/ld_so_beos"; \
839 echo; echo "See Misc/BeOS-NOTES for details."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000840 ;; \
841 esac
842
843# Install the dynamically loadable modules
844# This goes into $(exec_prefix)
845sharedinstall:
Martin v. Löwis1142de32002-03-29 16:28:31 +0000846 $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
847 --prefix=$(prefix) \
Guido van Rossumb33e7892001-10-17 06:26:53 +0000848 --install-scripts=$(BINDIR) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000849 --install-platlib=$(DESTSHARED) \
850 --root=/$(DESTDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000851
Jack Jansencb4321e2002-08-09 00:18:21 +0000852# Here are a couple of targets for MacOSX again, to install a full
853# framework-based Python. frameworkinstall installs everything, the
854# subtargets install specific parts. Much of the actual work is offloaded to
855# the Makefile in Mac/OSX
856#
857frameworkinstall: frameworkinstallframework \
858 frameworkinstallapps frameworkinstallunixtools
Guido van Rossumed2f7252002-08-09 19:18:25 +0000859
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000860# On install, we re-make the framework
861# structure in the install location, /Library/Frameworks/ or the argument to
862# --enable-framework. If --enable-framework has been specified then we have
863# automatically set prefix to the location deep down in the framework, so we
864# only have to cater for the structural bits of the framework.
865
Jack Jansencb4321e2002-08-09 00:18:21 +0000866frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
867
868frameworkinstallstructure: $(LDLIBRARY)
Jack Jansen127e56e2001-09-11 14:41:54 +0000869 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000870 echo Not configured with --enable-framework; \
Jack Jansen127e56e2001-09-11 14:41:54 +0000871 exit 1; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000872 else true; \
873 fi
Jack Jansencb4321e2002-08-09 00:18:21 +0000874 @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000875 if test ! -d $(DESTDIR)$$i; then \
Jack Jansen9592fe92003-05-25 22:01:32 +0000876 echo "Creating directory $(DESTDIR)$$i"; \
877 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000878 else true; \
879 fi; \
880 done
Jack Jansen9592fe92003-05-25 22:01:32 +0000881 $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
882 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist
883 $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000884 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
Jack Jansen9592fe92003-05-25 22:01:32 +0000885 $(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings
886 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
887 $(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python
888 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
889 $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
Jack Jansen4735b232003-06-20 20:36:53 +0000890 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000891
Jack Jansencb4321e2002-08-09 00:18:21 +0000892# This installs Mac/Lib into the framework
893frameworkinstallmaclib:
894 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installmacsubtree \
Jack Jansen66b84832003-07-04 12:14:39 +0000895 $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
Jack Jansen9592fe92003-05-25 22:01:32 +0000896 srcdir=$(srcdir) builddir=. prefix=$(prefix) LIBDEST=$(LIBDEST) \
897 DESTDIR=$(DESTDIR)
Jack Jansencb4321e2002-08-09 00:18:21 +0000898
899# This installs the IDE, the Launcher and other apps into /Applications
900frameworkinstallapps:
901 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installapps \
Jack Jansen66b84832003-07-04 12:14:39 +0000902 $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
Jack Jansen48e02e42003-12-07 21:52:07 +0000903 srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix)
Jack Jansencb4321e2002-08-09 00:18:21 +0000904
905# This install the unix python and pythonw tools in /usr/local/bin
906frameworkinstallunixtools:
907 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installunixtools \
Jack Jansena226b572003-05-09 15:08:39 +0000908 DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
Jack Jansen48e02e42003-12-07 21:52:07 +0000909 srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix)
Jack Jansen0b06be72002-06-21 14:48:38 +0000910
Jack Jansena1b77582003-06-19 22:35:20 +0000911# This installs the Demos and Tools into the applications directory.
912# It is not part of a normal frameworkinstall
913frameworkinstallextras:
914 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installextras \
Jack Jansen66b84832003-07-04 12:14:39 +0000915 $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
Jack Jansena1b77582003-06-19 22:35:20 +0000916 srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR)
917
Skip Montanarodecc6a42003-01-01 20:07:49 +0000918# This installs a few of the useful scripts in Tools/scripts
919scriptsinstall:
Martin v. Löwis01f43112003-01-03 20:39:29 +0000920 SRCDIR=$(srcdir) $(RUNSHARED) \
Skip Montanarodecc6a42003-01-01 20:07:49 +0000921 ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
922 --prefix=$(prefix) \
Martin v. Löwis3b8ee082003-05-11 20:25:35 +0000923 --install-scripts=$(BINDIR) \
924 --root=/$(DESTDIR)
Skip Montanarodecc6a42003-01-01 20:07:49 +0000925
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000926# Build the toplevel Makefile
927Makefile.pre: Makefile.pre.in config.status
928 CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
929 $(MAKE) -f Makefile.pre Makefile
930
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000931# Run the configure script.
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000932config.status: $(srcdir)/configure
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000933 $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000934
Jack Jansen1999ef42001-12-06 21:47:20 +0000935.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000936
937# Some make's put the object file in the current directory
938.c.o:
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000939 $(CC) -c $(PY_CFLAGS) -o $@ $<
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000940
941# Rerun configure with the same options as it was run last time,
942# provided the config.status script exists
943recheck:
944 $(SHELL) config.status --recheck
945 $(SHELL) config.status
946
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000947# Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000948autoconf:
949 (cd $(srcdir); autoconf)
950 (cd $(srcdir); autoheader)
951
952# Create a tags file for vi
953tags::
954 cd $(srcdir); \
955 ctags -w -t Include/*.h; \
956 for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
957 done; \
Guido van Rossumc9489662002-02-28 19:26:08 +0000958 sort -o tags tags
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000959
960# Create a tags file for GNU Emacs
961TAGS::
962 cd $(srcdir); \
963 etags Include/*.h; \
964 for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
965
966# Sanitation targets -- clean leaves libraries, executables and tags
967# files, which clobber removes those as well
968
969clean:
Neil Schemenauerc5cfcb42001-02-19 04:35:11 +0000970 find . -name '*.o' -exec rm -f {} ';'
Guido van Rossumcd0ed972001-04-14 17:57:07 +0000971 find . -name '*.s[ol]' -exec rm -f {} ';'
Neil Schemenauere0d43572001-02-03 17:16:29 +0000972 find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000973
974clobber: clean
Jack Jansen1999ef42001-12-06 21:47:20 +0000975 -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
Guido van Rossumcd0ed972001-04-14 17:57:07 +0000976 tags TAGS \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000977 config.cache config.log pyconfig.h Modules/config.c
Guido van Rossum1d88c592001-06-06 17:51:57 +0000978 -rm -rf build platform
Jack Jansenc6096892003-02-27 23:19:46 +0000979 -rm -rf $(PYTHONFRAMEWORKDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000980
981# Make things extra clean, before making a distribution:
982# remove all generated files, even Makefile[.pre]
Neal Norwitz1a196b52006-01-03 01:38:53 +0000983# Keep configure and Python-ast.[ch], it's possible they can't be generated
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000984distclean: clobber
Martin v. Löwisdea59e52006-01-05 10:00:36 +0000985 -rm -f core Makefile Makefile.pre config.status \
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000986 Modules/Setup Modules/Setup.local Modules/Setup.config
Neil Schemenauere0d43572001-02-03 17:16:29 +0000987 find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
988 -o -name '[@,#]*' -o -name '*.old' \
989 -o -name '*.orig' -o -name '*.rej' \
990 -o -name '*.bak' ')' \
991 -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000992
993# Check for smelly exported symbols (not starting with Py/_Py)
994smelly: all
995 nm -p $(LIBRARY) | \
996 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
997
998# Find files with funny names
999funny:
1000 find $(DISTDIRS) -type d \
1001 -o -name '*.[chs]' \
1002 -o -name '*.py' \
1003 -o -name '*.doc' \
1004 -o -name '*.sty' \
1005 -o -name '*.bib' \
1006 -o -name '*.dat' \
1007 -o -name '*.el' \
1008 -o -name '*.fd' \
1009 -o -name '*.in' \
1010 -o -name '*.tex' \
1011 -o -name '*,[vpt]' \
1012 -o -name 'Setup' \
1013 -o -name 'Setup.*' \
1014 -o -name README \
1015 -o -name Makefile \
1016 -o -name ChangeLog \
1017 -o -name Repository \
1018 -o -name Root \
1019 -o -name Entries \
1020 -o -name Tag \
1021 -o -name tags \
1022 -o -name TAGS \
1023 -o -name .cvsignore \
1024 -o -name MANIFEST \
1025 -o -print
1026
Guido van Rossum9454ad72001-08-18 21:08:22 +00001027# Dependencies
1028
Martin v. Löwis06f15bb2001-12-02 13:02:32 +00001029Python/thread.o: @THREADHEADERS@
Guido van Rossum9454ad72001-08-18 21:08:22 +00001030
Guido van Rossumd4f7da32002-10-10 15:04:04 +00001031# Declare targets that aren't real files
1032.PHONY: all sharedmods oldsharedmods test quicktest memtest
1033.PHONY: install altinstall oldsharedinstall bininstall altbininstall
1034.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1035.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1036.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1037.PHONY: recheck autoconf clean clobber distclean smelly funny
1038
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001039# IF YOU PUT ANYTHING HERE IT WILL GO AWAY