Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | # Generated automatically from Makefile.pre by makesetup. |
2 | # Top-level Makefile for Python | |
3 | # | |
4 | # As distributed, this file is called Makefile.pre.in; it is processed | |
5 | # into the real Makefile by running the script ./configure, which | |
6 | # replaces things like @spam@ with values appropriate for your system. | |
7 | # This means that if you edit Makefile, your changes get lost the next | |
8 | # time you run the configure script. Ideally, you can do: | |
9 | # | |
10 | # ./configure | |
11 | # make | |
12 | # make test | |
13 | # make install | |
14 | # | |
15 | # If you have a previous version of Python installed that you don't | |
16 | # want to overwrite, you can use "make altinstall" instead of "make | |
17 | # install". Refer to the "Installing" section in the README file for | |
18 | # additional details. | |
19 | # | |
20 | # See also the section "Build instructions" in the README file. | |
21 | ||
22 | # === Variables set by makesetup === | |
23 | ||
24 | MODOBJS= Modules/threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/zipimport.o Modules/symtablemodule.o Modules/xxsubtype.o Modules/readline.o Modules/pyexpat.o Modules/_tkinter.o Modules/tkappinit.o | |
25 | MODLIBS= $(LOCALMODLIBS) $(BASEMODLIBS) | |
26 | ||
27 | # === Variables set by configure | |
28 | VERSION= 2.4 | |
29 | srcdir= . | |
30 | ||
31 | ||
32 | CC= /usr/dist/share/sunstudio_i386/SUNWspro/bin/cc | |
33 | CXX= /usr/dist/share/sunstudio_i386/SUNWspro/bin/CC | |
34 | LINKCC= $(PURIFY) $(CC) | |
35 | AR= ar | |
36 | RANLIB= ranlib | |
37 | ||
38 | # Shell used by make (some versions default to the login shell, which is bad) | |
39 | SHELL= /bin/sh | |
40 | ||
41 | # Use this to make a link between python$(VERSION) and python in $(BINDIR) | |
42 | LN= ln | |
43 | ||
44 | # Portable install script (configure doesn't always guess right) | |
45 | INSTALL= ./install-sh -c | |
46 | INSTALL_PROGRAM=${INSTALL} | |
47 | INSTALL_SCRIPT= ${INSTALL} | |
48 | INSTALL_DATA= ${INSTALL} -m 644 | |
49 | # Shared libraries must be installed with executable mode on some systems; | |
50 | # rather than figuring out exactly which, we always give them executable mode. | |
51 | # Also, making them read-only seems to be a good idea... | |
52 | INSTALL_SHARED= ${INSTALL} -m 555 | |
53 | ||
54 | MAKESETUP= $(srcdir)/Modules/makesetup | |
55 | ||
56 | # Compiler options | |
57 | OPT= -DNDEBUG -DNDEBUG -xO4 -xarch=amd64 -Kpic -mt | |
58 | BASECFLAGS= -I/import/archperf/ws/devtools/4/amd64/include | |
59 | CFLAGS= $(BASECFLAGS) $(OPT) | |
60 | CPPFLAGS= -I. -I$(srcdir)/Include | |
61 | LDFLAGS=-R/import/archperf/ws/devtools/4/amd64/lib -xarch=amd64 -Kpic -L/import/archperf/ws/devtools/4/amd64/lib | |
62 | LDLAST= | |
63 | SGI_ABI= | |
64 | CCSHARED= | |
65 | LINKFORSHARED= | |
66 | # Extra C flags added for building the interpreter object files. | |
67 | CFLAGSFORSHARED=$(CCSHARED) | |
68 | # C flags used for building the interpreter object files | |
69 | PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE | |
70 | ||
71 | ||
72 | # Machine-dependent subdirectories | |
73 | MACHDEP= sunos5 | |
74 | ||
75 | # Install prefix for architecture-independent files | |
76 | prefix= /import/archperf/ws/devtools/4/amd64 | |
77 | ||
78 | # Install prefix for architecture-dependent files | |
79 | exec_prefix= ${prefix} | |
80 | ||
81 | # Expanded directories | |
82 | BINDIR= $(exec_prefix)/bin | |
83 | LIBDIR= $(exec_prefix)/lib | |
84 | MANDIR= ${prefix}/man | |
85 | INCLUDEDIR= ${prefix}/include | |
86 | CONFINCLUDEDIR= $(exec_prefix)/include | |
87 | SCRIPTDIR= $(prefix)/lib | |
88 | ||
89 | # Detailed destination directories | |
90 | BINLIBDEST= $(LIBDIR)/python$(VERSION) | |
91 | LIBDEST= $(SCRIPTDIR)/python$(VERSION) | |
92 | INCLUDEPY= $(INCLUDEDIR)/python$(VERSION) | |
93 | CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION) | |
94 | LIBP= $(LIBDIR)/python$(VERSION) | |
95 | ||
96 | # Symbols used for using shared libraries | |
97 | SO= .so | |
98 | LDSHARED= /usr/dist/share/sunstudio_i386/SUNWspro/bin/cc -G -xarch=amd64 -Kpic -L/import/archperf/ws/devtools/4/amd64/lib | |
99 | BLDSHARED= /usr/dist/share/sunstudio_i386/SUNWspro/bin/cc -G -xarch=amd64 -Kpic -L/import/archperf/ws/devtools/4/amd64/lib | |
100 | DESTSHARED= $(BINLIBDEST)/lib-dynload | |
101 | ||
102 | # Executable suffix (.exe on Windows and Mac OS X) | |
103 | EXE= | |
104 | BUILDEXE= | |
105 | ||
106 | # Short name and location for Mac OS X Python framework | |
107 | PYTHONFRAMEWORK= | |
108 | PYTHONFRAMEWORKDIR= no-framework | |
109 | PYTHONFRAMEWORKPREFIX= | |
110 | PYTHONFRAMEWORKINSTALLDIR= | |
111 | # Deployment target selected during configure, to be checked | |
112 | # by distutils | |
113 | CONFIGURE_MACOSX_DEPLOYMENT_TARGET= | |
114 | # Options to enable prebinding (for fast startup prior to Mac OS X 10.3) | |
115 | OTHER_LIBTOOL_OPT= | |
116 | ||
117 | # Environment to run shared python without installed libraries | |
118 | RUNSHARED= LD_LIBRARY_PATH=/import/archperf/ws/devtools/Python-2.4.2: | |
119 | ||
120 | # Modes for directories, executables and data files created by the | |
121 | # install process. Default to user-only-writable for all file types. | |
122 | DIRMODE= 755 | |
123 | EXEMODE= 755 | |
124 | FILEMODE= 644 | |
125 | ||
126 | # configure script arguments | |
127 | CONFIG_ARGS= '--prefix=/import/archperf/ws/devtools/4/amd64' '--enable-shared' 'CC=/usr/dist/share/sunstudio_i386/SUNWspro/bin/cc' 'CFLAGS=-xarch=amd64 -Kpic' | |
128 | ||
129 | ||
130 | # Subdirectories with code | |
131 | SRCDIRS= Parser Grammar Objects Python Modules Mac Mac/Python | |
132 | ||
133 | # Other subdirectories | |
134 | SUBDIRSTOO= Include Lib Misc Demo | |
135 | ||
136 | # Files and directories to be distributed | |
137 | CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in | |
138 | DISTFILES= README ChangeLog $(CONFIGFILES) | |
139 | DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy | |
140 | DIST= $(DISTFILES) $(DISTDIRS) | |
141 | ||
142 | ||
143 | LIBRARY= libpython$(VERSION).a | |
144 | LDLIBRARY= libpython$(VERSION).so | |
145 | BLDLIBRARY= -Wl,-R,$(LIBDIR) -L. -lpython$(VERSION) | |
146 | DLLLIBRARY= | |
147 | LDLIBRARYDIR= | |
148 | INSTSONAME= libpython$(VERSION).so.1.0 | |
149 | ||
150 | ||
151 | LIBS= -lresolv -lsocket -lnsl -lrt -ldl | |
152 | LIBM= -lm | |
153 | LIBC= | |
154 | SYSLIBS= $(LIBM) $(LIBC) | |
155 | SHLIBS= $(LIBS) | |
156 | ||
157 | MAINOBJ= python.o | |
158 | THREADOBJ= Python/thread.o | |
159 | DLINCLDIR= . | |
160 | DYNLOADFILE= dynload_shlib.o | |
161 | MACHDEP_OBJS= | |
162 | UNICODE_OBJS= Objects/unicodeobject.o Objects/unicodectype.o | |
163 | ||
164 | PYTHON= python$(EXE) | |
165 | BUILDPYTHON= python$(BUILDEXE) | |
166 | ||
167 | # === Definitions added by makesetup === | |
168 | ||
169 | LOCALMODLIBS= -lreadline -ltermcap -lexpat -L/import/archperf/ws/devtools/4/64/lib -ltk8.4 -ltcl8.4 -lX11 | |
170 | BASEMODLIBS= | |
171 | GLHACK=-Dclear=__GLclear | |
172 | PYTHONPATH=$(COREPYTHONPATH) | |
173 | COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(EXTRAMACHDEPPATH)$(TKPATH) | |
174 | TKPATH=:lib-tk | |
175 | EXTRAMACHDEPPATH= | |
176 | MACHDEPPATH=:plat-$(MACHDEP) | |
177 | TESTPATH= | |
178 | SITEPATH= | |
179 | DESTPATH= | |
180 | MACHDESTLIB=$(BINLIBDEST) | |
181 | DESTLIB=$(LIBDEST) | |
182 | ||
183 | ||
184 | ||
185 | ########################################################################## | |
186 | # Modules | |
187 | MODULE_OBJS= \ | |
188 | Modules/config.o \ | |
189 | Modules/getpath.o \ | |
190 | Modules/main.o \ | |
191 | Modules/gcmodule.o | |
192 | ||
193 | # Used of signalmodule.o is not available | |
194 | SIGNAL_OBJS= | |
195 | ||
196 | ||
197 | ########################################################################## | |
198 | # Grammar | |
199 | GRAMMAR_H= $(srcdir)/Include/graminit.h | |
200 | GRAMMAR_C= $(srcdir)/Python/graminit.c | |
201 | GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar | |
202 | ||
203 | ||
204 | ########################################################################## | |
205 | # Parser | |
206 | PGEN= Parser/pgen$(EXE) | |
207 | ||
208 | POBJS= \ | |
209 | Parser/acceler.o \ | |
210 | Parser/grammar1.o \ | |
211 | Parser/listnode.o \ | |
212 | Parser/node.o \ | |
213 | Parser/parser.o \ | |
214 | Parser/parsetok.o \ | |
215 | Parser/bitset.o \ | |
216 | Parser/metagrammar.o \ | |
217 | Parser/firstsets.o \ | |
218 | Parser/grammar.o \ | |
219 | Parser/pgen.o | |
220 | ||
221 | PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o | |
222 | ||
223 | PGOBJS= \ | |
224 | Objects/obmalloc.o \ | |
225 | Python/mysnprintf.o \ | |
226 | Parser/tokenizer_pgen.o \ | |
227 | Parser/printgrammar.o \ | |
228 | Parser/pgenmain.o | |
229 | ||
230 | PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS) | |
231 | ||
232 | ||
233 | ########################################################################## | |
234 | # Python | |
235 | PYTHON_OBJS= \ | |
236 | Python/bltinmodule.o \ | |
237 | Python/exceptions.o \ | |
238 | Python/ceval.o \ | |
239 | Python/compile.o \ | |
240 | Python/codecs.o \ | |
241 | Python/errors.o \ | |
242 | Python/frozen.o \ | |
243 | Python/frozenmain.o \ | |
244 | Python/future.o \ | |
245 | Python/getargs.o \ | |
246 | Python/getcompiler.o \ | |
247 | Python/getcopyright.o \ | |
248 | Python/getmtime.o \ | |
249 | Python/getplatform.o \ | |
250 | Python/getversion.o \ | |
251 | Python/graminit.o \ | |
252 | Python/import.o \ | |
253 | Python/importdl.o \ | |
254 | Python/marshal.o \ | |
255 | Python/modsupport.o \ | |
256 | Python/mystrtoul.o \ | |
257 | Python/mysnprintf.o \ | |
258 | Python/pyfpe.o \ | |
259 | Python/pystate.o \ | |
260 | Python/pythonrun.o \ | |
261 | Python/structmember.o \ | |
262 | Python/symtable.o \ | |
263 | Python/sysmodule.o \ | |
264 | Python/traceback.o \ | |
265 | Python/getopt.o \ | |
266 | Python/pystrtod.o \ | |
267 | Python/$(DYNLOADFILE) \ | |
268 | $(MACHDEP_OBJS) \ | |
269 | $(THREADOBJ) | |
270 | ||
271 | ||
272 | ########################################################################## | |
273 | # Objects | |
274 | OBJECT_OBJS= \ | |
275 | Objects/abstract.o \ | |
276 | Objects/boolobject.o \ | |
277 | Objects/bufferobject.o \ | |
278 | Objects/cellobject.o \ | |
279 | Objects/classobject.o \ | |
280 | Objects/cobject.o \ | |
281 | Objects/complexobject.o \ | |
282 | Objects/descrobject.o \ | |
283 | Objects/enumobject.o \ | |
284 | Objects/genobject.o \ | |
285 | Objects/fileobject.o \ | |
286 | Objects/floatobject.o \ | |
287 | Objects/frameobject.o \ | |
288 | Objects/funcobject.o \ | |
289 | Objects/intobject.o \ | |
290 | Objects/iterobject.o \ | |
291 | Objects/listobject.o \ | |
292 | Objects/longobject.o \ | |
293 | Objects/dictobject.o \ | |
294 | Objects/methodobject.o \ | |
295 | Objects/moduleobject.o \ | |
296 | Objects/object.o \ | |
297 | Objects/obmalloc.o \ | |
298 | Objects/rangeobject.o \ | |
299 | Objects/setobject.o \ | |
300 | Objects/sliceobject.o \ | |
301 | Objects/stringobject.o \ | |
302 | Objects/structseq.o \ | |
303 | Objects/tupleobject.o \ | |
304 | Objects/typeobject.o \ | |
305 | Objects/weakrefobject.o \ | |
306 | $(UNICODE_OBJS) | |
307 | ||
308 | ||
309 | ########################################################################## | |
310 | # objects that get linked into the Python library | |
311 | LIBRARY_OBJS= \ | |
312 | Modules/getbuildinfo.o \ | |
313 | $(PARSER_OBJS) \ | |
314 | $(OBJECT_OBJS) \ | |
315 | $(PYTHON_OBJS) \ | |
316 | $(MODULE_OBJS) \ | |
317 | $(SIGNAL_OBJS) \ | |
318 | $(MODOBJS) | |
319 | ||
320 | ######################################################################### | |
321 | # Rules | |
322 | ||
323 | # Default target | |
324 | all: $(BUILDPYTHON) oldsharedmods sharedmods | |
325 | ||
326 | # Build the interpreter | |
327 | $(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY) | |
328 | $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ | |
329 | Modules/$(MAINOBJ) \ | |
330 | $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) | |
331 | ||
332 | platform: $(BUILDPYTHON) | |
333 | $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform | |
334 | ||
335 | ||
336 | # Build the shared modules | |
337 | sharedmods: $(BUILDPYTHON) | |
338 | case $$MAKEFLAGS in \ | |
339 | *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ | |
340 | *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ | |
341 | esac | |
342 | ||
343 | # buildno should really depend on something like LIBRARY_SRC | |
344 | buildno: $(PARSER_OBJS) \ | |
345 | $(OBJECT_OBJS) \ | |
346 | $(PYTHON_OBJS) \ | |
347 | $(MODULE_OBJS) \ | |
348 | $(SIGNAL_OBJS) \ | |
349 | $(MODOBJS) \ | |
350 | $(srcdir)/Modules/getbuildinfo.c | |
351 | if test -f buildno; then \ | |
352 | expr `cat buildno` + 1 >buildno1; \ | |
353 | mv -f buildno1 buildno; \ | |
354 | else echo 1 >buildno; fi | |
355 | ||
356 | # Build static library | |
357 | # avoid long command lines, same as LIBRARY_OBJS | |
358 | $(LIBRARY): $(LIBRARY_OBJS) | |
359 | -rm -f $@ | |
360 | $(AR) cr $@ Modules/getbuildinfo.o | |
361 | $(AR) cr $@ $(PARSER_OBJS) | |
362 | $(AR) cr $@ $(OBJECT_OBJS) | |
363 | $(AR) cr $@ $(PYTHON_OBJS) | |
364 | $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS) | |
365 | $(AR) cr $@ $(MODOBJS) | |
366 | $(RANLIB) $@ | |
367 | ||
368 | libpython$(VERSION).so: $(LIBRARY_OBJS) | |
369 | if test $(INSTSONAME) != $(LDLIBRARY); then \ | |
370 | $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ | |
371 | $(LN) -f $(INSTSONAME) $@; \ | |
372 | else\ | |
373 | $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ | |
374 | fi | |
375 | ||
376 | libpython$(VERSION).sl: $(LIBRARY_OBJS) | |
377 | $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM) | |
378 | ||
379 | # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary | |
380 | # minimal framework (not including the Lib directory and such) in the current | |
381 | # directory. | |
382 | RESSRCDIR=$(srcdir)/Mac/OSXResources/framework | |
383 | $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \ | |
384 | $(LIBRARY) \ | |
385 | $(RESSRCDIR)/Info.plist \ | |
386 | $(RESSRCDIR)/version.plist \ | |
387 | $(RESSRCDIR)/English.lproj/InfoPlist.strings | |
388 | $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION) | |
389 | libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \ | |
390 | ||
391 | $(INSTALL) -d -m $(DIRMODE) \ | |
392 | $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj | |
393 | $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \ | |
394 | $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist | |
395 | $(INSTALL_DATA) $(RESSRCDIR)/version.plist \ | |
396 | $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/version.plist | |
397 | $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ | |
398 | $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj/InfoPlist.strings | |
399 | $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current | |
400 | $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK) | |
401 | $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers | |
402 | $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources | |
403 | ||
404 | # This rule builds the Cygwin Python DLL and import library if configured | |
405 | # for a shared core library; otherwise, this rule is a noop. | |
406 | $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS) | |
407 | if test -n "$(DLLLIBRARY)"; then \ | |
408 | $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ | |
409 | $(LIBS) $(MODLIBS) $(SYSLIBS); \ | |
410 | else true; \ | |
411 | fi | |
412 | ||
413 | ||
414 | oldsharedmods: $(SHAREDMODS) | |
415 | ||
416 | ||
417 | Makefile Modules/config.c: Makefile.pre \ | |
418 | $(srcdir)/Modules/config.c.in \ | |
419 | $(MAKESETUP) \ | |
420 | Modules/Setup.config \ | |
421 | Modules/Setup \ | |
422 | Modules/Setup.local | |
423 | $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \ | |
424 | -s Modules \ | |
425 | Modules/Setup.config \ | |
426 | Modules/Setup.local \ | |
427 | Modules/Setup | |
428 | @mv config.c Modules | |
429 | @echo "The Makefile was updated, you may need to re-run make." | |
430 | ||
431 | ||
432 | Modules/Setup: $(srcdir)/Modules/Setup.dist | |
433 | @if test -f Modules/Setup; then \ | |
434 | echo "-----------------------------------------------"; \ | |
435 | echo "Modules/Setup.dist is newer than Modules/Setup;"; \ | |
436 | echo "check to make sure you have all the updates you"; \ | |
437 | echo "need in your Modules/Setup file."; \ | |
438 | echo "Usually, copying Setup.dist to Setup will work."; \ | |
439 | echo "-----------------------------------------------"; \ | |
440 | fi | |
441 | ||
442 | ############################################################################ | |
443 | # Special rules for object files | |
444 | ||
445 | Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno | |
446 | $(CC) -c $(PY_CFLAGS) -DBUILD=`cat buildno` -o $@ $(srcdir)/Modules/getbuildinfo.c | |
447 | ||
448 | Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile | |
449 | $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ | |
450 | -DPREFIX='"$(prefix)"' \ | |
451 | -DEXEC_PREFIX='"$(exec_prefix)"' \ | |
452 | -DVERSION='"$(VERSION)"' \ | |
453 | -DVPATH='"$(VPATH)"' \ | |
454 | -o $@ $(srcdir)/Modules/getpath.c | |
455 | ||
456 | Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc | |
457 | $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc | |
458 | ||
459 | ||
460 | $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) | |
461 | -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | |
462 | ||
463 | $(PGEN): $(PGENOBJS) | |
464 | $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) | |
465 | ||
466 | Parser/grammar.o: $(srcdir)/Parser/grammar.c \ | |
467 | $(srcdir)/Include/token.h \ | |
468 | $(srcdir)/Include/grammar.h | |
469 | Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c | |
470 | ||
471 | Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c | |
472 | ||
473 | ||
474 | Python/compile.o Python/symtable.o: $(GRAMMAR_H) | |
475 | ||
476 | Python/getplatform.o: $(srcdir)/Python/getplatform.c | |
477 | $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c | |
478 | ||
479 | Python/importdl.o: $(srcdir)/Python/importdl.c | |
480 | $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c | |
481 | ||
482 | Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \ | |
483 | $(srcdir)/Objects/unicodetype_db.h | |
484 | ||
485 | ############################################################################ | |
486 | # Header files | |
487 | ||
488 | PYTHON_HEADERS= \ | |
489 | Include/Python.h \ | |
490 | Include/abstract.h \ | |
491 | Include/boolobject.h \ | |
492 | Include/bufferobject.h \ | |
493 | Include/ceval.h \ | |
494 | Include/classobject.h \ | |
495 | Include/cobject.h \ | |
496 | Include/codecs.h \ | |
497 | Include/compile.h \ | |
498 | Include/complexobject.h \ | |
499 | Include/descrobject.h \ | |
500 | Include/dictobject.h \ | |
501 | Include/enumobject.h \ | |
502 | Include/genobject.h \ | |
503 | Include/fileobject.h \ | |
504 | Include/floatobject.h \ | |
505 | Include/funcobject.h \ | |
506 | Include/import.h \ | |
507 | Include/intobject.h \ | |
508 | Include/intrcheck.h \ | |
509 | Include/iterobject.h \ | |
510 | Include/listobject.h \ | |
511 | Include/longobject.h \ | |
512 | Include/methodobject.h \ | |
513 | Include/modsupport.h \ | |
514 | Include/moduleobject.h \ | |
515 | Include/object.h \ | |
516 | Include/objimpl.h \ | |
517 | Include/patchlevel.h \ | |
518 | Include/pydebug.h \ | |
519 | Include/pyerrors.h \ | |
520 | Include/pyfpe.h \ | |
521 | Include/pymem.h \ | |
522 | Include/pyport.h \ | |
523 | Include/pystate.h \ | |
524 | Include/pythonrun.h \ | |
525 | Include/rangeobject.h \ | |
526 | Include/setobject.h \ | |
527 | Include/sliceobject.h \ | |
528 | Include/stringobject.h \ | |
529 | Include/structseq.h \ | |
530 | Include/structmember.h \ | |
531 | Include/symtable.h \ | |
532 | Include/sysmodule.h \ | |
533 | Include/traceback.h \ | |
534 | Include/tupleobject.h \ | |
535 | Include/unicodeobject.h \ | |
536 | Include/weakrefobject.h \ | |
537 | pyconfig.h | |
538 | ||
539 | $(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS) | |
540 | ||
541 | ||
542 | ###################################################################### | |
543 | ||
544 | # Test the interpreter (twice, once without .pyc files, once with) | |
545 | # In the past, we've had problems where bugs in the marshalling or | |
546 | # elsewhere caused bytecode read from .pyc files to behave differently | |
547 | # than bytecode generated directly from a .py source file. Sometimes | |
548 | # the bytecode read from a .pyc file had the bug, somtimes the directly | |
549 | # generated bytecode. This is sometimes a very shy bug needing a lot of | |
550 | # sample data. | |
551 | ||
552 | TESTOPTS= -l | |
553 | TESTPROG= $(srcdir)/Lib/test/regrtest.py | |
554 | TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt | |
555 | test: all platform | |
556 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f | |
557 | -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) | |
558 | $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) | |
559 | ||
560 | testall: all platform | |
561 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f | |
562 | -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall | |
563 | $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall | |
564 | ||
565 | QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \ | |
566 | test_unicodedata test_re test_sre test_select test_poll \ | |
567 | test_linuxaudiodev test_struct test_sunaudiodev test_zlib | |
568 | quicktest: all platform | |
569 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f | |
570 | -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS) | |
571 | $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS) | |
572 | ||
573 | MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \ | |
574 | test_longexp | |
575 | memtest: all platform | |
576 | -rm -f $(srcdir)/Lib/test/*.py[co] | |
577 | -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) | |
578 | $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) | |
579 | ||
580 | # Install everything | |
581 | install: altinstall bininstall maninstall | |
582 | ||
583 | # Install almost everything without disturbing previous versions | |
584 | altinstall: altbininstall libinstall inclinstall libainstall \ | |
585 | sharedinstall oldsharedinstall | |
586 | ||
587 | # Install shared libraries enabled by Setup | |
588 | DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) | |
589 | ||
590 | oldsharedinstall: $(DESTSHARED) $(SHAREDMODS) | |
591 | @for i in X $(SHAREDMODS); do \ | |
592 | if test $$i != X; then \ | |
593 | echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \ | |
594 | $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \ | |
595 | fi; \ | |
596 | done | |
597 | ||
598 | $(DESTSHARED): | |
599 | @for i in $(DESTDIRS); \ | |
600 | do \ | |
601 | if test ! -d $(DESTDIR)$$i; then \ | |
602 | echo "Creating directory $$i"; \ | |
603 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ | |
604 | else true; \ | |
605 | fi; \ | |
606 | done | |
607 | ||
608 | ||
609 | # Install the interpreter (by creating a hard link to python$(VERSION)) | |
610 | bininstall: altbininstall | |
611 | -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \ | |
612 | then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \ | |
613 | else true; \ | |
614 | fi | |
615 | (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)) | |
616 | ||
617 | # Install the interpreter with $(VERSION) affixed | |
618 | # This goes into $(exec_prefix) | |
619 | altbininstall: $(BUILDPYTHON) | |
620 | @if test "$(PYTHONFRAMEWORKDIR)" != no-framework; then \ | |
621 | if test ! -f $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current/Resources/Info.plist; then \ | |
622 | echo 'Framework build: use "make frameworkinstall" in stead of "make install"'; \ | |
623 | exit 1; \ | |
624 | fi; \ | |
625 | fi | |
626 | @for i in $(BINDIR) $(LIBDIR); \ | |
627 | do \ | |
628 | if test ! -d $(DESTDIR)$$i; then \ | |
629 | echo "Creating directory $$i"; \ | |
630 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ | |
631 | else true; \ | |
632 | fi; \ | |
633 | done | |
634 | $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) | |
635 | if test -f libpython$(VERSION)$(SO); then \ | |
636 | if test "$(SO)" = .dll; then \ | |
637 | $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \ | |
638 | else \ | |
639 | $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ | |
640 | if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \ | |
641 | (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \ | |
642 | fi \ | |
643 | fi; \ | |
644 | else true; \ | |
645 | fi | |
646 | ||
647 | # Install the manual page | |
648 | maninstall: | |
649 | @for i in $(MANDIR) $(MANDIR)/man1; \ | |
650 | do \ | |
651 | if test ! -d $(DESTDIR)$$i; then \ | |
652 | echo "Creating directory $$i"; \ | |
653 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ | |
654 | else true; \ | |
655 | fi; \ | |
656 | done | |
657 | $(INSTALL_DATA) $(srcdir)/Misc/python.man \ | |
658 | $(DESTDIR)$(MANDIR)/man1/python.1 | |
659 | ||
660 | # Install the library | |
661 | PLATDIR= plat-$(MACHDEP) | |
662 | EXTRAPLATDIR= | |
663 | EXTRAMACHDEPPATH= | |
664 | MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR) | |
665 | XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax | |
666 | PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \ | |
667 | plat-mac/lib-scriptpackages/_builtinSuites \ | |
668 | plat-mac/lib-scriptpackages/CodeWarrior \ | |
669 | plat-mac/lib-scriptpackages/Explorer \ | |
670 | plat-mac/lib-scriptpackages/Finder \ | |
671 | plat-mac/lib-scriptpackages/Netscape \ | |
672 | plat-mac/lib-scriptpackages/StdSuites \ | |
673 | plat-mac/lib-scriptpackages/SystemEvents \ | |
674 | plat-mac/lib-scriptpackages/Terminal | |
675 | PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages | |
676 | LIBSUBDIRS= lib-old lib-tk site-packages test test/output test/data \ | |
677 | test/decimaltestdata \ | |
678 | encodings email email/test email/test/data compiler hotshot \ | |
679 | logging bsddb bsddb/test csv idlelib idlelib/Icons \ | |
680 | distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ | |
681 | curses $(MACHDEPS) | |
682 | libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR) | |
683 | @for i in $(SCRIPTDIR) $(LIBDEST); \ | |
684 | do \ | |
685 | if test ! -d $(DESTDIR)$$i; then \ | |
686 | echo "Creating directory $$i"; \ | |
687 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ | |
688 | else true; \ | |
689 | fi; \ | |
690 | done | |
691 | @for d in $(LIBSUBDIRS); \ | |
692 | do \ | |
693 | a=$(srcdir)/Lib/$$d; \ | |
694 | if test ! -d $$a; then continue; else true; fi; \ | |
695 | b=$(LIBDEST)/$$d; \ | |
696 | if test ! -d $(DESTDIR)$$b; then \ | |
697 | echo "Creating directory $$b"; \ | |
698 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \ | |
699 | else true; \ | |
700 | fi; \ | |
701 | done | |
702 | @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \ | |
703 | do \ | |
704 | if test -x $$i; then \ | |
705 | $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \ | |
706 | echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \ | |
707 | else \ | |
708 | $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \ | |
709 | echo $(INSTALL_DATA) $$i $(LIBDEST); \ | |
710 | fi; \ | |
711 | done | |
712 | @for d in $(LIBSUBDIRS); \ | |
713 | do \ | |
714 | a=$(srcdir)/Lib/$$d; \ | |
715 | if test ! -d $$a; then continue; else true; fi; \ | |
716 | b=$(LIBDEST)/$$d; \ | |
717 | for i in $$a/*; \ | |
718 | do \ | |
719 | case $$i in \ | |
720 | *CVS) ;; \ | |
721 | *.py[co]) ;; \ | |
722 | *.orig) ;; \ | |
723 | *~) ;; \ | |
724 | *) \ | |
725 | if test -d $$i; then continue; fi; \ | |
726 | if test -x $$i; then \ | |
727 | echo $(INSTALL_SCRIPT) $$i $$b; \ | |
728 | $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \ | |
729 | else \ | |
730 | echo $(INSTALL_DATA) $$i $$b; \ | |
731 | $(INSTALL_DATA) $$i $(DESTDIR)$$b; \ | |
732 | fi;; \ | |
733 | esac; \ | |
734 | done; \ | |
735 | done | |
736 | $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt | |
737 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | |
738 | ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ | |
739 | -d $(LIBDEST) -f \ | |
740 | -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST) | |
741 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | |
742 | ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ | |
743 | -d $(LIBDEST) -f \ | |
744 | -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST) | |
745 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | |
746 | ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ | |
747 | -d $(LIBDEST)/site-packages -f \ | |
748 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages | |
749 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | |
750 | ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ | |
751 | -d $(LIBDEST)/site-packages -f \ | |
752 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages | |
753 | ||
754 | # Create the PLATDIR source directory, if one wasn't distributed.. | |
755 | $(srcdir)/Lib/$(PLATDIR): | |
756 | mkdir $(srcdir)/Lib/$(PLATDIR) | |
757 | cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen | |
758 | export PATH; PATH="`pwd`:$$PATH"; \ | |
759 | export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ | |
760 | export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ | |
761 | export EXE; EXE="$(BUILDEXE)"; \ | |
762 | cd $(srcdir)/Lib/$(PLATDIR); ./regen | |
763 | ||
764 | # Install the include files | |
765 | INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) | |
766 | inclinstall: | |
767 | @for i in $(INCLDIRSTOMAKE); \ | |
768 | do \ | |
769 | if test ! -d $(DESTDIR)$$i; then \ | |
770 | echo "Creating directory $$i"; \ | |
771 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ | |
772 | else true; \ | |
773 | fi; \ | |
774 | done | |
775 | @for i in $(srcdir)/Include/*.h; \ | |
776 | do \ | |
777 | echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ | |
778 | $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \ | |
779 | done | |
780 | $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h | |
781 | ||
782 | # Install the library and miscellaneous stuff needed for extending/embedding | |
783 | # This goes into $(exec_prefix) | |
784 | LIBPL= $(LIBP)/config | |
785 | libainstall: all | |
786 | @for i in $(LIBDIR) $(LIBP) $(LIBPL); \ | |
787 | do \ | |
788 | if test ! -d $(DESTDIR)$$i; then \ | |
789 | echo "Creating directory $$i"; \ | |
790 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ | |
791 | else true; \ | |
792 | fi; \ | |
793 | done | |
794 | @if test -d $(LIBRARY); then :; else \ | |
795 | if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ | |
796 | if test "$(SO)" = .dll; then \ | |
797 | $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ | |
798 | else \ | |
799 | $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ | |
800 | $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ | |
801 | fi; \ | |
802 | else \ | |
803 | echo Skip install of $(LIBRARY) - use make frameworkinstall; \ | |
804 | fi; \ | |
805 | fi | |
806 | $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c | |
807 | $(INSTALL_DATA) Modules/$(MAINOBJ) $(DESTDIR)$(LIBPL)/$(MAINOBJ) | |
808 | $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in | |
809 | $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile | |
810 | $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup | |
811 | $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local | |
812 | $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config | |
813 | $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup | |
814 | $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh | |
815 | @if [ -s Modules/python.exp -a \ | |
816 | "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \ | |
817 | echo; echo "Installing support files for building shared extension modules on AIX:"; \ | |
818 | $(INSTALL_DATA) Modules/python.exp \ | |
819 | $(DESTDIR)$(LIBPL)/python.exp; \ | |
820 | echo; echo "$(LIBPL)/python.exp"; \ | |
821 | $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \ | |
822 | $(DESTDIR)$(LIBPL)/makexp_aix; \ | |
823 | echo "$(LIBPL)/makexp_aix"; \ | |
824 | $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \ | |
825 | $(DESTDIR)$(LIBPL)/ld_so_aix; \ | |
826 | echo "$(LIBPL)/ld_so_aix"; \ | |
827 | echo; echo "See Misc/AIX-NOTES for details."; \ | |
828 | else true; \ | |
829 | fi | |
830 | @case "$(MACHDEP)" in beos*) \ | |
831 | echo; echo "Installing support files for building shared extension modules on BeOS:"; \ | |
832 | $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README; \ | |
833 | echo; echo "$(LIBPL)/README"; \ | |
834 | $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \ | |
835 | echo "$(LIBPL)/ar_beos"; \ | |
836 | $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \ | |
837 | echo "$(LIBPL)/ld_so_beos"; \ | |
838 | echo; echo "See Misc/BeOS-NOTES for details."; \ | |
839 | ;; \ | |
840 | esac | |
841 | ||
842 | # Install the dynamically loadable modules | |
843 | # This goes into $(exec_prefix) | |
844 | sharedinstall: | |
845 | $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ | |
846 | --prefix=$(prefix) \ | |
847 | --install-scripts=$(BINDIR) \ | |
848 | --install-platlib=$(DESTSHARED) \ | |
849 | --root=/$(DESTDIR) | |
850 | ||
851 | # Here are a couple of targets for MacOSX again, to install a full | |
852 | # framework-based Python. frameworkinstall installs everything, the | |
853 | # subtargets install specific parts. Much of the actual work is offloaded to | |
854 | # the Makefile in Mac/OSX | |
855 | # | |
856 | frameworkinstall: frameworkinstallframework \ | |
857 | frameworkinstallapps frameworkinstallunixtools | |
858 | ||
859 | # On install, we re-make the framework | |
860 | # structure in the install location, /Library/Frameworks/ or the argument to | |
861 | # --enable-framework. If --enable-framework has been specified then we have | |
862 | # automatically set prefix to the location deep down in the framework, so we | |
863 | # only have to cater for the structural bits of the framework. | |
864 | ||
865 | frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib | |
866 | ||
867 | frameworkinstallstructure: $(LDLIBRARY) | |
868 | @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ | |
869 | echo Not configured with --enable-framework; \ | |
870 | exit 1; \ | |
871 | else true; \ | |
872 | fi | |
873 | @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\ | |
874 | if test ! -d $(DESTDIR)$$i; then \ | |
875 | echo "Creating directory $(DESTDIR)$$i"; \ | |
876 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ | |
877 | else true; \ | |
878 | fi; \ | |
879 | done | |
880 | $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers | |
881 | $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist | |
882 | $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist | |
883 | $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ | |
884 | $(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings | |
885 | $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current | |
886 | $(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python | |
887 | $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers | |
888 | $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources | |
889 | $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) | |
890 | ||
891 | # This installs Mac/Lib into the framework | |
892 | frameworkinstallmaclib: | |
893 | $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installmacsubtree \ | |
894 | $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \ | |
895 | srcdir=$(srcdir) builddir=. prefix=$(prefix) LIBDEST=$(LIBDEST) \ | |
896 | DESTDIR=$(DESTDIR) | |
897 | ||
898 | # This installs the IDE, the Launcher and other apps into /Applications | |
899 | frameworkinstallapps: | |
900 | $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installapps \ | |
901 | $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \ | |
902 | srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix) | |
903 | ||
904 | # This install the unix python and pythonw tools in /usr/local/bin | |
905 | frameworkinstallunixtools: | |
906 | $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installunixtools \ | |
907 | DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \ | |
908 | srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix) | |
909 | ||
910 | # This installs the Demos and Tools into the applications directory. | |
911 | # It is not part of a normal frameworkinstall | |
912 | frameworkinstallextras: | |
913 | $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installextras \ | |
914 | $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \ | |
915 | srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) | |
916 | ||
917 | # This installs a few of the useful scripts in Tools/scripts | |
918 | scriptsinstall: | |
919 | SRCDIR=$(srcdir) $(RUNSHARED) \ | |
920 | ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \ | |
921 | --prefix=$(prefix) \ | |
922 | --install-scripts=$(BINDIR) \ | |
923 | --root=/$(DESTDIR) | |
924 | ||
925 | # Build the toplevel Makefile | |
926 | Makefile.pre: Makefile.pre.in config.status | |
927 | CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status | |
928 | $(MAKE) -f Makefile.pre Makefile | |
929 | ||
930 | # Run the configure script. | |
931 | config.status: $(srcdir)/configure | |
932 | $(SHELL) $(srcdir)/configure $(CONFIG_ARGS) | |
933 | ||
934 | .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre | |
935 | ||
936 | # Some make's put the object file in the current directory | |
937 | .c.o: | |
938 | $(CC) -c $(PY_CFLAGS) -o $@ $< | |
939 | ||
940 | # Rerun configure with the same options as it was run last time, | |
941 | # provided the config.status script exists | |
942 | recheck: | |
943 | $(SHELL) config.status --recheck | |
944 | $(SHELL) config.status | |
945 | ||
946 | # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in | |
947 | autoconf: | |
948 | (cd $(srcdir); autoconf) | |
949 | (cd $(srcdir); autoheader) | |
950 | ||
951 | # Create a tags file for vi | |
952 | tags:: | |
953 | cd $(srcdir); \ | |
954 | ctags -w -t Include/*.h; \ | |
955 | for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \ | |
956 | done; \ | |
957 | sort -o tags tags | |
958 | ||
959 | # Create a tags file for GNU Emacs | |
960 | TAGS:: | |
961 | cd $(srcdir); \ | |
962 | etags Include/*.h; \ | |
963 | for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done | |
964 | ||
965 | # Sanitation targets -- clean leaves libraries, executables and tags | |
966 | # files, which clobber removes those as well | |
967 | ||
968 | clean: | |
969 | find . -name '*.o' -exec rm -f {} ';' | |
970 | find . -name '*.s[ol]' -exec rm -f {} ';' | |
971 | find $(srcdir) -name '*.py[co]' -exec rm -f {} ';' | |
972 | ||
973 | clobber: clean | |
974 | -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ | |
975 | tags TAGS \ | |
976 | config.cache config.log pyconfig.h Modules/config.c | |
977 | -rm -rf build platform | |
978 | -rm -rf $(PYTHONFRAMEWORKDIR) | |
979 | ||
980 | # Make things extra clean, before making a distribution: | |
981 | # remove all generated files, even Makefile[.pre] | |
982 | distclean: clobber | |
983 | -rm -f core Makefile Makefile.pre buildno config.status \ | |
984 | Modules/Setup Modules/Setup.local Modules/Setup.config | |
985 | find $(srcdir) '(' -name '*.fdc' -o -name '*~' \ | |
986 | -o -name '[@,#]*' -o -name '*.old' \ | |
987 | -o -name '*.orig' -o -name '*.rej' \ | |
988 | -o -name '*.bak' ')' \ | |
989 | -exec rm -f {} ';' | |
990 | ||
991 | # Check for smelly exported symbols (not starting with Py/_Py) | |
992 | smelly: all | |
993 | nm -p $(LIBRARY) | \ | |
994 | sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ | |
995 | ||
996 | # Find files with funny names | |
997 | funny: | |
998 | find $(DISTDIRS) -type d \ | |
999 | -o -name '*.[chs]' \ | |
1000 | -o -name '*.py' \ | |
1001 | -o -name '*.doc' \ | |
1002 | -o -name '*.sty' \ | |
1003 | -o -name '*.bib' \ | |
1004 | -o -name '*.dat' \ | |
1005 | -o -name '*.el' \ | |
1006 | -o -name '*.fd' \ | |
1007 | -o -name '*.in' \ | |
1008 | -o -name '*.tex' \ | |
1009 | -o -name '*,[vpt]' \ | |
1010 | -o -name 'Setup' \ | |
1011 | -o -name 'Setup.*' \ | |
1012 | -o -name README \ | |
1013 | -o -name Makefile \ | |
1014 | -o -name ChangeLog \ | |
1015 | -o -name Repository \ | |
1016 | -o -name Root \ | |
1017 | -o -name Entries \ | |
1018 | -o -name Tag \ | |
1019 | -o -name tags \ | |
1020 | -o -name TAGS \ | |
1021 | -o -name .cvsignore \ | |
1022 | -o -name MANIFEST \ | |
1023 | -o -print | |
1024 | ||
1025 | # Dependencies | |
1026 | ||
1027 | Python/thread.o: $(srcdir)/Python/thread_atheos.h $(srcdir)/Python/thread_beos.h $(srcdir)/Python/thread_cthread.h $(srcdir)/Python/thread_foobar.h $(srcdir)/Python/thread_lwp.h $(srcdir)/Python/thread_nt.h $(srcdir)/Python/thread_os2.h $(srcdir)/Python/thread_pth.h $(srcdir)/Python/thread_pthread.h $(srcdir)/Python/thread_sgi.h $(srcdir)/Python/thread_solaris.h $(srcdir)/Python/thread_wince.h | |
1028 | ||
1029 | # Declare targets that aren't real files | |
1030 | .PHONY: all sharedmods oldsharedmods test quicktest memtest | |
1031 | .PHONY: install altinstall oldsharedinstall bininstall altbininstall | |
1032 | .PHONY: maninstall libinstall inclinstall libainstall sharedinstall | |
1033 | .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure | |
1034 | .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools | |
1035 | .PHONY: recheck autoconf clean clobber distclean smelly funny | |
1036 | ||
1037 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY | |
1038 | ||
1039 | # Rules appended by makedepend | |
1040 | ||
1041 | Modules/threadmodule.o: $(srcdir)/Modules/threadmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/threadmodule.c -o Modules/threadmodule.o | |
1042 | Modules/threadmodule$(SO): Modules/threadmodule.o; $(LDSHARED) Modules/threadmodule.o -o Modules/threadmodule$(SO) | |
1043 | Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o | |
1044 | Modules/signalmodule$(SO): Modules/signalmodule.o; $(LDSHARED) Modules/signalmodule.o -o Modules/signalmodule$(SO) | |
1045 | Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o | |
1046 | Modules/posixmodule$(SO): Modules/posixmodule.o; $(LDSHARED) Modules/posixmodule.o -o Modules/posixmodule$(SO) | |
1047 | Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o | |
1048 | Modules/errnomodule$(SO): Modules/errnomodule.o; $(LDSHARED) Modules/errnomodule.o -o Modules/errnomodule$(SO) | |
1049 | Modules/_sre.o: $(srcdir)/Modules/_sre.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/_sre.c -o Modules/_sre.o | |
1050 | Modules/_sre$(SO): Modules/_sre.o; $(LDSHARED) Modules/_sre.o -o Modules/_sre$(SO) | |
1051 | Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o | |
1052 | Modules/_codecsmodule$(SO): Modules/_codecsmodule.o; $(LDSHARED) Modules/_codecsmodule.o -o Modules/_codecsmodule$(SO) | |
1053 | Modules/zipimport.o: $(srcdir)/Modules/zipimport.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/zipimport.c -o Modules/zipimport.o | |
1054 | Modules/zipimport$(SO): Modules/zipimport.o; $(LDSHARED) Modules/zipimport.o -o Modules/zipimport$(SO) | |
1055 | Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o | |
1056 | Modules/_symtablemodule$(SO): Modules/symtablemodule.o; $(LDSHARED) Modules/symtablemodule.o -o Modules/_symtablemodule$(SO) | |
1057 | Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o | |
1058 | Modules/xxsubtype$(SO): Modules/xxsubtype.o; $(LDSHARED) Modules/xxsubtype.o -o Modules/xxsubtype$(SO) | |
1059 | Modules/readline.o: $(srcdir)/Modules/readline.c; $(CC) $(PY_CFLAGS) -c $(srcdir)/Modules/readline.c -o Modules/readline.o | |
1060 | Modules/readline$(SO): Modules/readline.o; $(LDSHARED) Modules/readline.o -lreadline -ltermcap -o Modules/readline$(SO) | |
1061 | Modules/pyexpat.o: $(srcdir)/Modules/pyexpat.c; $(CC) $(PY_CFLAGS) -DHAVE_EXPAT_H -c $(srcdir)/Modules/pyexpat.c -o Modules/pyexpat.o | |
1062 | Modules/pyexpat$(SO): Modules/pyexpat.o; $(LDSHARED) Modules/pyexpat.o -lexpat -o Modules/pyexpat$(SO) | |
1063 | Modules/_tkinter.o: $(srcdir)/Modules/_tkinter.c; $(CC) $(PY_CFLAGS) -DWITH_APPINIT -I/import/archperf/ws/devtools/4/64/include -c $(srcdir)/Modules/_tkinter.c -o Modules/_tkinter.o | |
1064 | Modules/tkappinit.o: $(srcdir)/Modules/tkappinit.c; $(CC) $(PY_CFLAGS) -DWITH_APPINIT -I/import/archperf/ws/devtools/4/64/include -c $(srcdir)/Modules/tkappinit.c -o Modules/tkappinit.o | |
1065 | Modules/_tkinter$(SO): Modules/_tkinter.o Modules/tkappinit.o; $(LDSHARED) Modules/_tkinter.o Modules/tkappinit.o -L/import/archperf/ws/devtools/4/64/lib -ltk8.4 -ltcl8.4 -lX11 -o Modules/_tkinter$(SO) |