source: python/vendor/Python-2.6.5/Makefile.pre.in@ 2

Last change on this file since 2 was 2, checked in by Yuri Dario, 15 years ago

Initial import for vendor code.

  • Property svn:eol-style set to native
File size: 38.3 KB
Line 
1# Top-level Makefile for Python
2#
3# 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:
8#
9# ./configure
10# make
11# make test
12# make install
13#
14# 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
16# install". Refer to the "Installing" section in the README file for
17# additional details.
18#
19# 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@
33MAINCC= @MAINCC@
34LINKCC= @LINKCC@
35AR= @AR@
36RANLIB= @RANLIB@
37SVNVERSION= @SVNVERSION@
38
39# Shell used by make (some versions default to the login shell, which is bad)
40SHELL= /bin/sh
41
42# Use this to make a link between python$(VERSION) and python in $(BINDIR)
43LN= @LN@
44
45# Portable install script (configure doesn't always guess right)
46INSTALL= @INSTALL@
47INSTALL_PROGRAM=@INSTALL_PROGRAM@
48INSTALL_SCRIPT= @INSTALL_SCRIPT@
49INSTALL_DATA= @INSTALL_DATA@
50# Shared libraries must be installed with executable mode on some systems;
51# rather than figuring out exactly which, we always give them executable mode.
52# Also, making them read-only seems to be a good idea...
53INSTALL_SHARED= ${INSTALL} -m 555
54
55MAKESETUP= $(srcdir)/Modules/makesetup
56
57# Compiler options
58OPT= @OPT@
59BASECFLAGS= @BASECFLAGS@
60CFLAGS= $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)
61# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
62# be able to build extension modules using the directories specified in the
63# environment variables
64CPPFLAGS= -I. -IInclude -I$(srcdir)/Include @CPPFLAGS@
65LDFLAGS= @LDFLAGS@
66LDLAST= @LDLAST@
67SGI_ABI= @SGI_ABI@
68CCSHARED= @CCSHARED@
69LINKFORSHARED= @LINKFORSHARED@
70# Extra C flags added for building the interpreter object files.
71CFLAGSFORSHARED=@CFLAGSFORSHARED@
72# C flags used for building the interpreter object files
73PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
74
75
76# Machine-dependent subdirectories
77MACHDEP= @MACHDEP@
78
79# Install prefix for architecture-independent files
80prefix= @prefix@
81
82# Install prefix for architecture-dependent files
83exec_prefix= @exec_prefix@
84
85# Install prefix for data files
86datarootdir= @datarootdir@
87
88# Expanded directories
89BINDIR= $(exec_prefix)/bin
90LIBDIR= $(exec_prefix)/lib
91MANDIR= @mandir@
92INCLUDEDIR= @includedir@
93CONFINCLUDEDIR= $(exec_prefix)/include
94SCRIPTDIR= $(prefix)/lib
95
96# Detailed destination directories
97BINLIBDEST= $(LIBDIR)/python$(VERSION)
98LIBDEST= $(SCRIPTDIR)/python$(VERSION)
99INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
100CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
101LIBP= $(LIBDIR)/python$(VERSION)
102
103# Symbols used for using shared libraries
104SO= @SO@
105LDSHARED= @LDSHARED@
106BLDSHARED= @BLDSHARED@
107DESTSHARED= $(BINLIBDEST)/lib-dynload
108
109# Executable suffix (.exe on Windows and Mac OS X)
110EXE= @EXEEXT@
111BUILDEXE= @BUILDEXEEXT@
112
113# Short name and location for Mac OS X Python framework
114UNIVERSALSDK=@UNIVERSALSDK@
115PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
116PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
117PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
118PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
119# Deployment target selected during configure, to be checked
120# by distutils. The export statement is needed to ensure that the
121# deployment target is active during build.
122MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
123@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
124
125# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
126OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
127
128# Environment to run shared python without installed libraries
129RUNSHARED= @RUNSHARED@
130
131# Modes for directories, executables and data files created by the
132# install process. Default to user-only-writable for all file types.
133DIRMODE= 755
134EXEMODE= 755
135FILEMODE= 644
136
137# configure script arguments
138CONFIG_ARGS= @CONFIG_ARGS@
139
140
141# Subdirectories with code
142SRCDIRS= @SRCDIRS@
143
144# Other subdirectories
145SUBDIRSTOO= Include Lib Misc Demo
146
147# Files and directories to be distributed
148CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
149DISTFILES= README ChangeLog $(CONFIGFILES)
150DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
151DIST= $(DISTFILES) $(DISTDIRS)
152
153
154LIBRARY= @LIBRARY@
155LDLIBRARY= @LDLIBRARY@
156BLDLIBRARY= @BLDLIBRARY@
157DLLLIBRARY= @DLLLIBRARY@
158LDLIBRARYDIR= @LDLIBRARYDIR@
159INSTSONAME= @INSTSONAME@
160
161
162LIBS= @LIBS@
163LIBM= @LIBM@
164LIBC= @LIBC@
165SYSLIBS= $(LIBM) $(LIBC)
166SHLIBS= @SHLIBS@
167
168THREADOBJ= @THREADOBJ@
169DLINCLDIR= @DLINCLDIR@
170DYNLOADFILE= @DYNLOADFILE@
171MACHDEP_OBJS= @MACHDEP_OBJS@
172LIBOBJDIR= Python/
173LIBOBJS= @LIBOBJS@
174UNICODE_OBJS= @UNICODE_OBJS@
175
176PYTHON= python$(EXE)
177BUILDPYTHON= python$(BUILDEXE)
178
179# The task to run while instrument when building the profile-opt target
180PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
181#PROFILE_TASK= $(srcdir)/Lib/test/regrtest.py
182
183# === Definitions added by makesetup ===
184
185
186##########################################################################
187# Modules
188MODULE_OBJS= \
189 Modules/config.o \
190 Modules/getpath.o \
191 Modules/main.o \
192 Modules/gcmodule.o
193
194# Used of signalmodule.o is not available
195SIGNAL_OBJS= @SIGNAL_OBJS@
196
197
198##########################################################################
199# Grammar
200GRAMMAR_H= $(srcdir)/Include/graminit.h
201GRAMMAR_C= $(srcdir)/Python/graminit.c
202GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
203
204
205##########################################################################
206# Parser
207PGEN= Parser/pgen$(EXE)
208
209POBJS= \
210 Parser/acceler.o \
211 Parser/grammar1.o \
212 Parser/listnode.o \
213 Parser/node.o \
214 Parser/parser.o \
215 Parser/parsetok.o \
216 Parser/bitset.o \
217 Parser/metagrammar.o \
218 Parser/firstsets.o \
219 Parser/grammar.o \
220 Parser/pgen.o
221
222PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o
223
224PGOBJS= \
225 Objects/obmalloc.o \
226 Python/mysnprintf.o \
227 Parser/tokenizer_pgen.o \
228 Parser/printgrammar.o \
229 Parser/pgenmain.o
230
231PARSER_HEADERS= \
232 Parser/parser.h \
233 Parser/tokenizer.h
234
235PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
236
237##########################################################################
238# AST
239AST_H_DIR= $(srcdir)/Include
240AST_H= $(AST_H_DIR)/Python-ast.h
241AST_C_DIR= $(srcdir)/Python
242AST_C= $(AST_C_DIR)/Python-ast.c
243AST_ASDL= $(srcdir)/Parser/Python.asdl
244
245ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
246# XXX Note that a build now requires Python exist before the build starts
247ASDLGEN= $(srcdir)/Parser/asdl_c.py
248
249##########################################################################
250# Python
251PYTHON_OBJS= \
252 Python/_warnings.o \
253 Python/Python-ast.o \
254 Python/asdl.o \
255 Python/ast.o \
256 Python/bltinmodule.o \
257 Python/ceval.o \
258 Python/compile.o \
259 Python/codecs.o \
260 Python/errors.o \
261 Python/frozen.o \
262 Python/frozenmain.o \
263 Python/future.o \
264 Python/getargs.o \
265 Python/getcompiler.o \
266 Python/getcopyright.o \
267 Python/getmtime.o \
268 Python/getplatform.o \
269 Python/getversion.o \
270 Python/graminit.o \
271 Python/import.o \
272 Python/importdl.o \
273 Python/marshal.o \
274 Python/modsupport.o \
275 Python/mystrtoul.o \
276 Python/mysnprintf.o \
277 Python/peephole.o \
278 Python/pyarena.o \
279 Python/pyfpe.o \
280 Python/pymath.o \
281 Python/pystate.o \
282 Python/pythonrun.o \
283 Python/structmember.o \
284 Python/symtable.o \
285 Python/sysmodule.o \
286 Python/traceback.o \
287 Python/getopt.o \
288 Python/pystrcmp.o \
289 Python/pystrtod.o \
290 Python/formatter_unicode.o \
291 Python/formatter_string.o \
292 Python/$(DYNLOADFILE) \
293 $(LIBOBJS) \
294 $(MACHDEP_OBJS) \
295 $(THREADOBJ)
296
297
298##########################################################################
299# Objects
300OBJECT_OBJS= \
301 Objects/abstract.o \
302 Objects/boolobject.o \
303 Objects/bufferobject.o \
304 Objects/bytes_methods.o \
305 Objects/bytearrayobject.o \
306 Objects/cellobject.o \
307 Objects/classobject.o \
308 Objects/cobject.o \
309 Objects/codeobject.o \
310 Objects/complexobject.o \
311 Objects/descrobject.o \
312 Objects/enumobject.o \
313 Objects/exceptions.o \
314 Objects/genobject.o \
315 Objects/fileobject.o \
316 Objects/floatobject.o \
317 Objects/frameobject.o \
318 Objects/funcobject.o \
319 Objects/intobject.o \
320 Objects/iterobject.o \
321 Objects/listobject.o \
322 Objects/longobject.o \
323 Objects/dictobject.o \
324 Objects/methodobject.o \
325 Objects/moduleobject.o \
326 Objects/object.o \
327 Objects/obmalloc.o \
328 Objects/rangeobject.o \
329 Objects/setobject.o \
330 Objects/sliceobject.o \
331 Objects/stringobject.o \
332 Objects/structseq.o \
333 Objects/tupleobject.o \
334 Objects/typeobject.o \
335 Objects/weakrefobject.o \
336 $(UNICODE_OBJS)
337
338
339##########################################################################
340# objects that get linked into the Python library
341LIBRARY_OBJS= \
342 Modules/getbuildinfo.o \
343 $(PARSER_OBJS) \
344 $(OBJECT_OBJS) \
345 $(PYTHON_OBJS) \
346 $(MODULE_OBJS) \
347 $(SIGNAL_OBJS) \
348 $(MODOBJS)
349
350#########################################################################
351# Rules
352
353# Default target
354all: build_all
355build_all: $(BUILDPYTHON) oldsharedmods sharedmods
356
357# Compile a binary with gcc profile guided optimization.
358profile-opt:
359 @echo "Building with support for profile generation:"
360 $(MAKE) clean
361 $(MAKE) build_all_generate_profile
362 @echo "Running benchmark to generate profile data:"
363 $(MAKE) profile-removal
364 $(MAKE) run_profile_task
365 @echo "Rebuilding with profile guided optimizations:"
366 $(MAKE) clean
367 $(MAKE) build_all_use_profile
368
369build_all_generate_profile:
370 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
371
372run_profile_task:
373 ./$(BUILDPYTHON) $(PROFILE_TASK)
374
375build_all_use_profile:
376 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
377
378coverage:
379 @echo "Building with support for coverage checking:"
380 $(MAKE) clean
381 $(MAKE) all CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"
382
383
384# Build the interpreter
385$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
386 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
387 Modules/python.o \
388 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
389
390platform: $(BUILDPYTHON)
391 $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
392
393
394# Build the shared modules
395sharedmods: $(BUILDPYTHON)
396 @case $$MAKEFLAGS in \
397 *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
398 *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
399 esac
400
401# Build static library
402# avoid long command lines, same as LIBRARY_OBJS
403$(LIBRARY): $(LIBRARY_OBJS)
404 -rm -f $@
405 $(AR) cr $@ Modules/getbuildinfo.o
406 $(AR) cr $@ $(PARSER_OBJS)
407 $(AR) cr $@ $(OBJECT_OBJS)
408 $(AR) cr $@ $(PYTHON_OBJS)
409 $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
410 $(AR) cr $@ $(MODOBJS)
411 $(RANLIB) $@
412
413libpython$(VERSION).so: $(LIBRARY_OBJS)
414 if test $(INSTSONAME) != $(LDLIBRARY); then \
415 $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
416 $(LN) -f $(INSTSONAME) $@; \
417 else \
418 $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
419 fi
420
421libpython$(VERSION).dylib: $(LIBRARY_OBJS)
422 $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
423
424
425libpython$(VERSION).sl: $(LIBRARY_OBJS)
426 $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
427
428# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
429# minimal framework (not including the Lib directory and such) in the current
430# directory.
431RESSRCDIR=Mac/Resources/framework
432$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
433 $(LIBRARY) \
434 $(RESSRCDIR)/Info.plist
435 $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
436 if test "${UNIVERSALSDK}"; then \
437 $(CC) -o $(LDLIBRARY) @UNIVERSAL_ARCH_FLAGS@ -dynamiclib \
438 -isysroot "${UNIVERSALSDK}" \
439 -all_load $(LIBRARY) -Wl,-single_module \
440 -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
441 -compatibility_version $(VERSION) \
442 -current_version $(VERSION); \
443 else \
444 /usr/bin/libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
445 @LIBTOOL_CRUFT@ ;\
446 fi
447 $(INSTALL) -d -m $(DIRMODE) \
448 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
449 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
450 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
451 $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
452 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
453 $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
454 $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
455
456# This rule builds the Cygwin Python DLL and import library if configured
457# for a shared core library; otherwise, this rule is a noop.
458$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
459 if test -n "$(DLLLIBRARY)"; then \
460 $(LDSHARED) $(LDFLAGS) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
461 $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \
462 else true; \
463 fi
464
465
466oldsharedmods: $(SHAREDMODS)
467
468
469Makefile Modules/config.c: Makefile.pre \
470 $(srcdir)/Modules/config.c.in \
471 $(MAKESETUP) \
472 Modules/Setup.config \
473 Modules/Setup \
474 Modules/Setup.local
475 $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
476 -s Modules \
477 Modules/Setup.config \
478 Modules/Setup.local \
479 Modules/Setup
480 @mv config.c Modules
481 @echo "The Makefile was updated, you may need to re-run make."
482
483
484Modules/Setup: $(srcdir)/Modules/Setup.dist
485 @if test -f Modules/Setup; then \
486 echo "-----------------------------------------------"; \
487 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
488 echo "check to make sure you have all the updates you"; \
489 echo "need in your Modules/Setup file."; \
490 echo "Usually, copying Modules/Setup.dist to Modules/Setup will work."; \
491 echo "-----------------------------------------------"; \
492 fi
493
494############################################################################
495# Special rules for object files
496
497Modules/getbuildinfo.o: $(PARSER_OBJS) \
498 $(OBJECT_OBJS) \
499 $(PYTHON_OBJS) \
500 $(MODULE_OBJS) \
501 $(SIGNAL_OBJS) \
502 $(MODOBJS) \
503 $(srcdir)/Modules/getbuildinfo.c
504 $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
505
506Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
507 $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
508 -DPREFIX='"$(prefix)"' \
509 -DEXEC_PREFIX='"$(exec_prefix)"' \
510 -DVERSION='"$(VERSION)"' \
511 -DVPATH='"$(VPATH)"' \
512 -o $@ $(srcdir)/Modules/getpath.c
513
514Modules/python.o: $(srcdir)/Modules/python.c
515 $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
516
517
518$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
519 -@$(INSTALL) -d Include
520 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
521
522$(PGEN): $(PGENOBJS)
523 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
524
525Parser/grammar.o: $(srcdir)/Parser/grammar.c \
526 $(srcdir)/Include/token.h \
527 $(srcdir)/Include/grammar.h
528Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
529
530Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c
531
532Parser/pgenmain.o: $(srcdir)/Include/parsetok.h
533
534$(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
535 $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
536
537$(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
538 $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
539
540Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
541
542Python/getplatform.o: $(srcdir)/Python/getplatform.c
543 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
544
545Python/importdl.o: $(srcdir)/Python/importdl.c
546 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
547
548Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
549 $(srcdir)/Objects/unicodetype_db.h
550
551STRINGLIB_HEADERS= \
552 $(srcdir)/Include/bytes_methods.h \
553 $(srcdir)/Objects/stringlib/count.h \
554 $(srcdir)/Objects/stringlib/ctype.h \
555 $(srcdir)/Objects/stringlib/fastsearch.h \
556 $(srcdir)/Objects/stringlib/find.h \
557 $(srcdir)/Objects/stringlib/formatter.h \
558 $(srcdir)/Objects/stringlib/partition.h \
559 $(srcdir)/Objects/stringlib/stringdefs.h \
560 $(srcdir)/Objects/stringlib/string_format.h \
561 $(srcdir)/Objects/stringlib/transmogrify.h \
562 $(srcdir)/Objects/stringlib/unicodedefs.h \
563 $(srcdir)/Objects/stringlib/localeutil.h
564
565Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
566 $(STRINGLIB_HEADERS)
567
568Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \
569 $(STRINGLIB_HEADERS)
570
571Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \
572 $(STRINGLIB_HEADERS)
573
574Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
575 $(STRINGLIB_HEADERS)
576
577Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
578 $(STRINGLIB_HEADERS)
579
580############################################################################
581# Header files
582
583PYTHON_HEADERS= \
584 Include/Python-ast.h \
585 Include/Python.h \
586 Include/abstract.h \
587 Include/asdl.h \
588 Include/ast.h \
589 Include/bitset.h \
590 Include/boolobject.h \
591 Include/bytearrayobject.h \
592 Include/bytes_methods.h \
593 Include/bytesobject.h \
594 Include/bufferobject.h \
595 Include/cellobject.h \
596 Include/ceval.h \
597 Include/classobject.h \
598 Include/cobject.h \
599 Include/code.h \
600 Include/codecs.h \
601 Include/compile.h \
602 Include/complexobject.h \
603 Include/descrobject.h \
604 Include/dictobject.h \
605 Include/enumobject.h \
606 Include/errcode.h \
607 Include/eval.h \
608 Include/fileobject.h \
609 Include/floatobject.h \
610 Include/frameobject.h \
611 Include/funcobject.h \
612 Include/genobject.h \
613 Include/import.h \
614 Include/intobject.h \
615 Include/intrcheck.h \
616 Include/iterobject.h \
617 Include/listobject.h \
618 Include/longintrepr.h \
619 Include/longobject.h \
620 Include/marshal.h \
621 Include/metagrammar.h \
622 Include/methodobject.h \
623 Include/modsupport.h \
624 Include/moduleobject.h \
625 Include/node.h \
626 Include/object.h \
627 Include/objimpl.h \
628 Include/opcode.h \
629 Include/osdefs.h \
630 Include/parsetok.h \
631 Include/patchlevel.h \
632 Include/pgen.h \
633 Include/pgenheaders.h \
634 Include/pyarena.h \
635 Include/pydebug.h \
636 Include/pyerrors.h \
637 Include/pyfpe.h \
638 Include/pymath.h \
639 Include/pygetopt.h \
640 Include/pymem.h \
641 Include/pyport.h \
642 Include/pystate.h \
643 Include/pystrcmp.h \
644 Include/pystrtod.h \
645 Include/pythonrun.h \
646 Include/pythread.h \
647 Include/rangeobject.h \
648 Include/setobject.h \
649 Include/sliceobject.h \
650 Include/stringobject.h \
651 Include/structmember.h \
652 Include/structseq.h \
653 Include/symtable.h \
654 Include/sysmodule.h \
655 Include/traceback.h \
656 Include/tupleobject.h \
657 Include/ucnhash.h \
658 Include/unicodeobject.h \
659 Include/warnings.h \
660 Include/weakrefobject.h \
661 pyconfig.h \
662 $(PARSER_HEADERS)
663
664$(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
665
666
667######################################################################
668
669# Test the interpreter (twice, once without .pyc files, once with)
670# In the past, we've had problems where bugs in the marshalling or
671# elsewhere caused bytecode read from .pyc files to behave differently
672# than bytecode generated directly from a .py source file. Sometimes
673# the bytecode read from a .pyc file had the bug, somtimes the directly
674# generated bytecode. This is sometimes a very shy bug needing a lot of
675# sample data.
676
677TESTOPTS= -l $(EXTRATESTOPTS)
678TESTPROG= $(srcdir)/Lib/test/regrtest.py
679TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
680test: all platform
681 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
682 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
683 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
684
685testall: all platform
686 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
687 $(TESTPYTHON) $(srcdir)/Lib/compileall.py
688 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
689 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
690 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
691
692# Run the unitests for both architectures in a Universal build on OSX
693# Must be run on an Intel box.
694testuniversal: all platform
695 if [ `arch` != 'i386' ];then \
696 echo "This can only be used on OSX/i386" ;\
697 exit 1 ;\
698 fi
699 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
700 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
701 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
702 $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) $(TESTOPTS) -uall
703
704
705# Like testall, but with a single pass only
706# run an optional script to include some information about the build environment
707buildbottest: all platform
708 -@if which pybuildbot.identify >/dev/null 2>&1; then \
709 pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
710 fi
711 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall -rw
712
713QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \
714 test_unicodedata test_re test_sre test_select test_poll \
715 test_linuxaudiodev test_struct test_sunaudiodev test_zlib
716quicktest: all platform
717 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
718 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
719 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
720
721MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
722 test_longexp
723memtest: all platform
724 -rm -f $(srcdir)/Lib/test/*.py[co]
725 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
726 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
727
728# Install everything
729install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
730
731# Install almost everything without disturbing previous versions
732altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
733 sharedinstall oldsharedinstall @FRAMEWORKALTINSTALLLAST@
734
735# Install shared libraries enabled by Setup
736DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
737
738oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
739 @for i in X $(SHAREDMODS); do \
740 if test $$i != X; then \
741 echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
742 $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
743 fi; \
744 done
745
746$(DESTSHARED):
747 @for i in $(DESTDIRS); \
748 do \
749 if test ! -d $(DESTDIR)$$i; then \
750 echo "Creating directory $$i"; \
751 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
752 else true; \
753 fi; \
754 done
755
756
757# Install the interpreter (by creating a hard link to python$(VERSION))
758bininstall: altbininstall
759 -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
760 then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
761 else true; \
762 fi
763 (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
764 -rm -f $(DESTDIR)$(BINDIR)/python-config
765 (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
766
767# Install the interpreter with $(VERSION) affixed
768# This goes into $(exec_prefix)
769altbininstall: $(BUILDPYTHON)
770 @for i in $(BINDIR) $(LIBDIR); \
771 do \
772 if test ! -d $(DESTDIR)$$i; then \
773 echo "Creating directory $$i"; \
774 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
775 else true; \
776 fi; \
777 done
778 $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
779 if test -f $(LDLIBRARY); then \
780 if test -n "$(DLLLIBRARY)" ; then \
781 $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
782 else \
783 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
784 if test $(LDLIBRARY) != $(INSTSONAME); then \
785 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
786 fi \
787 fi; \
788 else true; \
789 fi
790
791# Install the manual page
792maninstall:
793 @for i in $(MANDIR) $(MANDIR)/man1; \
794 do \
795 if test ! -d $(DESTDIR)$$i; then \
796 echo "Creating directory $$i"; \
797 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
798 else true; \
799 fi; \
800 done
801 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
802 $(DESTDIR)$(MANDIR)/man1/python.1
803
804# Install the library
805PLATDIR= plat-$(MACHDEP)
806EXTRAPLATDIR= @EXTRAPLATDIR@
807EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@
808MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
809XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
810PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
811 plat-mac/lib-scriptpackages/_builtinSuites \
812 plat-mac/lib-scriptpackages/CodeWarrior \
813 plat-mac/lib-scriptpackages/Explorer \
814 plat-mac/lib-scriptpackages/Finder \
815 plat-mac/lib-scriptpackages/Netscape \
816 plat-mac/lib-scriptpackages/StdSuites \
817 plat-mac/lib-scriptpackages/SystemEvents \
818 plat-mac/lib-scriptpackages/Terminal
819PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
820LIBSUBDIRS= lib-tk site-packages test test/output test/data \
821 test/decimaltestdata \
822 encodings compiler hotshot \
823 email email/mime email/test email/test/data \
824 json json/tests \
825 sqlite3 sqlite3/test \
826 logging bsddb bsddb/test csv wsgiref \
827 lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
828 ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
829 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
830 multiprocessing multiprocessing/dummy \
831 lib-old \
832 curses $(MACHDEPS)
833libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
834 @for i in $(SCRIPTDIR) $(LIBDEST); \
835 do \
836 if test ! -d $(DESTDIR)$$i; then \
837 echo "Creating directory $$i"; \
838 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
839 else true; \
840 fi; \
841 done
842 @for d in $(LIBSUBDIRS); \
843 do \
844 a=$(srcdir)/Lib/$$d; \
845 if test ! -d $$a; then continue; else true; fi; \
846 b=$(LIBDEST)/$$d; \
847 if test ! -d $(DESTDIR)$$b; then \
848 echo "Creating directory $$b"; \
849 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
850 else true; \
851 fi; \
852 done
853 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
854 do \
855 if test -x $$i; then \
856 $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
857 echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
858 else \
859 $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
860 echo $(INSTALL_DATA) $$i $(LIBDEST); \
861 fi; \
862 done
863 @for d in $(LIBSUBDIRS); \
864 do \
865 a=$(srcdir)/Lib/$$d; \
866 if test ! -d $$a; then continue; else true; fi; \
867 if test `ls $$a | wc -l` -lt 1; then continue; fi; \
868 b=$(LIBDEST)/$$d; \
869 for i in $$a/*; \
870 do \
871 case $$i in \
872 *CVS) ;; \
873 *.py[co]) ;; \
874 *.orig) ;; \
875 *~) ;; \
876 *) \
877 if test -d $$i; then continue; fi; \
878 if test -x $$i; then \
879 echo $(INSTALL_SCRIPT) $$i $$b; \
880 $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
881 else \
882 echo $(INSTALL_DATA) $$i $$b; \
883 $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
884 fi;; \
885 esac; \
886 done; \
887 done
888 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
889 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
890 ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
891 -d $(LIBDEST) -f \
892 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
893 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
894 ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
895 -d $(LIBDEST) -f \
896 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
897 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
898 ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
899 -d $(LIBDEST)/site-packages -f \
900 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
901 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
902 ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
903 -d $(LIBDEST)/site-packages -f \
904 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
905 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
906 ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
907
908# Create the PLATDIR source directory, if one wasn't distributed..
909$(srcdir)/Lib/$(PLATDIR):
910 mkdir $(srcdir)/Lib/$(PLATDIR)
911 cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
912 export PATH; PATH="`pwd`:$$PATH"; \
913 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
914 export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
915 export EXE; EXE="$(BUILDEXE)"; \
916 cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
917
918# Install the include files
919INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
920inclinstall:
921 @for i in $(INCLDIRSTOMAKE); \
922 do \
923 if test ! -d $(DESTDIR)$$i; then \
924 echo "Creating directory $$i"; \
925 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
926 else true; \
927 fi; \
928 done
929 @for i in $(srcdir)/Include/*.h; \
930 do \
931 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
932 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
933 done
934 $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
935
936# Install the library and miscellaneous stuff needed for extending/embedding
937# This goes into $(exec_prefix)
938LIBPL= $(LIBP)/config
939libainstall: all
940 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
941 do \
942 if test ! -d $(DESTDIR)$$i; then \
943 echo "Creating directory $$i"; \
944 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
945 else true; \
946 fi; \
947 done
948 @if test -d $(LIBRARY); then :; else \
949 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
950 if test "$(SO)" = .dll; then \
951 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
952 else \
953 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
954 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
955 fi; \
956 else \
957 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
958 fi; \
959 fi
960 $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
961 $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
962 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
963 $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
964 $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
965 $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
966 $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
967 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
968 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
969 # Substitution happens here, as the completely-expanded BINDIR
970 # is not available in configure
971 sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
972 $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
973 rm python-config
974 @if [ -s Modules/python.exp -a \
975 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
976 echo; echo "Installing support files for building shared extension modules on AIX:"; \
977 $(INSTALL_DATA) Modules/python.exp \
978 $(DESTDIR)$(LIBPL)/python.exp; \
979 echo; echo "$(LIBPL)/python.exp"; \
980 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
981 $(DESTDIR)$(LIBPL)/makexp_aix; \
982 echo "$(LIBPL)/makexp_aix"; \
983 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
984 $(DESTDIR)$(LIBPL)/ld_so_aix; \
985 echo "$(LIBPL)/ld_so_aix"; \
986 echo; echo "See Misc/AIX-NOTES for details."; \
987 else true; \
988 fi
989 @case "$(MACHDEP)" in beos*) \
990 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
991 $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README; \
992 echo; echo "$(LIBPL)/README"; \
993 $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
994 echo "$(LIBPL)/ar_beos"; \
995 $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
996 echo "$(LIBPL)/ld_so_beos"; \
997 echo; echo "See Misc/BeOS-NOTES for details."; \
998 ;; \
999 esac
1000
1001# Install the dynamically loadable modules
1002# This goes into $(exec_prefix)
1003sharedinstall:
1004 $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
1005 --prefix=$(prefix) \
1006 --install-scripts=$(BINDIR) \
1007 --install-platlib=$(DESTSHARED) \
1008 --root=/$(DESTDIR)
1009
1010# Here are a couple of targets for MacOSX again, to install a full
1011# framework-based Python. frameworkinstall installs everything, the
1012# subtargets install specific parts. Much of the actual work is offloaded to
1013# the Makefile in Mac
1014#
1015#
1016# This target is here for backward compatiblity, previous versions of Python
1017# hadn't integrated framework installation in the normal install process.
1018frameworkinstall: install
1019
1020# On install, we re-make the framework
1021# structure in the install location, /Library/Frameworks/ or the argument to
1022# --enable-framework. If --enable-framework has been specified then we have
1023# automatically set prefix to the location deep down in the framework, so we
1024# only have to cater for the structural bits of the framework.
1025
1026frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
1027
1028frameworkinstallstructure: $(LDLIBRARY)
1029 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
1030 echo Not configured with --enable-framework; \
1031 exit 1; \
1032 else true; \
1033 fi
1034 @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
1035 if test ! -d $(DESTDIR)$$i; then \
1036 echo "Creating directory $(DESTDIR)$$i"; \
1037 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1038 else true; \
1039 fi; \
1040 done
1041 $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
1042 sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
1043 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
1044 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
1045 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
1046 $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
1047 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
1048
1049# This installs Mac/Lib into the framework
1050# Install a number of symlinks to keep software that expects a normal unix
1051# install (which includes python-config) happy.
1052frameworkinstallmaclib:
1053 ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
1054 ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).dylib"
1055 cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)"
1056
1057# This installs the IDE, the Launcher and other apps into /Applications
1058frameworkinstallapps:
1059 cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
1060
1061frameworkinstallapps4way:
1062 cd Mac && $(MAKE) installapps4way DESTDIR="$(DESTDIR)"
1063
1064# This install the unix python and pythonw tools in /usr/local/bin
1065frameworkinstallunixtools:
1066 cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
1067
1068frameworkinstallunixtools4way:
1069 cd Mac && $(MAKE) installunixtools4way DESTDIR="$(DESTDIR)"
1070
1071frameworkaltinstallunixtools:
1072 cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
1073
1074frameworkaltinstallunixtools4way:
1075 cd Mac && $(MAKE) altinstallunixtools4way DESTDIR="$(DESTDIR)"
1076
1077# This installs the Demos and Tools into the applications directory.
1078# It is not part of a normal frameworkinstall
1079frameworkinstallextras:
1080 cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
1081
1082# This installs a few of the useful scripts in Tools/scripts
1083scriptsinstall:
1084 SRCDIR=$(srcdir) $(RUNSHARED) \
1085 ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
1086 --prefix=$(prefix) \
1087 --install-scripts=$(BINDIR) \
1088 --root=/$(DESTDIR)
1089
1090# Build the toplevel Makefile
1091Makefile.pre: Makefile.pre.in config.status
1092 CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
1093 $(MAKE) -f Makefile.pre Makefile
1094
1095# Run the configure script.
1096config.status: $(srcdir)/configure
1097 $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
1098
1099.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
1100
1101# Some make's put the object file in the current directory
1102.c.o:
1103 $(CC) -c $(PY_CFLAGS) -o $@ $<
1104
1105# Run reindent on the library
1106reindent:
1107 ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
1108
1109# Rerun configure with the same options as it was run last time,
1110# provided the config.status script exists
1111recheck:
1112 $(SHELL) config.status --recheck
1113 $(SHELL) config.status
1114
1115# Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
1116autoconf:
1117 (cd $(srcdir); autoconf)
1118 (cd $(srcdir); autoheader)
1119
1120# Create a tags file for vi
1121tags::
1122 cd $(srcdir); \
1123 ctags -w -t Include/*.h; \
1124 for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
1125 done; \
1126 sort -o tags tags
1127
1128# Create a tags file for GNU Emacs
1129TAGS::
1130 cd $(srcdir); \
1131 etags Include/*.h; \
1132 for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
1133
1134# Sanitation targets -- clean leaves libraries, executables and tags
1135# files, which clobber removes as well
1136pycremoval:
1137 find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
1138
1139clean: pycremoval
1140 find . -name '*.o' -exec rm -f {} ';'
1141 find . -name '*.s[ol]' -exec rm -f {} ';'
1142 find $(srcdir)/build -name 'fficonfig.h' -exec rm -f {} ';' || true
1143 find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
1144 -rm -f Lib/lib2to3/*Grammar*.pickle
1145
1146profile-removal:
1147 find . -name '*.gc??' -exec rm -f {} ';'
1148
1149clobber: clean profile-removal
1150 -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1151 tags TAGS \
1152 config.cache config.log pyconfig.h Modules/config.c
1153 -rm -rf build platform
1154 -rm -rf $(PYTHONFRAMEWORKDIR)
1155
1156# Make things extra clean, before making a distribution:
1157# remove all generated files, even Makefile[.pre]
1158# Keep configure and Python-ast.[ch], it's possible they can't be generated
1159distclean: clobber
1160 -rm -f core Makefile Makefile.pre config.status \
1161 Modules/Setup Modules/Setup.local Modules/Setup.config
1162 find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
1163 -o -name '[@,#]*' -o -name '*.old' \
1164 -o -name '*.orig' -o -name '*.rej' \
1165 -o -name '*.bak' ')' \
1166 -exec rm -f {} ';'
1167
1168# Check for smelly exported symbols (not starting with Py/_Py)
1169smelly: all
1170 nm -p $(LIBRARY) | \
1171 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1172
1173# Find files with funny names
1174funny:
1175 find $(DISTDIRS) -type d \
1176 -o -name '*.[chs]' \
1177 -o -name '*.py' \
1178 -o -name '*.doc' \
1179 -o -name '*.sty' \
1180 -o -name '*.bib' \
1181 -o -name '*.dat' \
1182 -o -name '*.el' \
1183 -o -name '*.fd' \
1184 -o -name '*.in' \
1185 -o -name '*.tex' \
1186 -o -name '*,[vpt]' \
1187 -o -name 'Setup' \
1188 -o -name 'Setup.*' \
1189 -o -name README \
1190 -o -name Makefile \
1191 -o -name ChangeLog \
1192 -o -name Repository \
1193 -o -name Root \
1194 -o -name Entries \
1195 -o -name Tag \
1196 -o -name tags \
1197 -o -name TAGS \
1198 -o -name .cvsignore \
1199 -o -name MANIFEST \
1200 -o -print
1201
1202# Perform some verification checks on any modified files.
1203patchcheck:
1204 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
1205
1206# Dependencies
1207
1208Python/thread.o: @THREADHEADERS@
1209
1210# Declare targets that aren't real files
1211.PHONY: all build_all sharedmods oldsharedmods test quicktest memtest
1212.PHONY: install altinstall oldsharedinstall bininstall altbininstall
1213.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1214.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1215.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1216.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
1217.PHONY: smelly funny patchcheck
1218
1219# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
Note: See TracBrowser for help on using the repository browser.