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

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

Install the dll and don't symlink the main exe since 4os2 an cmd doesn't grok symlinks yet.

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