blob: 2933c6539ca0ec1c552cc416c77dfb97b2fa2d8c [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
Mark Hammond8235ea12002-07-19 06:55:41 +000068PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
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@
Jack Jansen1999ef42001-12-06 21:47:20 +0000103BUILDEXE= @BUILDEXEEXT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000104
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000105# Short name and location for Mac OS X Python framework
106PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
107PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
108PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
109PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
110
Martin v. Löwis1142de32002-03-29 16:28:31 +0000111# Environment to run shared python without installed libraries
112RUNSHARED= @RUNSHARED@
113
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000114# Modes for directories, executables and data files created by the
115# install process. Default to user-only-writable for all file types.
116DIRMODE= 755
117EXEMODE= 755
118FILEMODE= 644
119
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000120# configure script arguments
121CONFIG_ARGS= @CONFIG_ARGS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000122
123
124# Subdirectories with code
125SRCDIRS= @SRCDIRS@
126
127# Other subdirectories
128SUBDIRSTOO= Include Lib Misc Demo
129
130# Files and directories to be distributed
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000131CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000132DISTFILES= README ChangeLog $(CONFIGFILES)
133DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
134DIST= $(DISTFILES) $(DISTDIRS)
135
136
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000137LIBRARY= @LIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000138LDLIBRARY= @LDLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000139BLDLIBRARY= @BLDLIBRARY@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000140DLLLIBRARY= @DLLLIBRARY@
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000141LDLIBRARYDIR= @LDLIBRARYDIR@
Martin v. Löwis1142de32002-03-29 16:28:31 +0000142INSTSONAME= @INSTSONAME@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000143
144
145LIBS= @LIBS@
146LIBM= @LIBM@
147LIBC= @LIBC@
148SYSLIBS= $(LIBM) $(LIBC)
Martin v. Löwisf90ae202002-06-11 06:22:31 +0000149SHLIBS= @SHLIBS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000150
151MAINOBJ= @MAINOBJ@
Martin v. Löwis2d7e2642002-04-05 16:50:53 +0000152THREADOBJ= @THREADOBJ@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000153DLINCLDIR= @DLINCLDIR@
154DYNLOADFILE= @DYNLOADFILE@
Jack Jansenc49e5b72001-06-19 15:00:23 +0000155MACHDEP_OBJS= @MACHDEP_OBJS@
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000156UNICODE_OBJS= @UNICODE_OBJS@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000157
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000158PYTHON= python$(EXE)
Jack Jansen1999ef42001-12-06 21:47:20 +0000159BUILDPYTHON= python$(BUILDEXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000160
161# === Definitions added by makesetup ===
162
163
164##########################################################################
165# Modules
166MODULE_OBJS= \
167 Modules/config.o \
168 Modules/getpath.o \
Neil Schemenauer9c63e6d2001-08-29 23:44:38 +0000169 Modules/main.o \
170 Modules/gcmodule.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000171
172# Used of signalmodule.o is not available
173SIGNAL_OBJS= @SIGNAL_OBJS@
174
175
176##########################################################################
177# Grammar
Neil Schemenauer7cd124c2001-02-27 02:19:16 +0000178GRAMMAR_H= $(srcdir)/Include/graminit.h
179GRAMMAR_C= $(srcdir)/Python/graminit.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000180GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
181
182
183##########################################################################
184# Parser
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000185PGEN= Parser/pgen$(EXE)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000186
187POBJS= \
188 Parser/acceler.o \
189 Parser/grammar1.o \
190 Parser/listnode.o \
191 Parser/node.o \
192 Parser/parser.o \
193 Parser/parsetok.o \
194 Parser/tokenizer.o \
195 Parser/bitset.o \
196 Parser/metagrammar.o
197
198PARSER_OBJS= $(POBJS) Parser/myreadline.o
199
200PGOBJS= \
Neil Schemenauerfd1030e2002-04-22 03:05:25 +0000201 Objects/obmalloc.o \
Guido van Rossumf2272522001-12-04 03:54:08 +0000202 Python/mysnprintf.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000203 Parser/firstsets.o \
204 Parser/grammar.o \
205 Parser/pgen.o \
206 Parser/printgrammar.o \
207 Parser/pgenmain.o
208
209PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
210
211
212##########################################################################
213# Python
214PYTHON_OBJS= \
215 Python/bltinmodule.o \
216 Python/exceptions.o \
217 Python/ceval.o \
218 Python/compile.o \
219 Python/codecs.o \
220 Python/errors.o \
221 Python/frozen.o \
222 Python/frozenmain.o \
Jeremy Hylton4db62b12001-02-27 19:07:02 +0000223 Python/future.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000224 Python/getargs.o \
225 Python/getcompiler.o \
226 Python/getcopyright.o \
227 Python/getmtime.o \
228 Python/getplatform.o \
229 Python/getversion.o \
230 Python/graminit.o \
231 Python/import.o \
232 Python/importdl.o \
233 Python/marshal.o \
234 Python/modsupport.o \
235 Python/mystrtoul.o \
Marc-André Lemburge5006eb2001-07-31 13:24:44 +0000236 Python/mysnprintf.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000237 Python/pyfpe.o \
238 Python/pystate.o \
239 Python/pythonrun.o \
240 Python/structmember.o \
Jeremy Hyltoncb17ae82001-02-09 22:22:18 +0000241 Python/symtable.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000242 Python/sysmodule.o \
243 Python/traceback.o \
244 Python/getopt.o \
245 Python/$(DYNLOADFILE) \
Jack Jansenc49e5b72001-06-19 15:00:23 +0000246 $(MACHDEP_OBJS) \
Martin v. Löwis2d7e2642002-04-05 16:50:53 +0000247 $(THREADOBJ)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000248
249
250##########################################################################
251# Objects
252OBJECT_OBJS= \
253 Objects/abstract.o \
Guido van Rossum77f6a652002-04-03 22:41:51 +0000254 Objects/boolobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000255 Objects/bufferobject.o \
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +0000256 Objects/cellobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000257 Objects/classobject.o \
258 Objects/cobject.o \
259 Objects/complexobject.o \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000260 Objects/descrobject.o \
Guido van Rossum7dab2422002-04-26 19:40:56 +0000261 Objects/enumobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000262 Objects/fileobject.o \
263 Objects/floatobject.o \
264 Objects/frameobject.o \
265 Objects/funcobject.o \
266 Objects/intobject.o \
Guido van Rossum59d1d2b2001-04-20 19:13:02 +0000267 Objects/iterobject.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000268 Objects/listobject.o \
269 Objects/longobject.o \
270 Objects/dictobject.o \
271 Objects/methodobject.o \
272 Objects/moduleobject.o \
273 Objects/object.o \
Tim Peters1221c0a2002-03-23 00:20:15 +0000274 Objects/obmalloc.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000275 Objects/rangeobject.o \
276 Objects/sliceobject.o \
277 Objects/stringobject.o \
Guido van Rossum98bf58f2001-10-18 20:34:25 +0000278 Objects/structseq.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000279 Objects/tupleobject.o \
280 Objects/typeobject.o \
Fred Drake502ed822001-10-05 21:56:02 +0000281 Objects/weakrefobject.o \
Martin v. Löwis339d0f72001-08-17 18:39:25 +0000282 $(UNICODE_OBJS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000283
284
285##########################################################################
286# objects that get linked into the Python library
287LIBRARY_OBJS= \
Neil Schemenauer18821822001-01-27 21:42:38 +0000288 Modules/getbuildinfo.o \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000289 $(PARSER_OBJS) \
290 $(OBJECT_OBJS) \
291 $(PYTHON_OBJS) \
292 $(MODULE_OBJS) \
293 $(SIGNAL_OBJS) \
294 $(MODOBJS)
295
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000296#########################################################################
297# Rules
298
299# Default target
Jack Jansen1999ef42001-12-06 21:47:20 +0000300all: $(BUILDPYTHON) oldsharedmods sharedmods
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000301
302# Build the interpreter
Martin v. Löwis1142de32002-03-29 16:28:31 +0000303$(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
Fred Drakea1a84e72001-03-06 05:52:16 +0000304 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
305 Modules/$(MAINOBJ) \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000306 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000307
Jack Jansen1999ef42001-12-06 21:47:20 +0000308platform: $(BUILDPYTHON)
Martin v. Löwis1142de32002-03-29 16:28:31 +0000309 $(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 +0000310
311
312# Build the shared modules
Jack Jansen1999ef42001-12-06 21:47:20 +0000313sharedmods: $(BUILDPYTHON)
Guido van Rossum1140cb22001-09-12 18:59:25 +0000314 case $$MAKEFLAGS in \
Martin v. Löwis1142de32002-03-29 16:28:31 +0000315 *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
316 *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
Guido van Rossum1140cb22001-09-12 18:59:25 +0000317 esac
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000318
Neil Schemenauer18821822001-01-27 21:42:38 +0000319# buildno should really depend on something like LIBRARY_SRC
320buildno: $(PARSER_OBJS) \
321 $(OBJECT_OBJS) \
322 $(PYTHON_OBJS) \
323 $(MODULE_OBJS) \
324 $(SIGNAL_OBJS) \
325 $(MODOBJS) \
326 $(srcdir)/Modules/getbuildinfo.c
327 if test -f buildno; then \
328 expr `cat buildno` + 1 >buildno1; \
329 mv -f buildno1 buildno; \
330 else echo 1 >buildno; fi
331
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000332# Build static library
Guido van Rossum4e6a7a62001-04-09 22:23:22 +0000333# avoid long command lines, same as LIBRARY_OBJS
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000334$(LIBRARY): $(LIBRARY_OBJS)
335 -rm -f $@
Neil Schemenauer18821822001-01-27 21:42:38 +0000336 $(AR) cr $@ Modules/getbuildinfo.o
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000337 $(AR) cr $@ $(PARSER_OBJS)
338 $(AR) cr $@ $(OBJECT_OBJS)
339 $(AR) cr $@ $(PYTHON_OBJS)
340 $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
341 $(AR) cr $@ $(MODOBJS)
342 $(RANLIB) $@
343
Martin v. Löwis1142de32002-03-29 16:28:31 +0000344libpython$(VERSION).so: $(LIBRARY_OBJS)
Martin v. Löwisf90ae202002-06-11 06:22:31 +0000345 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
Martin v. Löwis1142de32002-03-29 16:28:31 +0000346
347libpython$(VERSION).sl: $(LIBRARY_OBJS)
348 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000349
350# This rule is here for OPENSTEP/Rhapsody/MacOSX
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000351$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): $(LIBRARY) $(PYTHONFRAMEWORKDIR)
Jack Jansen246debb2002-02-12 21:30:53 +0000352 $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000353 libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000354 -framework System @LIBTOOL_CRUFT@
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000355
356# This rule builds the Cygwin Python DLL
357libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000358 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
359 $(LIBS) $(MODLIBS) $(SYSLIBS)
360
361
362oldsharedmods: $(SHAREDMODS)
363
364
365Makefile Modules/config.c: Makefile.pre \
366 $(srcdir)/Modules/config.c.in \
367 $(MAKESETUP) \
368 Modules/Setup.config \
369 Modules/Setup \
370 Modules/Setup.local
371 $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
372 -s Modules \
373 Modules/Setup.config \
374 Modules/Setup.local \
375 Modules/Setup
376 @mv config.c Modules
377 @echo "The Makefile was updated, you may need to re-run make."
378
379
380Modules/Setup: $(srcdir)/Modules/Setup.dist
381 @if test -f Modules/Setup; then \
382 echo "-----------------------------------------------"; \
383 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
384 echo "check to make sure you have all the updates you"; \
385 echo "need in your Modules/Setup file."; \
Guido van Rossumbb29b9c2001-09-29 00:42:19 +0000386 echo "Usually, copying Setup.dist to Setup will work."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000387 echo "-----------------------------------------------"; \
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000388 fi
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000389
390############################################################################
391# Special rules for object files
392
393Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000394 $(CC) -c $(PY_CFLAGS) -DBUILD=`cat buildno` -o $@ $(srcdir)/Modules/getbuildinfo.c
Andrew M. Kuchling03184e22001-01-26 22:52:45 +0000395
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000396Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000397 $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
398 -DPREFIX='"$(prefix)"' \
399 -DEXEC_PREFIX='"$(exec_prefix)"' \
400 -DVERSION='"$(VERSION)"' \
401 -DVPATH='"$(VPATH)"' \
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000402 -o $@ $(srcdir)/Modules/getpath.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000403
Sjoerd Mullender30be8702001-01-29 09:39:14 +0000404Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc
405 $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000406
407
408$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
Neil Schemenauer7cd124c2001-02-27 02:19:16 +0000409 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000410
411$(PGEN): $(PGENOBJS)
412 $(CC) $(OPT) $(PGENOBJS) $(LIBS) -o $(PGEN)
413
414Parser/grammar.o: $(srcdir)/Parser/grammar.c \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000415 $(srcdir)/Include/token.h \
416 $(srcdir)/Include/grammar.h
417Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
418
419
Neil Schemenauer40417742001-02-27 02:45:36 +0000420Python/compile.o Python/symtable.o: $(GRAMMAR_H)
421
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000422Python/getplatform.o: $(srcdir)/Python/getplatform.c
Mark Hammond8235ea12002-07-19 06:55:41 +0000423 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000424
425Python/importdl.o: $(srcdir)/Python/importdl.c
Mark Hammond8235ea12002-07-19 06:55:41 +0000426 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000427
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000428Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
429 $(srcdir)/Objects/unicodetype_db.h
430
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000431############################################################################
432# Header files
433
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000434PYTHON_HEADERS= \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000435 Include/Python.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000436 Include/abstract.h \
Guido van Rossum77f6a652002-04-03 22:41:51 +0000437 Include/boolobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000438 Include/bufferobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000439 Include/ceval.h \
440 Include/classobject.h \
441 Include/cobject.h \
442 Include/codecs.h \
443 Include/compile.h \
444 Include/complexobject.h \
Tim Peters6d6c1a32001-08-02 04:15:00 +0000445 Include/descrobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000446 Include/dictobject.h \
Guido van Rossum7dab2422002-04-26 19:40:56 +0000447 Include/enumobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000448 Include/fileobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000449 Include/floatobject.h \
450 Include/funcobject.h \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000451 Include/import.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000452 Include/intobject.h \
453 Include/intrcheck.h \
454 Include/iterobject.h \
455 Include/listobject.h \
456 Include/longobject.h \
457 Include/methodobject.h \
458 Include/modsupport.h \
459 Include/moduleobject.h \
460 Include/object.h \
461 Include/objimpl.h \
462 Include/patchlevel.h \
463 Include/pydebug.h \
464 Include/pyerrors.h \
465 Include/pyfpe.h \
466 Include/pymem.h \
467 Include/pyport.h \
468 Include/pystate.h \
469 Include/pythonrun.h \
470 Include/rangeobject.h \
471 Include/sliceobject.h \
472 Include/stringobject.h \
Guido van Rossum98bf58f2001-10-18 20:34:25 +0000473 Include/structseq.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000474 Include/structmember.h \
475 Include/symtable.h \
476 Include/sysmodule.h \
477 Include/traceback.h \
478 Include/tupleobject.h \
479 Include/unicodeobject.h \
Fred Drake502ed822001-10-05 21:56:02 +0000480 Include/weakrefobject.h \
Guido van Rossum427ce802001-09-18 02:40:21 +0000481 pyconfig.h
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000482
Fred Drakea1a84e72001-03-06 05:52:16 +0000483$(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS)
Neil Schemenauerf65e5002001-01-25 20:07:50 +0000484
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000485
486######################################################################
487
488# Test the interpreter (twice, once without .pyc files, once with)
489TESTOPTS= -l
490TESTPROG= $(srcdir)/Lib/test/regrtest.py
Martin v. Löwis1142de32002-03-29 16:28:31 +0000491TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000492test: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000493 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000494 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
495 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000496
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000497QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \
Fred Drake042f3132001-02-02 03:03:33 +0000498 test_unicodedata test_re test_sre test_select test_poll \
Jeremy Hylton57d930b2002-07-17 15:55:09 +0000499 test_linuxaudiodev test_struct test_sunaudiodev test_zlib
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000500quicktest: all platform
Guido van Rossumcd81ea12001-03-01 00:36:53 +0000501 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000502 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
503 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
Jeremy Hylton2a850d92001-02-01 19:51:28 +0000504
Barry Warsaw42119252001-03-03 04:14:21 +0000505MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
506 test_longexp
507memtest: all platform
508 -rm -f $(srcdir)/Lib/test/*.py[co]
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +0000509 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
510 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
Barry Warsaw42119252001-03-03 04:14:21 +0000511
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000512# Install everything
513install: altinstall bininstall maninstall
514
515# Install almost everything without disturbing previous versions
Andrew M. Kuchlingbddd8782001-01-29 20:18:59 +0000516altinstall: altbininstall libinstall inclinstall libainstall \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000517 sharedinstall oldsharedinstall
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000518
519# Install shared libraries enabled by Setup
520DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
521
522oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
523 @for i in X $(SHAREDMODS); do \
Neil Schemenauerac959772001-02-06 14:50:27 +0000524 if test $$i != X; then \
525 echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
526 $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
527 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000528 done
529
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000530$(DESTSHARED):
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000531 @for i in $(DESTDIRS); \
532 do \
533 if test ! -d $$i; then \
534 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000535 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000536 else true; \
537 fi; \
538 done
539
540
541# Install the interpreter (by creating a hard link to python$(VERSION))
542bininstall: altbininstall
543 -if test -f $(BINDIR)/$(PYTHON); \
544 then rm -f $(BINDIR)/$(PYTHON); \
545 else true; \
546 fi
Neil Schemenauercf9926c2001-02-27 18:50:56 +0000547 (cd $(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000548
549# Install the interpreter with $(VERSION) affixed
550# This goes into $(exec_prefix)
Jack Jansen1999ef42001-12-06 21:47:20 +0000551altbininstall: $(BUILDPYTHON)
Martin v. Löwisd8a20d22002-05-08 08:59:59 +0000552 @for i in $(BINDIR) $(LIBDIR); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000553 do \
554 if test ! -d $$i; then \
555 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000556 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000557 else true; \
558 fi; \
559 done
Jack Jansen1999ef42001-12-06 21:47:20 +0000560 $(INSTALL_PROGRAM) $(BUILDPYTHON) $(BINDIR)/python$(VERSION)$(EXE)
Martin v. Löwis1142de32002-03-29 16:28:31 +0000561 if test -f libpython$(VERSION)$(SO); then \
562 $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(LIBDIR)/$(INSTSONAME); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000563 else true; \
564 fi
565 if test -f "$(DLLLIBRARY)"; then \
Neil Schemenauercf20d4f2001-03-16 11:50:43 +0000566 $(INSTALL_SHARED) $(DLLLIBRARY) $(BINDIR); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000567 else true; \
568 fi
569
570# Install the manual page
571maninstall:
572 @for i in $(MANDIR) $(MANDIR)/man1; \
573 do \
574 if test ! -d $$i; then \
575 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000576 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000577 else true; \
578 fi; \
579 done
580 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
581 $(MANDIR)/man1/python.1
582
583# Install the library
584PLATDIR= plat-$(MACHDEP)
585MACHDEPS= $(PLATDIR)
586XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax
Barry Warsawf4c20d32001-12-03 18:51:41 +0000587LIBSUBDIRS= lib-old lib-tk site-packages test test/output test/data \
588 encodings email compiler hotshot \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000589 distutils distutils/command $(XMLLIBSUBDIRS) curses $(MACHDEPS)
Jack Jansen1999ef42001-12-06 21:47:20 +0000590libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000591 @for i in $(SCRIPTDIR) $(LIBDEST); \
592 do \
593 if test ! -d $$i; then \
594 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000595 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000596 else true; \
597 fi; \
598 done
599 @for d in $(LIBSUBDIRS); \
600 do \
601 a=$(srcdir)/Lib/$$d; \
602 if test ! -d $$a; then continue; else true; fi; \
603 b=$(LIBDEST)/$$d; \
604 if test ! -d $$b; then \
605 echo "Creating directory $$b"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000606 $(INSTALL) -d -m $(DIRMODE) $$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000607 else true; \
608 fi; \
609 done
610 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
611 do \
612 if test -x $$i; then \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000613 $(INSTALL_SCRIPT) $$i $(LIBDEST); \
614 echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000615 else \
616 $(INSTALL_DATA) $$i $(LIBDEST); \
617 echo $(INSTALL_DATA) $$i $(LIBDEST); \
618 fi; \
619 done
620 @for d in $(LIBSUBDIRS); \
621 do \
622 a=$(srcdir)/Lib/$$d; \
623 if test ! -d $$a; then continue; else true; fi; \
624 b=$(LIBDEST)/$$d; \
625 for i in $$a/*; \
626 do \
627 case $$i in \
628 *CVS) ;; \
629 *.py[co]) ;; \
630 *.orig) ;; \
631 *~) ;; \
632 *) \
633 if test -d $$i; then continue; fi; \
634 if test -x $$i; then \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000635 echo $(INSTALL_SCRIPT) $$i $$b; \
636 $(INSTALL_SCRIPT) $$i $$b; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000637 else \
638 echo $(INSTALL_DATA) $$i $$b; \
639 $(INSTALL_DATA) $$i $$b; \
640 fi;; \
641 esac; \
642 done; \
643 done
644 $(INSTALL_DATA) $(srcdir)/LICENSE $(LIBDEST)/LICENSE.txt
Martin v. Löwis1142de32002-03-29 16:28:31 +0000645 PYTHONPATH=$(LIBDEST) $(RUNSHARED) \
Jack Jansen1999ef42001-12-06 21:47:20 +0000646 ./$(BUILDPYTHON) -tt $(LIBDEST)/compileall.py -x badsyntax \
Jeremy Hylton12b64572001-04-18 01:20:21 +0000647 $(LIBDEST)
Martin v. Löwis1142de32002-03-29 16:28:31 +0000648 PYTHONPATH=$(LIBDEST) $(RUNSHARED) \
Jack Jansen1999ef42001-12-06 21:47:20 +0000649 ./$(BUILDPYTHON) -O $(LIBDEST)/compileall.py -x badsyntax $(LIBDEST)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000650
651# Create the PLATDIR source directory, if one wasn't distributed..
652$(srcdir)/Lib/$(PLATDIR):
653 mkdir $(srcdir)/Lib/$(PLATDIR)
654 cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
655 export PATH; PATH="`pwd`:$$PATH"; \
656 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000657 export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
Jack Jansen0d153662001-12-19 09:24:40 +0000658 export EXE; EXE="$(BUILDEXE)"; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000659 cd $(srcdir)/Lib/$(PLATDIR); ./regen
660
661# Install the include files
662INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
663inclinstall:
664 @for i in $(INCLDIRSTOMAKE); \
665 do \
666 if test ! -d $$i; then \
667 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000668 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000669 else true; \
670 fi; \
671 done
672 @for i in $(srcdir)/Include/*.h; \
673 do \
674 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
675 $(INSTALL_DATA) $$i $(INCLUDEPY); \
676 done
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000677 $(INSTALL_DATA) pyconfig.h $(CONFINCLUDEPY)/pyconfig.h
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000678
679# Install the library and miscellaneous stuff needed for extending/embedding
680# This goes into $(exec_prefix)
681LIBPL= $(LIBP)/config
682libainstall: all
683 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
684 do \
685 if test ! -d $$i; then \
686 echo "Creating directory $$i"; \
Neil Schemenauer8d3274e2001-02-10 20:07:38 +0000687 $(INSTALL) -d -m $(DIRMODE) $$i; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000688 else true; \
689 fi; \
690 done
Martin v. Löwis1142de32002-03-29 16:28:31 +0000691 @if test -d $(LIBRARY); then :; else \
Jack Jansen127e56e2001-09-11 14:41:54 +0000692 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Martin v. Löwis1142de32002-03-29 16:28:31 +0000693 $(INSTALL_DATA) $(LIBRARY) $(LIBPL)/$(LIBRARY) ; \
694 $(RANLIB) $(LIBPL)/$(LIBRARY) ; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000695 else \
Martin v. Löwis1142de32002-03-29 16:28:31 +0000696 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000697 fi; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000698 fi
699 $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
Fred Drakea1a84e72001-03-06 05:52:16 +0000700 $(INSTALL_DATA) Modules/$(MAINOBJ) $(LIBPL)/$(MAINOBJ)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000701 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
702 $(INSTALL_DATA) Makefile $(LIBPL)/Makefile
703 $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
704 $(INSTALL_DATA) Modules/Setup.local $(LIBPL)/Setup.local
705 $(INSTALL_DATA) Modules/Setup.config $(LIBPL)/Setup.config
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000706 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
707 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(LIBPL)/install-sh
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000708 @if [ -s Modules/python.exp -a \
709 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
710 echo; echo "Installing support files for building shared extension modules on AIX:"; \
711 $(INSTALL_DATA) Modules/python.exp \
712 $(LIBPL)/python.exp; \
713 echo; echo "$(LIBPL)/python.exp"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000714 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000715 $(LIBPL)/makexp_aix; \
716 echo "$(LIBPL)/makexp_aix"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000717 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000718 $(LIBPL)/ld_so_aix; \
719 echo "$(LIBPL)/ld_so_aix"; \
720 echo; echo "See Misc/AIX-NOTES for details."; \
721 else true; \
722 fi
723 @case "$(MACHDEP)" in beos*) \
724 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000725 $(INSTALL_DATA) Misc/BeOS-NOTES $(LIBPL)/README; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000726 echo; echo "$(LIBPL)/README"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000727 $(INSTALL_SCRIPT) Modules/ar_beos $(LIBPL)/ar_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000728 echo "$(LIBPL)/ar_beos"; \
Neil Schemenauer3f5cc202001-04-10 23:03:35 +0000729 $(INSTALL_SCRIPT) Modules/ld_so_beos $(LIBPL)/ld_so_beos; \
Neil Schemenauer75e33892001-02-16 03:36:53 +0000730 echo "$(LIBPL)/ld_so_beos"; \
731 echo; echo "See Misc/BeOS-NOTES for details."; \
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000732 ;; \
733 esac
734
735# Install the dynamically loadable modules
736# This goes into $(exec_prefix)
737sharedinstall:
Martin v. Löwis1142de32002-03-29 16:28:31 +0000738 $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
739 --prefix=$(prefix) \
Guido van Rossumb33e7892001-10-17 06:26:53 +0000740 --install-scripts=$(BINDIR) \
Andrew M. Kuchling03184e22001-01-26 22:52:45 +0000741 --install-platlib=$(DESTSHARED)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000742
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000743# Install a MacOSX framework During build (before
744# setup.py), make a minimal Python.framework directory structure in the build
745# directory. This framework is minimal, it doesn't contain the Lib directory
746# and such, but together with some magic in Modules/getpath.c it is good enough
747# to run python from the install dir.
748
749FRAMEWORKDEST=$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
750RESSRCDIR=$(srcdir)/Mac/OSXResources/framework
751$(PYTHONFRAMEWORKDIR): $(RESSRCDIR)/Info.plist \
752 $(RESSRCDIR)/version.plist \
753 $(RESSRCDIR)/English.lproj/InfoPlist.strings
Jack Jansen127e56e2001-09-11 14:41:54 +0000754 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000755 echo Not configured with --enable-framework; \
Jack Jansen127e56e2001-09-11 14:41:54 +0000756 exit 1; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000757 else true; \
758 fi
759 $(INSTALL) -d -m $(DIRMODE) $(FRAMEWORKDEST)/Resources/English.lproj
760 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKDEST)/Resources/Info.plist
761 $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKDEST)/Resources/version.plist
762 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
763 $(FRAMEWORKDEST)/Resources/English.lproj/InfoPlist.strings
Jack Jansen246debb2002-02-12 21:30:53 +0000764 $(LN) -fsh $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
765 $(LN) -fsh Versions/Current/Python $(PYTHONFRAMEWORKDIR)/Python
766 $(LN) -fsh Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
767 $(LN) -fsh Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000768
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000769# On install, we re-make the framework
770# structure in the install location, /Library/Frameworks/ or the argument to
771# --enable-framework. If --enable-framework has been specified then we have
772# automatically set prefix to the location deep down in the framework, so we
773# only have to cater for the structural bits of the framework.
774
775frameworkinstall: install frameworkinfrastructureinstall
776FRAMEWORKFINALDEST=$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)
777frameworkinfrastructureinstall: $(LDLIBRARY)
Jack Jansen127e56e2001-09-11 14:41:54 +0000778 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000779 echo Not configured with --enable-framework; \
Jack Jansen127e56e2001-09-11 14:41:54 +0000780 exit 1; \
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000781 else true; \
782 fi
783 @for i in $(FRAMEWORKFINALDEST)/Resources/English.lproj $(FRAMEWORKFINALDEST)/lib; do\
784 if test ! -d $$i; then \
785 echo "Creating directory $$i"; \
786 $(INSTALL) -d -m $(DIRMODE) $$i; \
787 else true; \
788 fi; \
789 done
Jack Jansena8278cc2001-08-17 22:37:02 +0000790 $(LN) -sf $(INCLUDEPY) $(FRAMEWORKFINALDEST)/Headers
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000791 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKFINALDEST)/Resources/Info.plist
792 $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKFINALDEST)/Resources/version.plist
793 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
794 $(FRAMEWORKFINALDEST)/Resources/English.lproj/InfoPlist.strings
Jack Jansen246debb2002-02-12 21:30:53 +0000795 $(LN) -fsh $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
796 $(LN) -fsh Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python
797 $(LN) -fsh Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers
798 $(LN) -fsh Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources
Jack Jansenb6e9cad2001-08-15 01:26:28 +0000799 $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000800
Jack Jansen0b06be72002-06-21 14:48:38 +0000801# Build Python executable that can run GUI code. Another MacOSX pseudo
802# target.
803python.app:
804 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile install installmacsubtree \
805 PYTHONSRCDIR=$(srcdir) PYTHONBUILDDIR=.
806
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000807# Build the toplevel Makefile
808Makefile.pre: Makefile.pre.in config.status
809 CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
810 $(MAKE) -f Makefile.pre Makefile
811
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000812# Run the configure script.
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000813config.status: $(srcdir)/configure
Neil Schemenauer64b1b682001-03-22 00:32:32 +0000814 $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000815
Jack Jansen1999ef42001-12-06 21:47:20 +0000816.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000817
818# Some make's put the object file in the current directory
819.c.o:
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000820 $(CC) -c $(PY_CFLAGS) -o $@ $<
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000821
822# Rerun configure with the same options as it was run last time,
823# provided the config.status script exists
824recheck:
825 $(SHELL) config.status --recheck
826 $(SHELL) config.status
827
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +0000828# Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000829autoconf:
830 (cd $(srcdir); autoconf)
831 (cd $(srcdir); autoheader)
832
833# Create a tags file for vi
834tags::
835 cd $(srcdir); \
836 ctags -w -t Include/*.h; \
837 for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
838 done; \
Guido van Rossumc9489662002-02-28 19:26:08 +0000839 sort -o tags tags
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000840
841# Create a tags file for GNU Emacs
842TAGS::
843 cd $(srcdir); \
844 etags Include/*.h; \
845 for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
846
847# Sanitation targets -- clean leaves libraries, executables and tags
848# files, which clobber removes those as well
849
850clean:
Neil Schemenauerc5cfcb42001-02-19 04:35:11 +0000851 find . -name '*.o' -exec rm -f {} ';'
Guido van Rossumcd0ed972001-04-14 17:57:07 +0000852 find . -name '*.s[ol]' -exec rm -f {} ';'
Neil Schemenauere0d43572001-02-03 17:16:29 +0000853 find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000854
855clobber: clean
Jack Jansen1999ef42001-12-06 21:47:20 +0000856 -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
Guido van Rossumcd0ed972001-04-14 17:57:07 +0000857 tags TAGS \
Guido van Rossum7cb32ae2001-08-17 15:32:31 +0000858 config.cache config.log pyconfig.h Modules/config.c
Guido van Rossum1d88c592001-06-06 17:51:57 +0000859 -rm -rf build platform
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000860
861# Make things extra clean, before making a distribution:
862# remove all generated files, even Makefile[.pre]
863distclean: clobber
Neil Schemenauere0d43572001-02-03 17:16:29 +0000864 -rm -f core Makefile Makefile.pre buildno config.status \
Neil Schemenauer7ac954b2001-01-26 16:14:41 +0000865 Modules/Setup Modules/Setup.local Modules/Setup.config
Neil Schemenauere0d43572001-02-03 17:16:29 +0000866 find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
867 -o -name '[@,#]*' -o -name '*.old' \
868 -o -name '*.orig' -o -name '*.rej' \
869 -o -name '*.bak' ')' \
870 -exec rm -f {} ';'
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000871
872# Check for smelly exported symbols (not starting with Py/_Py)
873smelly: all
874 nm -p $(LIBRARY) | \
875 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
876
877# Find files with funny names
878funny:
879 find $(DISTDIRS) -type d \
880 -o -name '*.[chs]' \
881 -o -name '*.py' \
882 -o -name '*.doc' \
883 -o -name '*.sty' \
884 -o -name '*.bib' \
885 -o -name '*.dat' \
886 -o -name '*.el' \
887 -o -name '*.fd' \
888 -o -name '*.in' \
889 -o -name '*.tex' \
890 -o -name '*,[vpt]' \
891 -o -name 'Setup' \
892 -o -name 'Setup.*' \
893 -o -name README \
894 -o -name Makefile \
895 -o -name ChangeLog \
896 -o -name Repository \
897 -o -name Root \
898 -o -name Entries \
899 -o -name Tag \
900 -o -name tags \
901 -o -name TAGS \
902 -o -name .cvsignore \
903 -o -name MANIFEST \
904 -o -print
905
Guido van Rossum9454ad72001-08-18 21:08:22 +0000906# Dependencies
907
Martin v. Löwis06f15bb2001-12-02 13:02:32 +0000908Python/thread.o: @THREADHEADERS@
Guido van Rossum9454ad72001-08-18 21:08:22 +0000909
Neil Schemenauer85515ad2001-01-24 17:11:43 +0000910# IF YOU PUT ANYTHING HERE IT WILL GO AWAY