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