blob: c8e96bd99a4f6f8c40c857c16c92c9eefc95f7c9 [file] [log] [blame]
Neil Schemenauer85515ad2001-01-24 17:11:43 +00001# Top-level Makefile for Python
Guido van Rossum7cb32ae2001-08-17 15:32:31 +00002#
Neil Schemenauer85515ad2001-01-24 17:11:43 +00003# As distributed, this file is called Makefile.pre.in; it is processed
4# into the real Makefile by running the script ./configure, which
5# replaces things like @spam@ with values appropriate for your system.
6# This means that if you edit Makefile, your changes get lost the next
7# time you run the configure script. Ideally, you can do:
Guido van Rossum7cb32ae2001-08-17 15:32:31 +00008#
Neil Schemenauer85515ad2001-01-24 17:11:43 +00009# ./configure
10# make
11# make test
12# make install
Guido van Rossum7cb32ae2001-08-17 15:32:31 +000013#
Neil Schemenauer85515ad2001-01-24 17:11:43 +000014# If you have a previous version of Python installed that you don't
15# want to overwrite, you can use "make altinstall" instead of "make
Neil Schemenauer2b2681a2001-02-16 04:16:34 +000016# install". Refer to the "Installing" section in the README file for
17# additional details.
Guido van Rossum7cb32ae2001-08-17 15:32:31 +000018#
Neil Schemenauer85515ad2001-01-24 17:11:43 +000019# See also the section "Build instructions" in the README file.
20
21# === Variables set by makesetup ===
22
23MODOBJS= _MODOBJS_
24MODLIBS= _MODLIBS_
25
26# === Variables set by configure
27VERSION= @VERSION@
28srcdir= @srcdir@
29VPATH= @srcdir@
30
31CC= @CC@
32CXX= @CXX@
33LINKCC= @LINKCC@
34AR= @AR@
35RANLIB= @RANLIB@
36
37# Shell used by make (some versions default to the login shell, which is bad)
38SHELL= /bin/sh
39
40# Use this to make a link between python$(VERSION) and python in $(BINDIR)
41LN= @LN@
42
43# Portable install script (configure doesn't always guess right)
44INSTALL= @INSTALL@
45INSTALL_PROGRAM=@INSTALL_PROGRAM@
Neil Schemenauer3f5cc202001-04-10 23:03:35 +000046INSTALL_SCRIPT= @INSTALL_SCRIPT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000047INSTALL_DATA= @INSTALL_DATA@
48# Shared libraries must be installed with executable mode on some systems;
49# rather than figuring out exactly which, we always give them executable mode.
50# Also, making them read-only seems to be a good idea...
51INSTALL_SHARED= ${INSTALL} -m 555
52
53MAKESETUP= $(srcdir)/Modules/makesetup
54
55# Compiler options
56OPT= @OPT@
57DEFS= @DEFS@
Neil Schemenauer89e90d62001-06-02 06:16:02 +000058CFLAGS= $(OPT)
59CPPFLAGS= -I. -I$(srcdir)/Include $(DEFS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +000060LDFLAGS= @LDFLAGS@
61LDLAST= @LDLAST@
62SGI_ABI= @SGI_ABI@
Neil Schemenauer7ac954b2001-01-26 16:14:41 +000063CCSHARED= @CCSHARED@
64LINKFORSHARED= @LINKFORSHARED@
65# Extra C flags added for building the interpreter object files.
66CFLAGSFORSHARED=@CFLAGSFORSHARED@
67# C flags used for building the interpreter object files
Neil Schemenauer89e90d62001-06-02 06:16:02 +000068PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED)
Neil Schemenauer7ac954b2001-01-26 16:14:41 +000069
Neil Schemenauer85515ad2001-01-24 17:11:43 +000070
71# Machine-dependent subdirectories
72MACHDEP= @MACHDEP@
73
74# Install prefix for architecture-independent files
75prefix= @prefix@
76
77# Install prefix for architecture-dependent files
78exec_prefix= @exec_prefix@
79
80# Expanded directories
81BINDIR= $(exec_prefix)/bin
82LIBDIR= $(exec_prefix)/lib
Martin v. Löwisd429ab62001-08-02 06:20:20 +000083MANDIR= @mandir@
84INCLUDEDIR= @includedir@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000085CONFINCLUDEDIR= $(exec_prefix)/include
86SCRIPTDIR= $(prefix)/lib
87
88# Detailed destination directories
89BINLIBDEST= $(LIBDIR)/python$(VERSION)
90LIBDEST= $(SCRIPTDIR)/python$(VERSION)
91INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
92CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
93LIBP= $(LIBDIR)/python$(VERSION)
94
95# Symbols used for using shared libraries
96SO= @SO@
97LDSHARED= @LDSHARED@
Neil Schemenauer75e33892001-02-16 03:36:53 +000098BLDSHARED= @BLDSHARED@
Neil Schemenauer85515ad2001-01-24 17:11:43 +000099DESTSHARED= $(BINLIBDEST)/lib-dynload
100
101# Executable suffix (.exe on Windows and Mac OS X)
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000102EXE= @EXEEXT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000103
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000104# Short name and location for Mac OS X Python framework
105PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
106PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
107PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
108PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
109
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000110# Modes for directories, executables and data files created by the
111# install process. Default to user-only-writable for all file types.
112DIRMODE= 755
113EXEMODE= 755
114FILEMODE= 644
115
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000116# configure script arguments
117CONFIG_ARGS= @CONFIG_ARGS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000118
119
120# Subdirectories with code
121SRCDIRS= @SRCDIRS@
122
123# Other subdirectories
124SUBDIRSTOO= Include Lib Misc Demo
125
126# Files and directories to be distributed
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000127CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000128DISTFILES= README ChangeLog $(CONFIGFILES)
129DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
130DIST= $(DISTFILES) $(DISTDIRS)
131
132
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000133LIBRARY= @LIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000134LDLIBRARY= @LDLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000135BLDLIBRARY= @BLDLIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000136DLLLIBRARY= @DLLLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000137LDLIBRARYDIR= @LDLIBRARYDIR@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000138
139
140LIBS= @LIBS@
141LIBM= @LIBM@
142LIBC= @LIBC@
143SYSLIBS= $(LIBM) $(LIBC)
144
145MAINOBJ= @MAINOBJ@
146LIBOBJS= @LIBOBJS@
147DLINCLDIR= @DLINCLDIR@
148DYNLOADFILE= @DYNLOADFILE@
Jack Jansenc49e5b72001-06-19 15:00:23 +0000149MACHDEP_OBJS= @MACHDEP_OBJS@
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000150UNICODE_OBJS= @UNICODE_OBJS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000151
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000152PYTHON= python$(EXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000153
154# === Definitions added by makesetup ===
155
156
157##########################################################################
158# Modules
159MODULE_OBJS= \
160 Modules/config.o \
161 Modules/getpath.o \
Neil Schemenauer9c63e6d2001-08-29 23:44:38 +0000162 Modules/main.o \
163 Modules/gcmodule.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000164
165# Used of signalmodule.o is not available
166SIGNAL_OBJS= @SIGNAL_OBJS@
167
168
169##########################################################################
170# Grammar
Neil Schemenauer7cd124c2001-02-27 02:19:16 +0000171GRAMMAR_H= $(srcdir)/Include/graminit.h
172GRAMMAR_C= $(srcdir)/Python/graminit.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000173GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
174
175
176##########################################################################
177# Parser
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000178PGEN= Parser/pgen$(EXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000179
180POBJS= \
181 Parser/acceler.o \
182 Parser/grammar1.o \
183 Parser/listnode.o \
184 Parser/node.o \
185 Parser/parser.o \
186 Parser/parsetok.o \
187 Parser/tokenizer.o \
188 Parser/bitset.o \
189 Parser/metagrammar.o
190
191PARSER_OBJS= $(POBJS) Parser/myreadline.o
192
193PGOBJS= \
194 Parser/firstsets.o \
195 Parser/grammar.o \
196 Parser/pgen.o \
197 Parser/printgrammar.o \
198 Parser/pgenmain.o
199
200PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
201
202
203##########################################################################
204# Python
205PYTHON_OBJS= \
206 Python/bltinmodule.o \
207 Python/exceptions.o \
208 Python/ceval.o \
209 Python/compile.o \
210 Python/codecs.o \
211 Python/errors.o \
212 Python/frozen.o \
213 Python/frozenmain.o \
Jeremy Hylton4db62b12001-02-27 19:07:02 +0000214 Python/future.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000215 Python/getargs.o \
216 Python/getcompiler.o \
217 Python/getcopyright.o \
218 Python/getmtime.o \
219 Python/getplatform.o \
220 Python/getversion.o \
221 Python/graminit.o \
222 Python/import.o \
223 Python/importdl.o \
224 Python/marshal.o \
225 Python/modsupport.o \
226 Python/mystrtoul.o \
Marc-André Lemburge5006eb2001-07-31 13:24:44 +0000227 Python/mysnprintf.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000228 Python/pyfpe.o \
229 Python/pystate.o \
230 Python/pythonrun.o \
231 Python/structmember.o \
Jeremy Hyltoncb17ae82001-02-09 22:22:18 +0000232 Python/symtable.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000233 Python/sysmodule.o \
234 Python/traceback.o \
235 Python/getopt.o \
236 Python/$(DYNLOADFILE) \
Jack Jansenc49e5b72001-06-19 15:00:23 +0000237 $(MACHDEP_OBJS) \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000238 $(LIBOBJS)
239
240
241##########################################################################
242# Objects
243OBJECT_OBJS= \
244 Objects/abstract.o \
245 Objects/bufferobject.o \
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +0000246 Objects/cellobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000247 Objects/classobject.o \
248 Objects/cobject.o \
249 Objects/complexobject.o \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000250 Objects/descrobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000251 Objects/fileobject.o \
252 Objects/floatobject.o \
253 Objects/frameobject.o \
254 Objects/funcobject.o \
255 Objects/intobject.o \
Guido van Rossum59d1d2b2001-04-20 19:13:02 +0000256 Objects/iterobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000257 Objects/listobject.o \
258 Objects/longobject.o \
259 Objects/dictobject.o \
260 Objects/methodobject.o \
261 Objects/moduleobject.o \
262 Objects/object.o \
263 Objects/rangeobject.o \
264 Objects/sliceobject.o \
265 Objects/stringobject.o \
Guido van Rossum98bf58f2001-10-18 20:34:25 +0000266 Objects/structseq.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000267 Objects/tupleobject.o \
268 Objects/typeobject.o \
Fred Drake502ed822001-10-05 21:56:02 +0000269 Objects/weakrefobject.o \
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000270 $(UNICODE_OBJS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000271
272
273##########################################################################
274# objects that get linked into the Python library
275LIBRARY_OBJS= \
Neil Schemenauer18821822001-01-27 21:42:38 +0000276 Modules/getbuildinfo.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000277 $(PARSER_OBJS) \
278 $(OBJECT_OBJS) \
279 $(PYTHON_OBJS) \
280 $(MODULE_OBJS) \
281 $(SIGNAL_OBJS) \
282 $(MODOBJS)
283
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000284#########################################################################
285# Rules
286
287# Default target
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000288all: $(PYTHON) oldsharedmods sharedmods
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000289
290# Build the interpreter
Fred Drakea1a84e72001-03-06 05:52:16 +0000291$(PYTHON): Modules/$(MAINOBJ) $(LDLIBRARY)
292 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
293 Modules/$(MAINOBJ) \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000294 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000295
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000296platform: $(PYTHON)
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000297 ./$(PYTHON) -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 +0000298
299
300# Build the shared modules
301sharedmods: $(PYTHON)
Guido van Rossum1140cb22001-09-12 18:59:25 +0000302 case $$MAKEFLAGS in \
Guido van Rossum67b26592001-10-20 14:21:45 +0000303 *-s*) CC='$(CC)' LDSHARED='$(LDSHARED)' OPT='$(OPT)' ./$(PYTHON) -E $(srcdir)/setup.py -q build;; \
304 *) CC='$(CC)' LDSHARED='$(LDSHARED)' OPT='$(OPT)' ./$(PYTHON) -E $(srcdir)/setup.py build;; \
Guido van Rossum1140cb22001-09-12 18:59:25 +0000305 esac
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000306
Neil Schemenauer18821822001-01-27 21:42:38 +0000307# buildno should really depend on something like LIBRARY_SRC
308buildno: $(PARSER_OBJS) \
309 $(OBJECT_OBJS) \
310 $(PYTHON_OBJS) \
311 $(MODULE_OBJS) \
312 $(SIGNAL_OBJS) \
313 $(MODOBJS) \
314 $(srcdir)/Modules/getbuildinfo.c
315 if test -f buildno; then \
316 expr `cat buildno` + 1 >buildno1; \
317 mv -f buildno1 buildno; \
318 else echo 1 >buildno; fi
319
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000320# Build static library
Guido van Rossum4e6a7a62001-04-09 22:23:22 +0000321# avoid long command lines, same as LIBRARY_OBJS
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000322$(LIBRARY): $(LIBRARY_OBJS)
323 -rm -f $@
Neil Schemenauer18821822001-01-27 21:42:38 +0000324 $(AR) cr $@ Modules/getbuildinfo.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000325 $(AR) cr $@ $(PARSER_OBJS)
326 $(AR) cr $@ $(OBJECT_OBJS)
327 $(AR) cr $@ $(PYTHON_OBJS)
328 $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
329 $(AR) cr $@ $(MODOBJS)
330 $(RANLIB) $@
331
Martin v. Löwis130fb172001-07-19 11:00:41 +0000332# This rule is only here for DG/UX and BeOS!!!
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000333libpython$(VERSION).so: $(LIBRARY)
334 case `uname -s | tr -d '/ ' | tr '[A-Z]' '[a-z]'` in \
335 *dgux*) \
336 test -d dgux || mkdir dgux; \
337 (cd dgux;ar x ../$^;ld -G -o ../$@ * ); \
338 /bin/rm -rf ./dgux \
339 ;; \
340 beos) \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000341 $(AR) so $(LIBRARY) $@ \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000342 ;; \
343 esac
344
345# This rule is here for OPENSTEP/Rhapsody/MacOSX
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000346$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): $(LIBRARY) $(PYTHONFRAMEWORKDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000347 libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000348 -framework System @LIBTOOL_CRUFT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000349
350# This rule builds the Cygwin Python DLL
351libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
352 dlltool --export-all --output-def $@ $^
353 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
354 $(LIBS) $(MODLIBS) $(SYSLIBS)
355
356
357oldsharedmods: $(SHAREDMODS)
358
359
360Makefile Modules/config.c: Makefile.pre \
361 $(srcdir)/Modules/config.c.in \
362 $(MAKESETUP) \
363 Modules/Setup.config \
364 Modules/Setup \
365 Modules/Setup.local
366 $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
367 -s Modules \
368 Modules/Setup.config \
369 Modules/Setup.local \
370 Modules/Setup
371 @mv config.c Modules
372 @echo "The Makefile was updated, you may need to re-run make."
373
374
375Modules/Setup: $(srcdir)/Modules/Setup.dist
376 @if test -f Modules/Setup; then \
377 echo "-----------------------------------------------"; \
378 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
379 echo "check to make sure you have all the updates you"; \
380 echo "need in your Modules/Setup file."; \
Guido van Rossumbb29b9c2001-09-29 00:42:19 +0000381 echo "Usually, copying Setup.dist to Setup will work."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000382 echo "-----------------------------------------------"; \
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000383 fi
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000384
385############################################################################
386# Special rules for object files
387
388Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000389 $(CC) -c $(PY_CFLAGS) -DBUILD=`cat buildno` -o $@ $(srcdir)/Modules/getbuildinfo.c
Andrew M. Kuchling03184e22001-01-26 22:52:45 +0000390
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000391Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000392 $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
393 -DPREFIX='"$(prefix)"' \
394 -DEXEC_PREFIX='"$(exec_prefix)"' \
395 -DVERSION='"$(VERSION)"' \
396 -DVPATH='"$(VPATH)"' \
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000397 -o $@ $(srcdir)/Modules/getpath.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000398
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000399Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc
400 $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000401
402
403$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
Neil Schemenauer7cd124c2001-02-27 02:19:16 +0000404 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000405
406$(PGEN): $(PGENOBJS)
407 $(CC) $(OPT) $(PGENOBJS) $(LIBS) -o $(PGEN)
408
409Parser/grammar.o: $(srcdir)/Parser/grammar.c \
410 $(srcdir)/Parser/assert.h \
411 $(srcdir)/Include/token.h \
412 $(srcdir)/Include/grammar.h
413Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
414
415
Neil Schemenauer40417742001-02-27 02:45:36 +0000416Python/compile.o Python/symtable.o: $(GRAMMAR_H)
417
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000418Python/getplatform.o: $(srcdir)/Python/getplatform.c
Neil Schemenauer89e90d62001-06-02 06:16:02 +0000419 $(CC) -c $(CFLAGS) $(CPPFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000420
421Python/importdl.o: $(srcdir)/Python/importdl.c
Neil Schemenauer89e90d62001-06-02 06:16:02 +0000422 $(CC) -c $(CFLAGS) $(CPPFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000423
Neil Schemenauera35c6882001-02-27 04:45:05 +0000424Objects/object.o: $(srcdir)/Objects/object.c $(srcdir)/Objects/obmalloc.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000425
426Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
427 $(srcdir)/Objects/unicodetype_db.h
428
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000429############################################################################
430# Header files
431
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000432PYTHON_HEADERS= \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000433 Include/Python.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000434 Include/abstract.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000435 Include/bufferobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000436 Include/ceval.h \
437 Include/classobject.h \
438 Include/cobject.h \
439 Include/codecs.h \
440 Include/compile.h \
441 Include/complexobject.h \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000442 Include/descrobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000443 Include/dictobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000444 Include/fileobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000445 Include/floatobject.h \
446 Include/funcobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000447 Include/import.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000448 Include/intobject.h \
449 Include/intrcheck.h \
450 Include/iterobject.h \
451 Include/listobject.h \
452 Include/longobject.h \
453 Include/methodobject.h \
454 Include/modsupport.h \
455 Include/moduleobject.h \
456 Include/object.h \
457 Include/objimpl.h \
458 Include/patchlevel.h \
459 Include/pydebug.h \
460 Include/pyerrors.h \
461 Include/pyfpe.h \
462 Include/pymem.h \
463 Include/pyport.h \
464 Include/pystate.h \
465 Include/pythonrun.h \
466 Include/rangeobject.h \
467 Include/sliceobject.h \
468 Include/stringobject.h \
Guido van Rossum98bf58f2001-10-18 20:34:25 +0000469 Include/structseq.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000470 Include/structmember.h \
471 Include/symtable.h \
472 Include/sysmodule.h \
473 Include/traceback.h \
474 Include/tupleobject.h \
475 Include/unicodeobject.h \
Fred Drake502ed822001-10-05 21:56:02 +0000476 Include/weakrefobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000477 pyconfig.h
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000478
Fred Drakea1a84e72001-03-06 05:52:16 +0000479$(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS)
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000480
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000481
482######################################################################
483
484# Test the interpreter (twice, once without .pyc files, once with)
485TESTOPTS= -l
486TESTPROG= $(srcdir)/Lib/test/regrtest.py
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000487TESTPYTHON= ./$(PYTHON) -E -tt
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000488test: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000489 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000490 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
491 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000492
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000493QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \
Fred Drake042f3132001-02-02 03:03:33 +0000494 test_unicodedata test_re test_sre test_select test_poll \
Jeremy Hylton26d1f142001-02-02 18:12:16 +0000495 test_linuxaudiodev test_sunaudiodev
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000496quicktest: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000497 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000498 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
499 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000500
Barry Warsaw42119252001-03-03 04:14:21 +0000501MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
502 test_longexp
503memtest: all platform
504 -rm -f $(srcdir)/Lib/test/*.py[co]
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000505 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
506 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
Barry Warsaw42119252001-03-03 04:14:21 +0000507
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000508# Install everything
509install: altinstall bininstall maninstall
510
511# Install almost everything without disturbing previous versions
Andrew M. Kuchlingbddd8782001-01-29 20:18:59 +0000512altinstall: altbininstall libinstall inclinstall libainstall \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000513 sharedinstall oldsharedinstall
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000514
515# Install shared libraries enabled by Setup
516DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
517
518oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
519 @for i in X $(SHAREDMODS); do \
Neil Schemenauerac959772001-02-06 14:50:27 +0000520 if test $$i != X; then \
521 echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
522 $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
523 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000524 done
525
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000526$(DESTSHARED):
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000527 @for i in $(DESTDIRS); \
528 do \
529 if test ! -d $$i; then \
530 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000531 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000532 else true; \
533 fi; \
534 done
535
536
537# Install the interpreter (by creating a hard link to python$(VERSION))
538bininstall: altbininstall
539 -if test -f $(BINDIR)/$(PYTHON); \
540 then rm -f $(BINDIR)/$(PYTHON); \
541 else true; \
542 fi
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000543 (cd $(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000544
545# Install the interpreter with $(VERSION) affixed
546# This goes into $(exec_prefix)
547altbininstall: $(PYTHON)
548 @for i in $(BINDIR); \
549 do \
550 if test ! -d $$i; then \
551 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000552 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000553 else true; \
554 fi; \
555 done
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000556 $(INSTALL_PROGRAM) $(PYTHON) $(BINDIR)/python$(VERSION)$(EXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000557 if test -f libpython$(VERSION).so; then \
558 $(INSTALL_DATA) libpython$(VERSION).so $(LIBDIR); \
559 else true; \
560 fi
561 if test -f "$(DLLLIBRARY)"; then \
Neil Schemenauercf20d4f2001-03-16 11:50:43 +0000562 $(INSTALL_SHARED) $(DLLLIBRARY) $(BINDIR); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000563 else true; \
564 fi
565
566# Install the manual page
567maninstall:
568 @for i in $(MANDIR) $(MANDIR)/man1; \
569 do \
570 if test ! -d $$i; then \
571 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000572 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000573 else true; \
574 fi; \
575 done
576 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
577 $(MANDIR)/man1/python.1
578
579# Install the library
580PLATDIR= plat-$(MACHDEP)
581MACHDEPS= $(PLATDIR)
582XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax
583LIBSUBDIRS= lib-old lib-tk site-packages test test/output encodings \
Andrew M. Kuchling76d62b42001-09-28 20:29:15 +0000584 email compiler \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000585 distutils distutils/command $(XMLLIBSUBDIRS) curses $(MACHDEPS)
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000586libinstall: $(PYTHON) $(srcdir)/Lib/$(PLATDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000587 @for i in $(SCRIPTDIR) $(LIBDEST); \
588 do \
589 if test ! -d $$i; then \
590 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000591 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000592 else true; \
593 fi; \
594 done
595 @for d in $(LIBSUBDIRS); \
596 do \
597 a=$(srcdir)/Lib/$$d; \
598 if test ! -d $$a; then continue; else true; fi; \
599 b=$(LIBDEST)/$$d; \
600 if test ! -d $$b; then \
601 echo "Creating directory $$b"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000602 $(INSTALL) -d -m $(DIRMODE) $$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000603 else true; \
604 fi; \
605 done
606 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
607 do \
608 if test -x $$i; then \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000609 $(INSTALL_SCRIPT) $$i $(LIBDEST); \
610 echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000611 else \
612 $(INSTALL_DATA) $$i $(LIBDEST); \
613 echo $(INSTALL_DATA) $$i $(LIBDEST); \
614 fi; \
615 done
616 @for d in $(LIBSUBDIRS); \
617 do \
618 a=$(srcdir)/Lib/$$d; \
619 if test ! -d $$a; then continue; else true; fi; \
620 b=$(LIBDEST)/$$d; \
621 for i in $$a/*; \
622 do \
623 case $$i in \
624 *CVS) ;; \
625 *.py[co]) ;; \
626 *.orig) ;; \
627 *~) ;; \
628 *) \
629 if test -d $$i; then continue; fi; \
630 if test -x $$i; then \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000631 echo $(INSTALL_SCRIPT) $$i $$b; \
632 $(INSTALL_SCRIPT) $$i $$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000633 else \
634 echo $(INSTALL_DATA) $$i $$b; \
635 $(INSTALL_DATA) $$i $$b; \
636 fi;; \
637 esac; \
638 done; \
639 done
640 $(INSTALL_DATA) $(srcdir)/LICENSE $(LIBDEST)/LICENSE.txt
641 PYTHONPATH=$(LIBDEST) \
Jeremy Hylton12b64572001-04-18 01:20:21 +0000642 ./$(PYTHON) -tt $(LIBDEST)/compileall.py -x badsyntax \
643 $(LIBDEST)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000644 PYTHONPATH=$(LIBDEST) \
Jeremy Hylton12b64572001-04-18 01:20:21 +0000645 ./$(PYTHON) -O $(LIBDEST)/compileall.py -x badsyntax $(LIBDEST)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000646
647# Create the PLATDIR source directory, if one wasn't distributed..
648$(srcdir)/Lib/$(PLATDIR):
649 mkdir $(srcdir)/Lib/$(PLATDIR)
650 cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
651 export PATH; PATH="`pwd`:$$PATH"; \
652 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000653 export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000654 export EXE; EXE="$(EXE)"; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000655 cd $(srcdir)/Lib/$(PLATDIR); ./regen
656
657# Install the include files
658INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
659inclinstall:
660 @for i in $(INCLDIRSTOMAKE); \
661 do \
662 if test ! -d $$i; then \
663 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000664 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000665 else true; \
666 fi; \
667 done
668 @for i in $(srcdir)/Include/*.h; \
669 do \
670 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
671 $(INSTALL_DATA) $$i $(INCLUDEPY); \
672 done
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000673 $(INSTALL_DATA) pyconfig.h $(CONFINCLUDEPY)/pyconfig.h
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000674
675# Install the library and miscellaneous stuff needed for extending/embedding
676# This goes into $(exec_prefix)
677LIBPL= $(LIBP)/config
678libainstall: all
679 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
680 do \
681 if test ! -d $$i; then \
682 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000683 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000684 else true; \
685 fi; \
686 done
687 @if test -d $(LDLIBRARY); then :; else \
Jack Jansen127e56e2001-09-11 14:41:54 +0000688 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000689 $(INSTALL_DATA) $(LDLIBRARY) $(LIBPL)/$(LDLIBRARY) ; \
690 $(RANLIB) $(LIBPL)/$(LDLIBRARY) ; \
691 else \
692 echo Skip install of $(LDLIBRARY) - use make frameworkinstall; \
693 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000694 fi
695 $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
Fred Drakea1a84e72001-03-06 05:52:16 +0000696 $(INSTALL_DATA) Modules/$(MAINOBJ) $(LIBPL)/$(MAINOBJ)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000697 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
698 $(INSTALL_DATA) Makefile $(LIBPL)/Makefile
699 $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
700 $(INSTALL_DATA) Modules/Setup.local $(LIBPL)/Setup.local
701 $(INSTALL_DATA) Modules/Setup.config $(LIBPL)/Setup.config
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000702 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
703 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(LIBPL)/install-sh
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000704 @if [ -s Modules/python.exp -a \
705 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
706 echo; echo "Installing support files for building shared extension modules on AIX:"; \
707 $(INSTALL_DATA) Modules/python.exp \
708 $(LIBPL)/python.exp; \
709 echo; echo "$(LIBPL)/python.exp"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000710 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000711 $(LIBPL)/makexp_aix; \
712 echo "$(LIBPL)/makexp_aix"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000713 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000714 $(LIBPL)/ld_so_aix; \
715 echo "$(LIBPL)/ld_so_aix"; \
716 echo; echo "See Misc/AIX-NOTES for details."; \
717 else true; \
718 fi
719 @case "$(MACHDEP)" in beos*) \
720 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000721 $(INSTALL_DATA) Misc/BeOS-NOTES $(LIBPL)/README; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000722 echo; echo "$(LIBPL)/README"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000723 $(INSTALL_SCRIPT) Modules/ar_beos $(LIBPL)/ar_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000724 echo "$(LIBPL)/ar_beos"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000725 $(INSTALL_SCRIPT) Modules/ld_so_beos $(LIBPL)/ld_so_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000726 echo "$(LIBPL)/ld_so_beos"; \
727 echo; echo "See Misc/BeOS-NOTES for details."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000728 ;; \
729 esac
730
731# Install the dynamically loadable modules
732# This goes into $(exec_prefix)
733sharedinstall:
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000734 ./$(PYTHON) -E $(srcdir)/setup.py install \
Guido van Rossumb33e7892001-10-17 06:26:53 +0000735 --install-scripts=$(BINDIR) \
Andrew M. Kuchling03184e22001-01-26 22:52:45 +0000736 --install-platlib=$(DESTSHARED)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000737
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000738# Install a MacOSX framework During build (before
739# setup.py), make a minimal Python.framework directory structure in the build
740# directory. This framework is minimal, it doesn't contain the Lib directory
741# and such, but together with some magic in Modules/getpath.c it is good enough
742# to run python from the install dir.
743
744FRAMEWORKDEST=$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
745RESSRCDIR=$(srcdir)/Mac/OSXResources/framework
746$(PYTHONFRAMEWORKDIR): $(RESSRCDIR)/Info.plist \
747 $(RESSRCDIR)/version.plist \
748 $(RESSRCDIR)/English.lproj/InfoPlist.strings
Jack Jansen127e56e2001-09-11 14:41:54 +0000749 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000750 echo Not configured with --enable-framework; \
Jack Jansen127e56e2001-09-11 14:41:54 +0000751 exit 1; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000752 else true; \
753 fi
754 $(INSTALL) -d -m $(DIRMODE) $(FRAMEWORKDEST)/Resources/English.lproj
755 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKDEST)/Resources/Info.plist
756 $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKDEST)/Resources/version.plist
757 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
758 $(FRAMEWORKDEST)/Resources/English.lproj/InfoPlist.strings
759 $(LN) -fs $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
760 $(LN) -fs Versions/Current/Python $(PYTHONFRAMEWORKDIR)/Python
761 $(LN) -fs Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
762 $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000763
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000764# On install, we re-make the framework
765# structure in the install location, /Library/Frameworks/ or the argument to
766# --enable-framework. If --enable-framework has been specified then we have
767# automatically set prefix to the location deep down in the framework, so we
768# only have to cater for the structural bits of the framework.
769
770frameworkinstall: install frameworkinfrastructureinstall
771FRAMEWORKFINALDEST=$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)
772frameworkinfrastructureinstall: $(LDLIBRARY)
Jack Jansen127e56e2001-09-11 14:41:54 +0000773 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000774 echo Not configured with --enable-framework; \
Jack Jansen127e56e2001-09-11 14:41:54 +0000775 exit 1; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000776 else true; \
777 fi
778 @for i in $(FRAMEWORKFINALDEST)/Resources/English.lproj $(FRAMEWORKFINALDEST)/lib; do\
779 if test ! -d $$i; then \
780 echo "Creating directory $$i"; \
781 $(INSTALL) -d -m $(DIRMODE) $$i; \
782 else true; \
783 fi; \
784 done
Jack Jansena8278cc2001-08-17 22:37:02 +0000785 $(LN) -sf $(INCLUDEPY) $(FRAMEWORKFINALDEST)/Headers
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000786 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKFINALDEST)/Resources/Info.plist
787 $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKFINALDEST)/Resources/version.plist
788 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
789 $(FRAMEWORKFINALDEST)/Resources/English.lproj/InfoPlist.strings
790 $(LN) -fs $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
791 $(LN) -fs Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python
792 $(LN) -fs Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers
793 $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources
794 $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000795
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000796# Build the toplevel Makefile
797Makefile.pre: Makefile.pre.in config.status
798 CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
799 $(MAKE) -f Makefile.pre Makefile
800
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000801# Run the configure script.
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000802config.status: $(srcdir)/configure
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000803 $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000804
805.PRECIOUS: config.status $(PYTHON) Makefile Makefile.pre
806
807# Some make's put the object file in the current directory
808.c.o:
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000809 $(CC) -c $(PY_CFLAGS) -o $@ $<
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000810
811# Rerun configure with the same options as it was run last time,
812# provided the config.status script exists
813recheck:
814 $(SHELL) config.status --recheck
815 $(SHELL) config.status
816
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000817# Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000818autoconf:
819 (cd $(srcdir); autoconf)
820 (cd $(srcdir); autoheader)
821
822# Create a tags file for vi
823tags::
824 cd $(srcdir); \
825 ctags -w -t Include/*.h; \
826 for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
827 done; \
828 sort tags -o tags
829
830# Create a tags file for GNU Emacs
831TAGS::
832 cd $(srcdir); \
833 etags Include/*.h; \
834 for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
835
836# Sanitation targets -- clean leaves libraries, executables and tags
837# files, which clobber removes those as well
838
839clean:
Neil Schemenauerc5cfcb42001-02-19 04:35:11 +0000840 find . -name '*.o' -exec rm -f {} ';'
Guido van Rossumcd0ed972001-04-14 17:57:07 +0000841 find . -name '*.s[ol]' -exec rm -f {} ';'
Neil Schemenauere0d43572001-02-03 17:16:29 +0000842 find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000843
844clobber: clean
Neil Schemenauerc5cfcb42001-02-19 04:35:11 +0000845 -rm -f $(PYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
Guido van Rossumcd0ed972001-04-14 17:57:07 +0000846 tags TAGS \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000847 config.cache config.log pyconfig.h Modules/config.c
Guido van Rossum1d88c592001-06-06 17:51:57 +0000848 -rm -rf build platform
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000849
850# Make things extra clean, before making a distribution:
851# remove all generated files, even Makefile[.pre]
852distclean: clobber
Neil Schemenauere0d43572001-02-03 17:16:29 +0000853 -rm -f core Makefile Makefile.pre buildno config.status \
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000854 Modules/Setup Modules/Setup.local Modules/Setup.config
Neil Schemenauere0d43572001-02-03 17:16:29 +0000855 find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
856 -o -name '[@,#]*' -o -name '*.old' \
857 -o -name '*.orig' -o -name '*.rej' \
858 -o -name '*.bak' ')' \
859 -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000860
861# Check for smelly exported symbols (not starting with Py/_Py)
862smelly: all
863 nm -p $(LIBRARY) | \
864 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
865
866# Find files with funny names
867funny:
868 find $(DISTDIRS) -type d \
869 -o -name '*.[chs]' \
870 -o -name '*.py' \
871 -o -name '*.doc' \
872 -o -name '*.sty' \
873 -o -name '*.bib' \
874 -o -name '*.dat' \
875 -o -name '*.el' \
876 -o -name '*.fd' \
877 -o -name '*.in' \
878 -o -name '*.tex' \
879 -o -name '*,[vpt]' \
880 -o -name 'Setup' \
881 -o -name 'Setup.*' \
882 -o -name README \
883 -o -name Makefile \
884 -o -name ChangeLog \
885 -o -name Repository \
886 -o -name Root \
887 -o -name Entries \
888 -o -name Tag \
889 -o -name tags \
890 -o -name TAGS \
891 -o -name .cvsignore \
892 -o -name MANIFEST \
893 -o -print
894
Guido van Rossum9454ad72001-08-18 21:08:22 +0000895# Dependencies
896
897Python/thread.o: $(srcdir)/Python/thread_*.h
898
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000899# IF YOU PUT ANYTHING HERE IT WILL GO AWAY