source: trunk/essentials/dev-lang/python/Makefile.pre.in@ 3397

Last change on this file since 3397 was 3397, checked in by bird, 18 years ago

shared library hack.

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