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
24MODOBJS=          Modules/threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/zipimport.o  Modules/symtablemodule.o
25MODLIBS=        $(LOCALMODLIBS) $(BASEMODLIBS)
26
27# === Variables set by configure
28VERSION=	2.7
29srcdir=		/builddir/build/BUILD/Python-2.7.17
30VPATH=		/builddir/build/BUILD/Python-2.7.17
31abs_srcdir=	/builddir/build/BUILD/Python-2.7.17
32abs_builddir=	/builddir/build/BUILD/Python-2.7.17/build/optimized
33build=		x86_64-redhat-linux-gnu
34host=		x86_64-redhat-linux-gnu
35
36CC=		gcc -pthread
37CXX=		g++ -pthread
38MAINCC=		$(CC)
39LINKCC=		gcc
40AR=		ar
41RANLIB=		ranlib
42GITVERSION=
43GITTAG=
44GITBRANCH=
45PGO_PROF_GEN_FLAG=-fprofile-generate
46PGO_PROF_USE_FLAG=-fprofile-use -fprofile-correction
47LLVM_PROF_MERGER=true
48LLVM_PROF_FILE=
49LLVM_PROF_ERR=no
50
51GNULD=          yes
52
53# Shell used by make (some versions default to the login shell, which is bad)
54SHELL=		/bin/sh
55
56# Use this to make a link between python$(VERSION) and python in $(BINDIR)
57LN=		ln
58
59# Portable install script (configure doesn't always guess right)
60INSTALL=	/usr/bin/install -c
61INSTALL_PROGRAM=${INSTALL}
62INSTALL_SCRIPT= ${INSTALL}
63INSTALL_DATA=	${INSTALL} -m 644
64# Shared libraries must be installed with executable mode on some systems;
65# rather than figuring out exactly which, we always give them executable mode.
66# Also, making them read-only seems to be a good idea...
67INSTALL_SHARED= ${INSTALL} -m 555
68
69MKDIR_P=	/usr/bin/mkdir -p
70
71MAKESETUP=      $(srcdir)/Modules/makesetup
72
73# Compiler options
74OPT=		-DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv
75BASECFLAGS=	 -fno-strict-aliasing
76CFLAGS=		$(BASECFLAGS) -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  $(OPT) $(EXTRA_CFLAGS)
77# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
78# be able to build extension modules using the directories specified in the
79# environment variables
80CPPFLAGS=	-I. -IInclude -I$(srcdir)/Include
81LDFLAGS=	-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
82LDLAST=
83SGI_ABI=
84CCSHARED=	-fPIC
85LINKFORSHARED=	-Xlinker -export-dynamic
86ARFLAGS=	rc
87# Extra C flags added for building the interpreter object files.
88CFLAGSFORSHARED=$(CCSHARED)
89# C flags used for building the interpreter object files
90PY_CFLAGS=	$(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
91
92
93# Machine-dependent subdirectories
94MACHDEP=	linux2
95
96# Multiarch directory (may be empty)
97MULTIARCH=
98
99# Install prefix for architecture-independent files
100prefix=		/usr
101
102# Install prefix for architecture-dependent files
103exec_prefix=	/usr
104
105# Install prefix for data files
106datarootdir=    ${prefix}/share
107
108# Expanded directories
109BINDIR=		/usr/bin
110LIBDIR=		/usr/lib64
111MANDIR=		/usr/share/man
112INCLUDEDIR=	/usr/include
113CONFINCLUDEDIR=	$(exec_prefix)/include
114SCRIPTDIR=	$(prefix)/lib64
115
116# Detailed destination directories
117BINLIBDEST=	$(LIBDIR)/python$(VERSION)
118LIBDEST=	$(SCRIPTDIR)/python$(VERSION)
119INCLUDEPY=	$(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
120CONFINCLUDEPY=	$(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
121LIBP=		$(LIBDIR)/python$(VERSION)
122
123# Symbols used for using shared libraries
124SO=		.so
125LDSHARED=	$(CC) -shared $(LDFLAGS)
126BLDSHARED=	$(CC) -shared $(LDFLAGS)
127LDCXXSHARED=	$(CXX) -shared
128DESTSHARED=	$(BINLIBDEST)/lib-dynload
129
130# Executable suffix (.exe on Windows and Mac OS X)
131EXE=
132BUILDEXE=
133
134# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a debug build
135# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug build
136# Both will be empty in an optimized build
137DEBUG_EXT=
138DEBUG_SUFFIX=
139
140# Short name and location for Mac OS X Python framework
141UNIVERSALSDK=
142PYTHONFRAMEWORK=
143PYTHONFRAMEWORKDIR=	no-framework
144PYTHONFRAMEWORKPREFIX=
145PYTHONFRAMEWORKINSTALLDIR=
146# Deployment target selected during configure, to be checked
147# by distutils. The export statement is needed to ensure that the
148# deployment target is active during build.
149MACOSX_DEPLOYMENT_TARGET=
150#export MACOSX_DEPLOYMENT_TARGET
151
152# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
153OTHER_LIBTOOL_OPT=
154
155# Environment to run shared python without installed libraries
156RUNSHARED=       LD_LIBRARY_PATH=/builddir/build/BUILD/Python-2.7.17/build/optimized
157
158# ensurepip options
159ENSUREPIP=      no
160
161# Modes for directories, executables and data files created by the
162# install process.  Default to user-only-writable for all file types.
163DIRMODE=	755
164EXEMODE=	755
165FILEMODE=	644
166
167# configure script arguments
168CONFIG_ARGS=	 '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--enable-unicode=ucs4' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--with-dtrace' '--with-tapset-install-dir=/usr/share/systemtap/tapset' '--with-valgrind' '--enable-optimizations' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CC=gcc' 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS=-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
169
170
171# Subdirectories with code
172SRCDIRS= 	Parser Objects Python Modules Modules/_io
173
174# Other subdirectories
175SUBDIRSTOO=	Include Lib Misc Demo
176
177# Files and directories to be distributed
178CONFIGFILES=	configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
179DISTFILES=	README ChangeLog $(CONFIGFILES)
180DISTDIRS=	$(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
181DIST=		$(DISTFILES) $(DISTDIRS)
182
183
184LIBRARY=	libpython$(VERSION).a
185LDLIBRARY=      libpython$(VERSION)$(DEBUG_EXT).so
186BLDLIBRARY=     -L. -lpython$(VERSION)$(DEBUG_EXT)
187DLLLIBRARY=
188LDLIBRARYDIR=
189INSTSONAME=	libpython$(VERSION)$(DEBUG_EXT).so.1.0
190
191
192LIBS=		-lpthread -ldl  -lutil
193LIBM=		-lm
194LIBC=
195SYSLIBS=	$(LIBM) $(LIBC)
196SHLIBS=		$(LIBS)
197
198THREADOBJ=	Python/thread.o
199DLINCLDIR=	.
200DYNLOADFILE=	dynload_shlib.o
201MACHDEP_OBJS=
202LIBOBJDIR=	Python/
203LIBOBJS=
204UNICODE_OBJS=   Objects/unicodeobject.o Objects/unicodectype.o
205
206PYTHON=		python$(DEBUG_SUFFIX)$(EXE)
207BUILDPYTHON=	python$(DEBUG_SUFFIX)$(BUILDEXE)
208
209PYTHON_FOR_REGEN=python3
210PYTHON_FOR_BUILD=./$(BUILDPYTHON) -E
211_PYTHON_HOST_PLATFORM=
212HOST_GNU_TYPE=  x86_64-redhat-linux-gnu
213
214# Tcl and Tk config info from --with-tcltk-includes and -libs options
215TCLTK_INCLUDES=
216TCLTK_LIBS=
217
218# The task to run while instrument when building the profile-opt target
219# We exclude unittests with -x that take a rediculious amount of time to
220# run in the instrumented training build or do not provide much value.
221PROFILE_TASK=-m test.regrtest --pgo -x test_asyncore test_gdb test_multiprocessing test_subprocess
222
223# report files for gcov / lcov coverage report
224COVERAGE_INFO=	$(abs_builddir)/coverage.info
225COVERAGE_REPORT=$(abs_builddir)/lcov-report
226COVERAGE_REPORT_OPTIONS=--no-branch-coverage --title "CPython lcov report"
227
228# === Definitions added by makesetup ===
229
230LOCALMODLIBS=
231BASEMODLIBS=
232SHAREDMODS= Modules/readline$(DEBUG_EXT)$(SO) Modules/arraymodule$(DEBUG_EXT)$(SO) Modules/cmathmodule$(DEBUG_EXT)$(SO) Modules/math$(DEBUG_EXT)$(SO) Modules/_struct$(DEBUG_EXT)$(SO) Modules/timemodule$(DEBUG_EXT)$(SO) Modules/operator$(DEBUG_EXT)$(SO) Modules/_testcapimodule$(DEBUG_EXT)$(SO) Modules/_randommodule$(DEBUG_EXT)$(SO) Modules/_collectionsmodule$(DEBUG_EXT)$(SO) Modules/itertoolsmodule$(DEBUG_EXT)$(SO) Modules/stropmodule$(DEBUG_EXT)$(SO) Modules/_functoolsmodule$(DEBUG_EXT)$(SO) Modules/_bisectmodule$(DEBUG_EXT)$(SO) Modules/unicodedata$(DEBUG_EXT)$(SO) Modules/_localemodule$(DEBUG_EXT)$(SO) Modules/fcntlmodule$(DEBUG_EXT)$(SO) Modules/spwdmodule$(DEBUG_EXT)$(SO) Modules/grpmodule$(DEBUG_EXT)$(SO) Modules/selectmodule$(DEBUG_EXT)$(SO) Modules/mmapmodule$(DEBUG_EXT)$(SO) Modules/_csv$(DEBUG_EXT)$(SO) Modules/_socketmodule$(DEBUG_EXT)$(SO) Modules/_ssl$(DEBUG_EXT)$(SO) Modules/_cryptmodule$(DEBUG_EXT)$(SO) Modules/nismodule$(DEBUG_EXT)$(SO) Modules/termios$(DEBUG_EXT)$(SO) Modules/resource$(DEBUG_EXT)$(SO) Modules/audioop$(DEBUG_EXT)$(SO) Modules/imageop$(DEBUG_EXT)$(SO) Modules/_md5module$(DEBUG_EXT)$(SO) Modules/_shamodule$(DEBUG_EXT)$(SO) Modules/_sha256module$(DEBUG_EXT)$(SO) Modules/_sha512module$(DEBUG_EXT)$(SO) Modules/linuxaudiodev$(DEBUG_EXT)$(SO) Modules/timingmodule$(DEBUG_EXT)$(SO) Modules/_tkinter$(DEBUG_EXT)$(SO) Modules/dlmodule$(DEBUG_EXT)$(SO) Modules/gdbmmodule$(DEBUG_EXT)$(SO) Modules/_bsddb$(DEBUG_EXT)$(SO) Modules/binascii$(DEBUG_EXT)$(SO) Modules/parsermodule$(DEBUG_EXT)$(SO) Modules/cStringIO$(DEBUG_EXT)$(SO) Modules/cPickle$(DEBUG_EXT)$(SO) Modules/zlibmodule$(DEBUG_EXT)$(SO) Modules/_multibytecodecmodule$(DEBUG_EXT)$(SO) Modules/_codecs_cn$(DEBUG_EXT)$(SO) Modules/_codecs_hk$(DEBUG_EXT)$(SO) Modules/_codecs_iso2022$(DEBUG_EXT)$(SO) Modules/_codecs_jp$(DEBUG_EXT)$(SO) Modules/_codecs_kr$(DEBUG_EXT)$(SO) Modules/_codecs_tw$(DEBUG_EXT)$(SO) Modules/xxsubtype$(DEBUG_EXT)$(SO)
233DBLIB=/usr/lib64
234DBINC=/usr/include/libdb
235GLHACK=-Dclear=__GLclear
236PYTHONPATH=$(COREPYTHONPATH)
237COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(EXTRAMACHDEPPATH)$(TKPATH)$(OLDPATH)
238OLDPATH=:lib-old
239TKPATH=:lib-tk
240EXTRAMACHDEPPATH=
241MACHDEPPATH=:$(PLATDIR)
242TESTPATH=
243SITEPATH=
244DESTPATH=
245MACHDESTLIB=$(BINLIBDEST)
246DESTLIB=$(LIBDEST)
247
248
249
250##########################################################################
251# Modules
252MODULE_OBJS=	\
253		Modules/config.o \
254		Modules/getpath.o \
255		Modules/main.o \
256		Modules/gcmodule.o
257
258# Used of signalmodule.o is not available
259SIGNAL_OBJS=
260
261
262##########################################################################
263
264LIBFFI_INCLUDEDIR=
265
266##########################################################################
267# Parser
268PGEN=		Parser/pgen$(EXE)
269
270PSRCS=		\
271		Parser/acceler.c \
272		Parser/grammar1.c \
273		Parser/listnode.c \
274		Parser/node.c \
275		Parser/parser.c \
276		Parser/parsetok.c \
277		Parser/bitset.c \
278		Parser/metagrammar.c \
279		Parser/firstsets.c \
280		Parser/grammar.c \
281		Parser/pgen.c
282
283POBJS=		\
284		Parser/acceler.o \
285		Parser/grammar1.o \
286		Parser/listnode.o \
287		Parser/node.o \
288		Parser/parser.o \
289		Parser/parsetok.o \
290		Parser/bitset.o \
291		Parser/metagrammar.o \
292		Parser/firstsets.o \
293		Parser/grammar.o \
294		Parser/pgen.o
295
296PARSER_OBJS=	$(POBJS) Parser/myreadline.o Parser/tokenizer.o
297
298PGSRCS=		\
299		Objects/obmalloc.c \
300		Python/mysnprintf.c \
301		Python/pyctype.c \
302		Parser/tokenizer_pgen.c \
303		Parser/printgrammar.c \
304		Parser/pgenmain.c
305
306PGOBJS=		\
307		Objects/obmalloc.o \
308		Python/mysnprintf.o \
309		Python/pyctype.o \
310		Parser/tokenizer_pgen.o \
311		Parser/printgrammar.o \
312		Parser/pgenmain.o
313
314PARSER_HEADERS= \
315		Parser/parser.h \
316		Parser/tokenizer.h
317
318PGENSRCS=	$(PSRCS) $(PGSRCS)
319PGENOBJS=	$(POBJS) $(PGOBJS)
320
321##########################################################################
322PYTHON_OBJS=	\
323		Python/_warnings.o \
324		Python/Python-ast.o \
325		Python/asdl.o \
326		Python/ast.o \
327		Python/bltinmodule.o \
328		Python/ceval.o \
329		Python/compile.o \
330		Python/codecs.o \
331		Python/errors.o \
332		Python/frozen.o \
333		Python/frozenmain.o \
334		Python/future.o \
335		Python/getargs.o \
336		Python/getcompiler.o \
337		Python/getcopyright.o \
338		Python/getplatform.o \
339		Python/getversion.o \
340		Python/graminit.o \
341		Python/import.o \
342		Python/importdl.o \
343		Python/marshal.o \
344		Python/modsupport.o \
345		Python/mystrtoul.o \
346		Python/mysnprintf.o \
347		Python/peephole.o \
348		Python/pyarena.o \
349		Python/pyctype.o \
350		Python/pyfpe.o \
351		Python/pymath.o \
352		Python/pystate.o \
353		Python/pythonrun.o \
354                Python/random.o \
355		Python/structmember.o \
356		Python/symtable.o \
357		Python/sysmodule.o \
358		Python/traceback.o \
359		Python/getopt.o \
360		Python/pystrcmp.o \
361		Python/pystrtod.o \
362		Python/dtoa.o \
363		Python/formatter_unicode.o \
364		Python/formatter_string.o \
365		Python/$(DYNLOADFILE) \
366		Python/dtrace.o \
367		$(LIBOBJS) \
368		$(MACHDEP_OBJS) \
369		$(THREADOBJ)
370
371
372##########################################################################
373# Objects
374OBJECT_OBJS=	\
375		Objects/abstract.o \
376		Objects/boolobject.o \
377		Objects/bufferobject.o \
378		Objects/bytes_methods.o \
379		Objects/bytearrayobject.o \
380		Objects/capsule.o \
381		Objects/cellobject.o \
382		Objects/classobject.o \
383		Objects/cobject.o \
384		Objects/codeobject.o \
385		Objects/complexobject.o \
386		Objects/descrobject.o \
387		Objects/enumobject.o \
388		Objects/exceptions.o \
389		Objects/genobject.o \
390		Objects/fileobject.o \
391		Objects/floatobject.o \
392		Objects/frameobject.o \
393		Objects/funcobject.o \
394		Objects/intobject.o \
395		Objects/iterobject.o \
396		Objects/listobject.o \
397		Objects/longobject.o \
398		Objects/dictobject.o \
399		Objects/memoryobject.o \
400		Objects/methodobject.o \
401		Objects/moduleobject.o \
402		Objects/object.o \
403		Objects/obmalloc.o \
404		Objects/rangeobject.o \
405		Objects/setobject.o \
406		Objects/sliceobject.o \
407		Objects/stringobject.o \
408		Objects/structseq.o \
409		Objects/tupleobject.o \
410		Objects/typeobject.o \
411		Objects/weakrefobject.o \
412		$(UNICODE_OBJS)
413
414
415##########################################################################
416# objects that get linked into the Python library
417LIBRARY_OBJS=	\
418		Modules/getbuildinfo.o \
419		$(PARSER_OBJS) \
420		$(OBJECT_OBJS) \
421		$(PYTHON_OBJS) \
422		$(MODULE_OBJS) \
423		$(SIGNAL_OBJS) \
424		$(MODOBJS)
425
426#########################################################################
427# Rules
428
429# Default target
430all:		profile-opt
431build_all:	check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks
432
433# Check that the source is clean when building out of source.
434check-clean-src:
435	@if test -n "$(VPATH)" -a -f "$(srcdir)/Modules/python.o"; then \
436		echo "Error: The source directory ($(srcdir)) is not clean" ; \
437		echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
438		echo "Try to run: make -C \"$(srcdir)\" clean" ; \
439		exit 1; \
440	fi
441
442# Compile a binary with profile guided optimization.
443profile-opt:
444	@if [ $(LLVM_PROF_ERR) = yes ]; then \
445		echo "Error: Cannot perform PGO build because llvm-profdata was not found in PATH" ;\
446		echo "Please add it to PATH and run ./configure again" ;\
447		exit 1;\
448	fi
449	@echo "Building with support for profile generation:"
450	$(MAKE) clean
451	$(MAKE) profile-removal
452	$(MAKE) build_all_generate_profile
453	$(MAKE) profile-removal
454	@echo "Running code to generate profile data (this can take a while):"
455	$(MAKE) run_profile_task
456	$(MAKE) build_all_merge_profile
457	@echo "Rebuilding with profile guided optimizations:"
458	$(MAKE) clean
459	$(MAKE) build_all_use_profile
460	$(MAKE) profile-removal
461
462build_all_generate_profile:
463	$(MAKE) build_all CFLAGS="$(CFLAGS) $(PGO_PROF_GEN_FLAG) " LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG) " LIBS="$(LIBS)"
464
465run_profile_task:
466	: # FIXME: can't run for a cross build
467	$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
468
469build_all_merge_profile:
470	$(LLVM_PROF_MERGER)
471
472build_all_use_profile:
473	$(MAKE) build_all CFLAGS="$(CFLAGS) $(PGO_PROF_USE_FLAG) " LDFLAGS="$(LDFLAGS) "
474
475# Compile and run with gcov
476.PHONY=coverage coverage-lcov coverage-report
477coverage:
478	@echo "Building with support for coverage checking:"
479	$(MAKE) clean profile-removal
480	$(MAKE) build_all CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"
481
482coverage-lcov:
483	@echo "Creating Coverage HTML report with LCOV:"
484	@rm -f $(COVERAGE_INFO)
485	@rm -rf $(COVERAGE_REPORT)
486	@lcov --capture --directory $(abs_builddir) \
487	    --base-directory $(realpath $(abs_builddir)) \
488	    --path $(realpath $(abs_srcdir)) \
489	    --output-file $(COVERAGE_INFO)
490	: # remove 3rd party modules and system headers
491	@lcov --remove $(COVERAGE_INFO) \
492	    '*/Modules/_ctypes/libffi*/*' \
493	    '*/Modules/expat/*' \
494	    '*/Modules/zlib/*' \
495	    '*/Include/*' \
496	    '/usr/include/*' \
497	    '/usr/local/include/*' \
498	    --output-file $(COVERAGE_INFO)
499	@genhtml $(COVERAGE_INFO) --output-directory $(COVERAGE_REPORT) \
500	    $(COVERAGE_REPORT_OPTIONS)
501	@echo
502	@echo "lcov report at $(COVERAGE_REPORT)/index.html"
503	@echo
504
505# Force regeneration of parser
506coverage-report: regen-grammar
507	: # build with coverage info
508	$(MAKE) coverage
509	: # run tests, ignore failures
510	$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) || true
511	: # build lcov report
512	$(MAKE) coverage-lcov
513
514
515# Build the interpreter
516$(BUILDPYTHON):	Modules/python.o $(LDLIBRARY)
517		$(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
518			Modules/python.o \
519			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
520
521platform: $(BUILDPYTHON) pybuilddir.txt
522	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
523
524# Create build directory and generate the sysconfig build-time data there.
525# pybuilddir.txt contains the name of the build dir and is used for
526# sys.path fixup -- see Modules/getpath.c.
527# Since this step runs before shared modules are built, try to avoid bootstrap
528# problems by creating a dummy pybuilddir.txt just to allow interpreter
529# initialization to succeed.  It will be overwritten by generate-posix-vars
530# or removed in case of failure.
531pybuilddir.txt: $(BUILDPYTHON)
532	@echo "none" > ./pybuilddir.txt
533	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
534	if test $$? -ne 0 ; then \
535		echo "generate-posix-vars failed" ; \
536		rm -f ./pybuilddir.txt ; \
537		exit 1 ; \
538	fi
539
540# This is shared by the math and cmath modules
541Modules/_math.o: Modules/_math.c Modules/_math.h
542	$(CC) -c $(CCSHARED) $(PY_CFLAGS) -o $@ $<
543
544# Build the shared modules
545# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
546# -s, --silent or --quiet is always the first char.
547# Under BSD make, MAKEFLAGS might be " -s -v x=y".
548sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
549	@case "$$MAKEFLAGS" in \
550	    *\ -s*|s*) quiet="-q";; \
551	    *) quiet="";; \
552	esac; \
553	$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
554		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
555		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
556
557libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
558	if test $(INSTSONAME) != $(LDLIBRARY); then \
559		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
560		$(LN) -f $(INSTSONAME) $@; \
561	else \
562		$(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
563	fi
564
565libpython$(VERSION).dylib: $(LIBRARY_OBJS)
566	 $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
567
568
569libpython$(VERSION).sl: $(LIBRARY_OBJS)
570	$(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
571
572# Copy up the gdb python hooks into a position where they can be automatically
573# loaded by gdb during Lib/test/test_gdb.py
574#
575# Distributors are likely to want to install this somewhere else e.g. relative
576# to the stripped DWARF data for the shared library.
577gdbhooks: $(BUILDPYTHON)-gdb.py
578
579SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
580$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
581	$(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
582
583# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
584# minimal framework (not including the Lib directory and such) in the current
585# directory.
586RESSRCDIR=Mac/Resources/framework
587$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
588		$(LIBRARY) \
589		$(RESSRCDIR)/Info.plist
590	$(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
591	$(CC) -o $(LDLIBRARY) $(LDFLAGS)  -dynamiclib \
592		-all_load $(LIBRARY) -Wl,-single_module \
593		-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
594		-compatibility_version $(VERSION) \
595		-current_version $(VERSION);
596	$(INSTALL) -d -m $(DIRMODE)  \
597		$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
598	$(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
599		$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
600	$(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
601	$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
602	$(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
603	$(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
604
605# This rule builds the Cygwin Python DLL and import library if configured
606# for a shared core library; otherwise, this rule is a noop.
607$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
608	if test -n "$(DLLLIBRARY)"; then \
609		$(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
610			$(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \
611	else true; \
612	fi
613
614
615oldsharedmods: $(SHAREDMODS)
616
617
618Makefile Modules/config.c: Makefile.pre \
619				$(srcdir)/Modules/config.c.in \
620				$(MAKESETUP) \
621				Modules/Setup.config \
622				Modules/Setup \
623				Modules/Setup.local
624	$(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
625				-s Modules \
626				Modules/Setup.config \
627				Modules/Setup.local \
628				Modules/Setup
629	@mv config.c Modules
630	@echo "The Makefile was updated, you may need to re-run make."
631
632
633Modules/Setup: $(srcdir)/Modules/Setup.dist
634	@if test -f Modules/Setup; then \
635		echo "-----------------------------------------------"; \
636		echo "Modules/Setup.dist is newer than Modules/Setup;"; \
637		echo "check to make sure you have all the updates you"; \
638		echo "need in your Modules/Setup file."; \
639		echo "Usually, copying Modules/Setup.dist to Modules/Setup will work."; \
640		echo "-----------------------------------------------"; \
641	fi
642
643
644############################################################################
645# Regenerate all generated files
646
647regen-all: regen-opcode-targets regen-grammar regen-ast
648
649############################################################################
650# Special rules for object files
651
652Modules/getbuildinfo.o: $(PARSER_OBJS) \
653		$(OBJECT_OBJS) \
654		$(PYTHON_OBJS) \
655		$(MODULE_OBJS) \
656		$(SIGNAL_OBJS) \
657		$(MODOBJS) \
658		$(srcdir)/Modules/getbuildinfo.c
659	$(CC) -c $(PY_CFLAGS) \
660	      -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
661	      -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
662	      -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
663	      -o $@ $(srcdir)/Modules/getbuildinfo.c
664
665Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
666	$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
667		-DPREFIX='"$(prefix)"' \
668		-DEXEC_PREFIX='"$(exec_prefix)"' \
669		-DVERSION='"$(VERSION)"' \
670		-DVPATH='"$(VPATH)"' \
671		-o $@ $(srcdir)/Modules/getpath.c
672
673Modules/python.o: $(srcdir)/Modules/python.c
674	$(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
675
676Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
677
678Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h
679
680Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
681
682$(PGEN):	$(PGENOBJS)
683		$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
684
685.PHONY: regen-grammar
686regen-grammar: $(PGEN)
687	# Regenerate Include/graminit.h and Python/graminit.c
688	# from Grammar/Grammar using pgen
689	@$(MKDIR_P) Include
690	$(PGEN) $(srcdir)/Grammar/Grammar \
691		$(srcdir)/Include/graminit.h \
692		$(srcdir)/Python/graminit.c
693
694Parser/grammar.o:	$(srcdir)/Parser/grammar.c \
695				$(srcdir)/Include/token.h \
696				$(srcdir)/Include/grammar.h
697Parser/metagrammar.o:	$(srcdir)/Parser/metagrammar.c
698
699Parser/tokenizer_pgen.o:	$(srcdir)/Parser/tokenizer.c
700
701Parser/pgenmain.o:	$(srcdir)/Include/parsetok.h
702
703.PHONY=regen-ast
704regen-ast:
705	# Regenerate Include/Python-ast.h using Parser/asdl_c.py -h
706	$(MKDIR_P) $(srcdir)/Include
707	$(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
708		-h $(srcdir)/Include \
709		$(srcdir)/Parser/Python.asdl
710	# Regenerate Python/Python-ast.c using Parser/asdl_c.py -c
711	$(MKDIR_P) $(srcdir)/Python
712	$(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
713		-c $(srcdir)/Python \
714		$(srcdir)/Parser/Python.asdl
715
716Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
717
718Python/getplatform.o: $(srcdir)/Python/getplatform.c
719		$(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
720
721Python/importdl.o: $(srcdir)/Python/importdl.c
722		$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
723
724Objects/unicodectype.o:	$(srcdir)/Objects/unicodectype.c \
725				$(srcdir)/Objects/unicodetype_db.h
726
727STRINGLIB_HEADERS= \
728		$(srcdir)/Include/bytes_methods.h \
729		$(srcdir)/Objects/stringlib/count.h \
730		$(srcdir)/Objects/stringlib/ctype.h \
731		$(srcdir)/Objects/stringlib/fastsearch.h \
732		$(srcdir)/Objects/stringlib/find.h \
733		$(srcdir)/Objects/stringlib/formatter.h \
734		$(srcdir)/Objects/stringlib/partition.h \
735		$(srcdir)/Objects/stringlib/split.h \
736		$(srcdir)/Objects/stringlib/stringdefs.h \
737		$(srcdir)/Objects/stringlib/string_format.h \
738		$(srcdir)/Objects/stringlib/transmogrify.h \
739		$(srcdir)/Objects/stringlib/unicodedefs.h \
740		$(srcdir)/Objects/stringlib/localeutil.h
741
742Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
743				$(STRINGLIB_HEADERS)
744
745Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \
746				$(STRINGLIB_HEADERS)
747
748Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \
749				$(STRINGLIB_HEADERS)
750
751.PHONY: regen-opcode-targets
752regen-opcode-targets:
753	# Regenerate Python/opcode_targets.h from Lib/opcode.py
754	# using Python/makeopcodetargets.py
755	$(PYTHON_FOR_REGEN) $(srcdir)/Python/makeopcodetargets.py \
756		$(srcdir)/Python/opcode_targets.h
757
758Python/ceval.o: $(srcdir)/Python/opcode_targets.h
759
760Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
761				$(STRINGLIB_HEADERS)
762
763Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
764				$(STRINGLIB_HEADERS)
765
766# Only needed with --with-dtrace
767buildinclude:
768	mkdir -p Include
769
770Include/pydtrace.h: buildinclude $(srcdir)/Include/pydtrace.d
771	dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Include/pydtrace.d
772
773Python/ceval.o: Include/pydtrace.h
774
775Python/dtrace.o: buildinclude $(srcdir)/Include/pydtrace.d Python/ceval.o
776	dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Include/pydtrace.d Python/ceval.o
777
778############################################################################
779# Header files
780
781PYTHON_HEADERS= \
782		Include/Python-ast.h \
783		Include/Python.h \
784		Include/abstract.h \
785		Include/asdl.h \
786		Include/ast.h \
787		Include/bitset.h \
788		Include/boolobject.h \
789		Include/bytearrayobject.h \
790		Include/bytes_methods.h \
791		Include/bytesobject.h \
792		Include/bufferobject.h \
793		Include/cellobject.h \
794		Include/ceval.h \
795		Include/classobject.h \
796		Include/cobject.h \
797		Include/code.h \
798		Include/codecs.h \
799		Include/compile.h \
800		Include/complexobject.h \
801		Include/descrobject.h \
802		Include/dictobject.h \
803		Include/dtoa.h \
804		Include/enumobject.h \
805		Include/errcode.h \
806		Include/eval.h \
807		Include/fileobject.h \
808		Include/floatobject.h \
809		Include/frameobject.h \
810		Include/funcobject.h \
811		Include/genobject.h \
812		Include/import.h \
813		Include/intobject.h \
814		Include/intrcheck.h \
815		Include/iterobject.h \
816		Include/listobject.h \
817		Include/longintrepr.h \
818		Include/longobject.h \
819		Include/marshal.h \
820		Include/memoryobject.h \
821		Include/metagrammar.h \
822		Include/methodobject.h \
823		Include/modsupport.h \
824		Include/moduleobject.h \
825		Include/node.h \
826		Include/object.h \
827		Include/objimpl.h \
828		Include/opcode.h \
829		Include/osdefs.h \
830		Include/parsetok.h \
831		Include/patchlevel.h \
832		Include/pgen.h \
833		Include/pgenheaders.h \
834		Include/pyarena.h \
835		Include/pycapsule.h \
836		Include/pyctype.h \
837		Include/pydebug.h \
838		Include/pyerrors.h \
839		Include/pyfpe.h \
840		Include/pymath.h \
841		Include/pygetopt.h \
842		Include/pymem.h \
843		Include/pyport.h \
844		Include/pystate.h \
845		Include/pystrcmp.h \
846		Include/pystrtod.h \
847		Include/pythonrun.h \
848		Include/pythread.h \
849		Include/rangeobject.h \
850		Include/setobject.h \
851		Include/sliceobject.h \
852		Include/stringobject.h \
853		Include/structmember.h \
854		Include/structseq.h \
855		Include/symtable.h \
856		Include/sysmodule.h \
857		Include/traceback.h \
858		Include/tupleobject.h \
859		Include/ucnhash.h \
860		Include/unicodeobject.h \
861		Include/warnings.h \
862		Include/weakrefobject.h \
863		pyconfig.h \
864		$(PARSER_HEADERS) \
865		$(srcdir)/Include/Python-ast.h
866
867$(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
868
869
870######################################################################
871
872# Test the interpreter (twice, once without .pyc files, once with)
873# In the past, we've had problems where bugs in the marshalling or
874# elsewhere caused bytecode read from .pyc files to behave differently
875# than bytecode generated directly from a .py source file.  Sometimes
876# the bytecode read from a .pyc file had the bug, sometimes the directly
877# generated bytecode.  This is sometimes a very shy bug needing a lot of
878# sample data.
879
880.PHONY: test testall testuniversal buildbottest pythoninfo
881
882TESTOPTS=	-l $(EXTRATESTOPTS)
883TESTPROG=	$(srcdir)/Lib/test/regrtest.py
884TESTPYTHON=	$(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
885
886# Remove "test_python_*" directories of previous failed test jobs.
887# Pass TESTOPTS options because it can contain --tempdir option.
888cleantest: build_all
889	$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) --cleanup
890
891test:		build_all platform
892		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
893		-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
894		$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
895
896testall:	build_all platform
897		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
898		$(TESTPYTHON) $(srcdir)/Lib/compileall.py
899		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
900		-$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
901		$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
902
903#  Run the unitests for both architectures in a Universal build on OSX
904#  Must be run on an Intel box.
905testuniversal:	build_all platform
906		if [ `arch` != 'i386' ];then \
907			echo "This can only be used on OSX/i386" ;\
908			exit 1 ;\
909		fi
910		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
911		-$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
912		$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
913		$(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS)
914
915
916# Like testall, but with a single pass only
917# run an optional script to include some information about the build environment
918buildbottest:	build_all platform
919		-@if which pybuildbot.identify >/dev/null 2>&1; then \
920			pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
921		fi
922		$(TESTPYTHON) -R $(TESTPROG) -uall --slowest -rwW $(TESTOPTS)
923
924pythoninfo: build_all
925		$(RUNSHARED) ./$(BUILDPYTHON) -m test.pythoninfo
926
927QUICKTESTOPTS=	$(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
928		test_multibytecodec test_urllib2_localnet test_itertools \
929		test_multiprocessing test_mailbox test_socket test_poll \
930		test_select test_zipfile
931quicktest:	build_all platform
932		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
933		-$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
934		$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
935
936MEMTESTOPTS=    $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
937		test_longexp
938memtest:	build_all platform
939		-rm -f $(srcdir)/Lib/test/*.py[co]
940		-$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
941		$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
942
943# SSL tests
944.PHONY: multisslcompile multissltest
945multisslcompile: build_all
946	$(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py --compile-only
947
948multissltest: build_all
949	$(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py
950
951# Install everything
952install:	 commoninstall bininstall maninstall
953	if test "x$(ENSUREPIP)" != "xno"  ; then \
954		case $(ENSUREPIP) in \
955			upgrade) ensurepip="--upgrade" ;; \
956			install|*) ensurepip="" ;; \
957		esac; \
958		$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
959			$$ensurepip --root=$(DESTDIR)/ ; \
960	fi
961
962# Install almost everything without disturbing previous versions
963altinstall:	commoninstall
964	if test "x$(ENSUREPIP)" != "xno"  ; then \
965		case $(ENSUREPIP) in \
966			upgrade) ensurepip="--altinstall --upgrade --no-default-pip" ;; \
967			install|*) ensurepip="--altinstall --no-default-pip" ;; \
968		esac; \
969		$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
970			$$ensurepip --root=$(DESTDIR)/ ; \
971	fi
972
973commoninstall:	check-clean-src  \
974		altbininstall libinstall inclinstall libainstall \
975		sharedinstall oldsharedinstall altmaninstall \
976
977
978# Install shared libraries enabled by Setup
979DESTDIRS=	$(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
980
981oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
982		@for i in X $(SHAREDMODS); do \
983		  if test $$i != X; then \
984		    echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
985		    $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
986		  fi; \
987		done
988
989$(DESTSHARED):
990		@for i in $(DESTDIRS); \
991		do \
992			if test ! -d $(DESTDIR)$$i; then \
993				echo "Creating directory $$i"; \
994				$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
995			else    true; \
996			fi; \
997		done
998
999
1000# Install the interpreter by creating a symlink chain:
1001#  $(PYTHON) -> python2 -> python$(VERSION))
1002# Also create equivalent chains for other installed files
1003bininstall:	altbininstall
1004	if test ! -d $(DESTDIR)$(LIBPC); then \
1005		echo "Creating directory $(LIBPC)"; \
1006		$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC); \
1007	fi
1008	-if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
1009	then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
1010	else true; \
1011	fi
1012	(cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
1013	-rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)$(EXE)
1014	(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)$(EXE) python2$(DEBUG_SUFFIX)$(EXE))
1015	-rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)-config
1016	(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config python2$(DEBUG_SUFFIX)-config)
1017	-rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
1018	(cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)-config python$(DEBUG_SUFFIX)-config)
1019	-test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
1020	-rm -f $(DESTDIR)$(LIBPC)/python2$(DEBUG_SUFFIX).pc
1021	(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)$(DEBUG_SUFFIX).pc python2$(DEBUG_SUFFIX).pc)
1022	-rm -f $(DESTDIR)$(LIBPC)/python$(DEBUG_SUFFIX).pc
1023	(cd $(DESTDIR)$(LIBPC); $(LN) -s python2$(DEBUG_SUFFIX).pc python$(DEBUG_SUFFIX).pc)
1024
1025# Install the interpreter with $(VERSION) affixed
1026# This goes into $(exec_prefix)
1027altbininstall:	$(BUILDPYTHON)
1028	@for i in $(BINDIR) $(LIBDIR); \
1029	do \
1030		if test ! -d $(DESTDIR)$$i; then \
1031			echo "Creating directory $$i"; \
1032			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1033		else	true; \
1034		fi; \
1035	done
1036	$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
1037	if test -f $(LDLIBRARY); then \
1038		if test -n "$(DLLLIBRARY)" ; then \
1039			$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
1040		else \
1041			$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
1042			if test $(LDLIBRARY) != $(INSTSONAME); then \
1043				(cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
1044			fi \
1045		fi; \
1046	else	true; \
1047	fi
1048
1049# Install the versioned manual page
1050altmaninstall:
1051	@for i in $(MANDIR) $(MANDIR)/man1; \
1052	do \
1053		if test ! -d $(DESTDIR)$$i; then \
1054			echo "Creating directory $$i"; \
1055			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1056		else	true; \
1057		fi; \
1058	done
1059	$(INSTALL_DATA) $(srcdir)/Misc/python.man \
1060		$(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
1061
1062# Install the unversioned manual pages
1063maninstall:	altmaninstall
1064	-rm -f $(DESTDIR)$(MANDIR)/man1/python2.1
1065	(cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python2.1)
1066	-rm -f $(DESTDIR)$(MANDIR)/man1/python.1
1067	(cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python2.1 python.1)
1068
1069# Install the library
1070PLATDIR=	plat-linux2
1071EXTRAPLATDIR=
1072EXTRAMACHDEPPATH=
1073MACHDEPS=	$(PLATDIR) $(EXTRAPLATDIR)
1074XMLLIBSUBDIRS=  xml xml/dom xml/etree xml/parsers xml/sax
1075PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
1076	plat-mac/lib-scriptpackages/_builtinSuites \
1077	plat-mac/lib-scriptpackages/CodeWarrior \
1078	plat-mac/lib-scriptpackages/Explorer \
1079	plat-mac/lib-scriptpackages/Finder \
1080	plat-mac/lib-scriptpackages/Netscape \
1081	plat-mac/lib-scriptpackages/StdSuites \
1082	plat-mac/lib-scriptpackages/SystemEvents \
1083	plat-mac/lib-scriptpackages/Terminal
1084PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
1085LIBSUBDIRS=	lib-tk lib-tk/test lib-tk/test/test_tkinter \
1086		lib-tk/test/test_ttk site-packages test test/audiodata test/capath \
1087		test/data test/cjkencodings test/decimaltestdata test/xmltestdata \
1088		test/imghdrdata \
1089		test/subprocessdata \
1090		test/support \
1091		test/tracedmodules \
1092		encodings compiler hotshot \
1093		email email/mime email/test email/test/data \
1094		ensurepip ensurepip/_bundled \
1095		json json/tests \
1096		sqlite3 sqlite3/test \
1097		logging bsddb bsddb/test csv importlib wsgiref \
1098		lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
1099		lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
1100		ctypes ctypes/test ctypes/macholib \
1101		idlelib idlelib/Icons idlelib/idle_test \
1102		distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
1103		multiprocessing multiprocessing/dummy \
1104		unittest unittest/test \
1105		lib-old \
1106		curses pydoc_data $(MACHDEPS)
1107libinstall:	build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
1108	@for i in $(SCRIPTDIR) $(LIBDEST); \
1109	do \
1110		if test ! -d $(DESTDIR)$$i; then \
1111			echo "Creating directory $$i"; \
1112			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1113		else	true; \
1114		fi; \
1115	done
1116	@for d in $(LIBSUBDIRS); \
1117	do \
1118		a=$(srcdir)/Lib/$$d; \
1119		if test ! -d $$a; then continue; else true; fi; \
1120		b=$(LIBDEST)/$$d; \
1121		if test ! -d $(DESTDIR)$$b; then \
1122			echo "Creating directory $$b"; \
1123			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
1124		else	true; \
1125		fi; \
1126	done
1127	@for i in $(srcdir)/Lib/*.py `cat pybuilddir.txt`/_sysconfigdata.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
1128	do \
1129		if test -x $$i; then \
1130			$(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
1131			echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
1132		else \
1133			$(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
1134			echo $(INSTALL_DATA) $$i $(LIBDEST); \
1135		fi; \
1136	done
1137	@for d in $(LIBSUBDIRS); \
1138	do \
1139		a=$(srcdir)/Lib/$$d; \
1140		if test ! -d $$a; then continue; else true; fi; \
1141		if test `ls $$a | wc -l` -lt 1; then continue; fi; \
1142		b=$(LIBDEST)/$$d; \
1143		for i in $$a/*; \
1144		do \
1145			case $$i in \
1146			*CVS) ;; \
1147			*.py[co]) ;; \
1148			*.orig) ;; \
1149			*~) ;; \
1150			*) \
1151				if test -d $$i; then continue; fi; \
1152				if test -x $$i; then \
1153				    echo $(INSTALL_SCRIPT) $$i $$b; \
1154				    $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
1155				else \
1156				    echo $(INSTALL_DATA) $$i $$b; \
1157				    $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
1158				fi;; \
1159			esac; \
1160		done; \
1161	done
1162	$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
1163	if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
1164		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
1165			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
1166	fi
1167	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
1168		$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
1169		-d $(LIBDEST) -f \
1170		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
1171		$(DESTDIR)$(LIBDEST)
1172	PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
1173		$(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
1174		-d $(LIBDEST) -f \
1175		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
1176		$(DESTDIR)$(LIBDEST)
1177	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
1178		$(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
1179		-d $(LIBDEST)/site-packages -f \
1180		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
1181	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
1182		$(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
1183		-d $(LIBDEST)/site-packages -f \
1184		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
1185	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
1186		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
1187	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
1188		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
1189
1190# Create the PLATDIR source directory, if one wasn't distributed..
1191$(srcdir)/Lib/$(PLATDIR):
1192	mkdir $(srcdir)/Lib/$(PLATDIR)
1193	cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
1194	export PATH; PATH="`pwd`:$$PATH"; \
1195	export PYTHONPATH; PYTHONPATH="$(srcdir)/Lib:$(abs_builddir)/`cat pybuilddir.txt`"; \
1196	export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
1197	export EXE; EXE="$(BUILDEXE)"; \
1198	if [ -n "$(MULTIARCH)" ]; then export MULTIARCH; MULTIARCH=$(MULTIARCH); fi; \
1199	export PYTHON_FOR_BUILD; \
1200	if [ "$(build)" = "$(host)" ]; then \
1201	  PYTHON_FOR_BUILD="$(BUILDPYTHON)"; \
1202	else \
1203	  PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)"; \
1204	fi; \
1205	cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
1206
1207python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
1208	# Substitution happens here, as the completely-expanded BINDIR
1209	# is not available in configure
1210	sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," < $(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
1211
1212
1213# Install the include files
1214INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
1215inclinstall:
1216	@for i in $(INCLDIRSTOMAKE); \
1217	do \
1218		if test ! -d $(DESTDIR)$$i; then \
1219			echo "Creating directory $$i"; \
1220			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1221		else	true; \
1222		fi; \
1223	done
1224	@for i in $(srcdir)/Include/*.h; \
1225	do \
1226		echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
1227		$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
1228	done
1229	$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
1230
1231# Install the library and miscellaneous stuff needed for extending/embedding
1232# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
1233LIBPL=		$(LIBP)/config$(DEBUG_SUFFIX)
1234
1235# pkgconfig directory
1236LIBPC=		$(LIBDIR)/pkgconfig
1237
1238libainstall:	build_all python$(DEBUG_SUFFIX)-config
1239	@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
1240	do \
1241		if test ! -d $(DESTDIR)$$i; then \
1242			echo "Creating directory $$i"; \
1243			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1244		else	true; \
1245		fi; \
1246	done
1247	$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
1248	$(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
1249	$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
1250	$(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
1251	$(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
1252	$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
1253	$(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
1254	$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)$(DEBUG_SUFFIX).pc
1255	$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
1256	$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
1257	$(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config $(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
1258	@if [ -s Modules/python.exp -a \
1259		"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
1260		echo; echo "Installing support files for building shared extension modules on AIX:"; \
1261		$(INSTALL_DATA) Modules/python.exp		\
1262				$(DESTDIR)$(LIBPL)/python.exp;		\
1263		echo; echo "$(LIBPL)/python.exp";		\
1264		$(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix	\
1265				$(DESTDIR)$(LIBPL)/makexp_aix;		\
1266		echo "$(LIBPL)/makexp_aix";			\
1267		$(INSTALL_SCRIPT) Modules/ld_so_aix	\
1268				$(DESTDIR)$(LIBPL)/ld_so_aix;		\
1269		echo "$(LIBPL)/ld_so_aix";			\
1270		echo; echo "See Misc/AIX-NOTES for details.";	\
1271	else true; \
1272	fi
1273	@case "$(MACHDEP)" in beos*) \
1274		echo; echo "Installing support files for building shared extension modules on BeOS:"; \
1275		$(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README;	\
1276		echo; echo "$(LIBPL)/README";			\
1277		$(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
1278		echo "$(LIBPL)/ar_beos";			\
1279		$(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
1280		echo "$(LIBPL)/ld_so_beos";			\
1281		echo; echo "See Misc/BeOS-NOTES for details.";	\
1282		;; \
1283	esac
1284
1285# Install the dynamically loadable modules
1286# This goes into $(exec_prefix)
1287sharedinstall: sharedmods
1288	$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
1289	   	--prefix=$(prefix) \
1290		--install-scripts=$(BINDIR) \
1291		--install-platlib=$(DESTSHARED) \
1292		--root=$(DESTDIR)/
1293	-rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py*
1294
1295# Here are a couple of targets for MacOSX again, to install a full
1296# framework-based Python. frameworkinstall installs everything, the
1297# subtargets install specific parts. Much of the actual work is offloaded to
1298# the Makefile in Mac
1299#
1300#
1301# This target is here for backward compatibility, previous versions of Python
1302# hadn't integrated framework installation in the normal install process.
1303frameworkinstall: install
1304
1305# On install, we re-make the framework
1306# structure in the install location, /Library/Frameworks/ or the argument to
1307# --enable-framework. If --enable-framework has been specified then we have
1308# automatically set prefix to the location deep down in the framework, so we
1309# only have to cater for the structural bits of the framework.
1310
1311frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
1312
1313frameworkinstallstructure:	$(LDLIBRARY)
1314	@if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
1315		echo Not configured with --enable-framework; \
1316		exit 1; \
1317	else true; \
1318	fi
1319	@for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
1320		if test ! -d $(DESTDIR)$$i; then \
1321			echo "Creating directory $(DESTDIR)$$i"; \
1322			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1323		else	true; \
1324		fi; \
1325	done
1326	$(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
1327	sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
1328	$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
1329	$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
1330	$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
1331	$(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
1332	$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
1333
1334# This installs Mac/Lib into the framework
1335# Install a number of symlinks to keep software that expects a normal unix
1336# install (which includes python-config) happy.
1337frameworkinstallmaclib:
1338	ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
1339	ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).dylib"
1340	ln -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
1341	cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)"
1342
1343# This installs the IDE, the Launcher and other apps into /Applications
1344frameworkinstallapps:
1345	cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
1346
1347# This install the unix python and pythonw tools in /usr/local/bin
1348frameworkinstallunixtools:
1349	cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
1350
1351frameworkaltinstallunixtools:
1352	cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
1353
1354# This installs the Demos and Tools into the applications directory.
1355# It is not part of a normal frameworkinstall
1356frameworkinstallextras:
1357	cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
1358
1359# This installs a few of the useful scripts in Tools/scripts
1360scriptsinstall:
1361	SRCDIR=$(srcdir) $(RUNSHARED) \
1362	$(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
1363	--prefix=$(prefix) \
1364	--install-scripts=$(BINDIR) \
1365	--root=$(DESTDIR)/
1366
1367# Build the toplevel Makefile
1368Makefile.pre: Makefile.pre.in config.status
1369	CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
1370	$(MAKE) -f Makefile.pre Makefile
1371
1372# Run the configure script.
1373config.status:	$(srcdir)/configure
1374	$(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
1375
1376.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
1377
1378# Some make's put the object file in the current directory
1379.c.o:
1380	$(CC) -c $(PY_CFLAGS) -o $@ $<
1381
1382# Run reindent on the library
1383reindent:
1384	./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
1385
1386# Rerun configure with the same options as it was run last time,
1387# provided the config.status script exists
1388recheck:
1389	$(SHELL) config.status --recheck
1390	$(SHELL) config.status
1391
1392# Regenerate configure and pyconfig.h.in
1393.PHONY: autoconf
1394autoconf:
1395	# Regenerate the configure script from configure.ac using autoconf
1396	(cd $(srcdir); autoconf)
1397	# Regenerate pyconfig.h.in from configure.ac using autoheader
1398	(cd $(srcdir); autoheader)
1399
1400# Create a tags file for vi
1401tags::
1402	ctags -w $(srcdir)/Include/*.h
1403	for i in $(SRCDIRS); do ctags -f tags -w -a $(srcdir)/$$i/*.[ch]; done
1404	ctags -f tags -w -a $(srcdir)/Modules/_ctypes/*.[ch]
1405	LC_ALL=C sort -o tags tags
1406
1407# Create a tags file for GNU Emacs
1408TAGS::
1409	cd $(srcdir); \
1410	etags Include/*.h; \
1411	for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
1412
1413# Sanitation targets -- clean leaves libraries, executables and tags
1414# files, which clobber removes as well
1415pycremoval:
1416	find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
1417
1418clean: pycremoval
1419	find . -name '*.[oa]' -exec rm -f {} ';'
1420	find . -name '*.s[ol]' -exec rm -f {} ';'
1421	find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
1422	find build -name 'fficonfig.h' -exec rm -f {} ';' || true
1423	find build -name 'fficonfig.py' -exec rm -f {} ';' || true
1424	-rm -f Lib/lib2to3/*Grammar*.pickle
1425	-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
1426
1427profile-removal:
1428	find . -name '*.gc??' -exec rm -f {} ';'
1429	find . -name '*.profclang?' -exec rm -f {} ';'
1430	find . -name '*.dyn' -exec rm -f {} ';'
1431
1432clobber: clean profile-removal
1433	-rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1434		tags TAGS \
1435		config.cache config.log pyconfig.h Modules/config.c
1436	-rm -rf build platform
1437	-rm -rf $(PYTHONFRAMEWORKDIR)
1438
1439# Make things extra clean, before making a distribution:
1440# remove all generated files, even Makefile[.pre]
1441# Keep configure and Python-ast.[ch], it's possible they can't be generated
1442distclean: clobber
1443	for file in Lib/test/data/* ; do \
1444	    if test "$$file" != "Lib/test/data/README"; then rm "$$file"; fi; \
1445	done
1446	-rm -f core Makefile Makefile.pre config.status \
1447		Modules/Setup Modules/Setup.local Modules/Setup.config \
1448		Modules/ld_so_aix Modules/python.exp Misc/python.pc
1449	-rm -f python*-gdb.py
1450	-rm -f pybuilddir.txt
1451	# Issue #28258: set LC_ALL to avoid issues with Estonian locale.
1452	# Expansion is performed here by shell (spawned by make) itself before
1453	# arguments are passed to find. So LC_ALL=C must be set as a separate
1454	# command.
1455	LC_ALL=C; find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o -name '*~' \
1456				     -o -name '[@,#]*' -o -name '*.old' \
1457				     -o -name '*.orig' -o -name '*.rej' \
1458				     -o -name '*.bak' ')' \
1459				     -exec rm -f {} ';'
1460
1461# Check for smelly exported symbols (not starting with Py/_Py)
1462smelly: build_all
1463	nm -p $(LIBRARY) | \
1464		sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1465
1466# Find files with funny names
1467funny:
1468	find $(SUBDIRS) $(SUBDIRSTOO) -type d \
1469		-o -name '*.[chs]' \
1470		-o -name '*.py' \
1471		-o -name '*.doc' \
1472		-o -name '*.sty' \
1473		-o -name '*.bib' \
1474		-o -name '*.dat' \
1475		-o -name '*.el' \
1476		-o -name '*.fd' \
1477		-o -name '*.in' \
1478		-o -name '*.tex' \
1479		-o -name '*,[vpt]' \
1480		-o -name 'Setup' \
1481		-o -name 'Setup.*' \
1482		-o -name README \
1483		-o -name Makefile \
1484		-o -name ChangeLog \
1485		-o -name Repository \
1486		-o -name Root \
1487		-o -name Entries \
1488		-o -name Tag \
1489		-o -name tags \
1490		-o -name TAGS \
1491		-o -name .cvsignore \
1492		-o -name MANIFEST \
1493		-o -print
1494
1495# Perform some verification checks on any modified files.
1496patchcheck:
1497	$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
1498
1499# Dependencies
1500
1501Python/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
1502
1503# Declare targets that aren't real files
1504.PHONY: all build_all sharedmods check-clean-src oldsharedmods test quicktest memtest
1505.PHONY: install altinstall oldsharedinstall bininstall altbininstall
1506.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1507.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1508.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1509.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
1510.PHONY: smelly funny patchcheck altmaninstall commoninstall buildinclude
1511.PHONY: gdbhooks
1512
1513# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
1514
1515# Rules appended by makedepend
1516
1517Modules/threadmodule.o: $(srcdir)/Modules/threadmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/threadmodule.c -o Modules/threadmodule.o
1518Modules/threadmodule$(DEBUG_EXT)$(SO):  Modules/threadmodule.o; $(BLDSHARED)  Modules/threadmodule.o   -o Modules/threadmodule$(DEBUG_EXT)$(SO)
1519Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o
1520Modules/signalmodule$(DEBUG_EXT)$(SO):  Modules/signalmodule.o; $(BLDSHARED)  Modules/signalmodule.o   -o Modules/signalmodule$(DEBUG_EXT)$(SO)
1521Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o
1522Modules/posixmodule$(DEBUG_EXT)$(SO):  Modules/posixmodule.o; $(BLDSHARED)  Modules/posixmodule.o   -o Modules/posixmodule$(DEBUG_EXT)$(SO)
1523Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o
1524Modules/errnomodule$(DEBUG_EXT)$(SO):  Modules/errnomodule.o; $(BLDSHARED)  Modules/errnomodule.o   -o Modules/errnomodule$(DEBUG_EXT)$(SO)
1525Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/pwdmodule.c -o Modules/pwdmodule.o
1526Modules/pwdmodule$(DEBUG_EXT)$(SO):  Modules/pwdmodule.o; $(BLDSHARED)  Modules/pwdmodule.o   -o Modules/pwdmodule$(DEBUG_EXT)$(SO)
1527Modules/_sre.o: $(srcdir)/Modules/_sre.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/_sre.c -o Modules/_sre.o
1528Modules/_sre$(DEBUG_EXT)$(SO):  Modules/_sre.o; $(BLDSHARED)  Modules/_sre.o   -o Modules/_sre$(DEBUG_EXT)$(SO)
1529Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o
1530Modules/_codecsmodule$(DEBUG_EXT)$(SO):  Modules/_codecsmodule.o; $(BLDSHARED)  Modules/_codecsmodule.o   -o Modules/_codecsmodule$(DEBUG_EXT)$(SO)
1531Modules/_weakref.o: $(srcdir)/Modules/_weakref.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/_weakref.c -o Modules/_weakref.o
1532Modules/_weakref$(DEBUG_EXT)$(SO):  Modules/_weakref.o; $(BLDSHARED)  Modules/_weakref.o   -o Modules/_weakref$(DEBUG_EXT)$(SO)
1533Modules/zipimport.o: $(srcdir)/Modules/zipimport.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/zipimport.c -o Modules/zipimport.o
1534Modules/zipimport$(DEBUG_EXT)$(SO):  Modules/zipimport.o; $(BLDSHARED)  Modules/zipimport.o   -o Modules/zipimport$(DEBUG_EXT)$(SO)
1535Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o
1536Modules/_symtablemodule$(DEBUG_EXT)$(SO):  Modules/symtablemodule.o; $(BLDSHARED)  Modules/symtablemodule.o   -o Modules/_symtablemodule$(DEBUG_EXT)$(SO)
1537Modules/readline.o: $(srcdir)/Modules/readline.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/readline.c -o Modules/readline.o
1538Modules/readline$(DEBUG_EXT)$(SO):  Modules/readline.o; $(BLDSHARED)  Modules/readline.o  -lreadline -ltermcap  -o Modules/readline$(DEBUG_EXT)$(SO)
1539Modules/arraymodule.o: $(srcdir)/Modules/arraymodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/arraymodule.c -o Modules/arraymodule.o
1540Modules/arraymodule$(DEBUG_EXT)$(SO):  Modules/arraymodule.o; $(BLDSHARED)  Modules/arraymodule.o   -o Modules/arraymodule$(DEBUG_EXT)$(SO)
1541Modules/cmathmodule.o: $(srcdir)/Modules/cmathmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cmathmodule.c -o Modules/cmathmodule.o
1542Modules/_math.o: $(srcdir)/Modules/_math.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_math.c -o Modules/_math.o
1543Modules/cmathmodule$(DEBUG_EXT)$(SO):  Modules/cmathmodule.o Modules/_math.o; $(BLDSHARED)  Modules/cmathmodule.o Modules/_math.o   -o Modules/cmathmodule$(DEBUG_EXT)$(SO)
1544Modules/mathmodule.o: $(srcdir)/Modules/mathmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/mathmodule.c -o Modules/mathmodule.o
1545Modules/_math.o: $(srcdir)/Modules/_math.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_math.c -o Modules/_math.o
1546Modules/math$(DEBUG_EXT)$(SO):  Modules/mathmodule.o Modules/_math.o; $(BLDSHARED)  Modules/mathmodule.o Modules/_math.o   -o Modules/math$(DEBUG_EXT)$(SO)
1547Modules/_struct.o: $(srcdir)/Modules/_struct.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_struct.c -o Modules/_struct.o
1548Modules/_struct$(DEBUG_EXT)$(SO):  Modules/_struct.o; $(BLDSHARED)  Modules/_struct.o   -o Modules/_struct$(DEBUG_EXT)$(SO)
1549Modules/timemodule.o: $(srcdir)/Modules/timemodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/timemodule.c -o Modules/timemodule.o
1550Modules/timemodule$(DEBUG_EXT)$(SO):  Modules/timemodule.o; $(BLDSHARED)  Modules/timemodule.o   -o Modules/timemodule$(DEBUG_EXT)$(SO)
1551Modules/operator.o: $(srcdir)/Modules/operator.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/operator.c -o Modules/operator.o
1552Modules/operator$(DEBUG_EXT)$(SO):  Modules/operator.o; $(BLDSHARED)  Modules/operator.o   -o Modules/operator$(DEBUG_EXT)$(SO)
1553Modules/_testcapimodule.o: $(srcdir)/Modules/_testcapimodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_testcapimodule.c -o Modules/_testcapimodule.o
1554Modules/_testcapimodule$(DEBUG_EXT)$(SO):  Modules/_testcapimodule.o; $(BLDSHARED)  Modules/_testcapimodule.o   -o Modules/_testcapimodule$(DEBUG_EXT)$(SO)
1555Modules/_randommodule.o: $(srcdir)/Modules/_randommodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_randommodule.c -o Modules/_randommodule.o
1556Modules/_randommodule$(DEBUG_EXT)$(SO):  Modules/_randommodule.o; $(BLDSHARED)  Modules/_randommodule.o   -o Modules/_randommodule$(DEBUG_EXT)$(SO)
1557Modules/_collectionsmodule.o: $(srcdir)/Modules/_collectionsmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_collectionsmodule.c -o Modules/_collectionsmodule.o
1558Modules/_collectionsmodule$(DEBUG_EXT)$(SO):  Modules/_collectionsmodule.o; $(BLDSHARED)  Modules/_collectionsmodule.o   -o Modules/_collectionsmodule$(DEBUG_EXT)$(SO)
1559Modules/itertoolsmodule.o: $(srcdir)/Modules/itertoolsmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/itertoolsmodule.c -o Modules/itertoolsmodule.o
1560Modules/itertoolsmodule$(DEBUG_EXT)$(SO):  Modules/itertoolsmodule.o; $(BLDSHARED)  Modules/itertoolsmodule.o   -o Modules/itertoolsmodule$(DEBUG_EXT)$(SO)
1561Modules/stropmodule.o: $(srcdir)/Modules/stropmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/stropmodule.c -o Modules/stropmodule.o
1562Modules/stropmodule$(DEBUG_EXT)$(SO):  Modules/stropmodule.o; $(BLDSHARED)  Modules/stropmodule.o   -o Modules/stropmodule$(DEBUG_EXT)$(SO)
1563Modules/_functoolsmodule.o: $(srcdir)/Modules/_functoolsmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_functoolsmodule.c -o Modules/_functoolsmodule.o
1564Modules/_functoolsmodule$(DEBUG_EXT)$(SO):  Modules/_functoolsmodule.o; $(BLDSHARED)  Modules/_functoolsmodule.o   -o Modules/_functoolsmodule$(DEBUG_EXT)$(SO)
1565Modules/_bisectmodule.o: $(srcdir)/Modules/_bisectmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_bisectmodule.c -o Modules/_bisectmodule.o
1566Modules/_bisectmodule$(DEBUG_EXT)$(SO):  Modules/_bisectmodule.o; $(BLDSHARED)  Modules/_bisectmodule.o   -o Modules/_bisectmodule$(DEBUG_EXT)$(SO)
1567Modules/unicodedata.o: $(srcdir)/Modules/unicodedata.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/unicodedata.c -o Modules/unicodedata.o
1568Modules/unicodedata$(DEBUG_EXT)$(SO):  Modules/unicodedata.o; $(BLDSHARED)  Modules/unicodedata.o   -o Modules/unicodedata$(DEBUG_EXT)$(SO)
1569Modules/_localemodule.o: $(srcdir)/Modules/_localemodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_localemodule.c -o Modules/_localemodule.o
1570Modules/_localemodule$(DEBUG_EXT)$(SO):  Modules/_localemodule.o; $(BLDSHARED)  Modules/_localemodule.o   -o Modules/_localemodule$(DEBUG_EXT)$(SO)
1571Modules/fcntlmodule.o: $(srcdir)/Modules/fcntlmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/fcntlmodule.c -o Modules/fcntlmodule.o
1572Modules/fcntlmodule$(DEBUG_EXT)$(SO):  Modules/fcntlmodule.o; $(BLDSHARED)  Modules/fcntlmodule.o   -o Modules/fcntlmodule$(DEBUG_EXT)$(SO)
1573Modules/spwdmodule.o: $(srcdir)/Modules/spwdmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/spwdmodule.c -o Modules/spwdmodule.o
1574Modules/spwdmodule$(DEBUG_EXT)$(SO):  Modules/spwdmodule.o; $(BLDSHARED)  Modules/spwdmodule.o   -o Modules/spwdmodule$(DEBUG_EXT)$(SO)
1575Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/grpmodule.c -o Modules/grpmodule.o
1576Modules/grpmodule$(DEBUG_EXT)$(SO):  Modules/grpmodule.o; $(BLDSHARED)  Modules/grpmodule.o   -o Modules/grpmodule$(DEBUG_EXT)$(SO)
1577Modules/selectmodule.o: $(srcdir)/Modules/selectmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/selectmodule.c -o Modules/selectmodule.o
1578Modules/selectmodule$(DEBUG_EXT)$(SO):  Modules/selectmodule.o; $(BLDSHARED)  Modules/selectmodule.o   -o Modules/selectmodule$(DEBUG_EXT)$(SO)
1579Modules/mmapmodule.o: $(srcdir)/Modules/mmapmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/mmapmodule.c -o Modules/mmapmodule.o
1580Modules/mmapmodule$(DEBUG_EXT)$(SO):  Modules/mmapmodule.o; $(BLDSHARED)  Modules/mmapmodule.o   -o Modules/mmapmodule$(DEBUG_EXT)$(SO)
1581Modules/_csv.o: $(srcdir)/Modules/_csv.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_csv.c -o Modules/_csv.o
1582Modules/_csv$(DEBUG_EXT)$(SO):  Modules/_csv.o; $(BLDSHARED)  Modules/_csv.o   -o Modules/_csv$(DEBUG_EXT)$(SO)
1583Modules/socketmodule.o: $(srcdir)/Modules/socketmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/socketmodule.c -o Modules/socketmodule.o
1584Modules/timemodule.o: $(srcdir)/Modules/timemodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/timemodule.c -o Modules/timemodule.o
1585Modules/_socketmodule$(DEBUG_EXT)$(SO):  Modules/socketmodule.o Modules/timemodule.o; $(BLDSHARED)  Modules/socketmodule.o Modules/timemodule.o   -o Modules/_socketmodule$(DEBUG_EXT)$(SO)
1586Modules/_ssl.o: $(srcdir)/Modules/_ssl.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl -c $(srcdir)/Modules/_ssl.c -o Modules/_ssl.o
1587Modules/_ssl$(DEBUG_EXT)$(SO):  Modules/_ssl.o; $(BLDSHARED)  Modules/_ssl.o  -L$(SSL)/lib -lssl -lcrypto  -o Modules/_ssl$(DEBUG_EXT)$(SO)
1588Modules/_cryptmodule.o: $(srcdir)/Modules/_cryptmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/_cryptmodule.c -o Modules/_cryptmodule.o
1589Modules/_cryptmodule$(DEBUG_EXT)$(SO):  Modules/_cryptmodule.o; $(BLDSHARED)  Modules/_cryptmodule.o  -lcrypt  -o Modules/_cryptmodule$(DEBUG_EXT)$(SO)
1590Modules/nismodule.o: $(srcdir)/Modules/nismodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -I/usr/include/tirpc -I/usr/include/nsl -c $(srcdir)/Modules/nismodule.c -o Modules/nismodule.o
1591Modules/nismodule$(DEBUG_EXT)$(SO):  Modules/nismodule.o; $(BLDSHARED)  Modules/nismodule.o  -lnsl -ltirpc -L/usr/lib64/nsl  -o Modules/nismodule$(DEBUG_EXT)$(SO)
1592Modules/termios.o: $(srcdir)/Modules/termios.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/termios.c -o Modules/termios.o
1593Modules/termios$(DEBUG_EXT)$(SO):  Modules/termios.o; $(BLDSHARED)  Modules/termios.o   -o Modules/termios$(DEBUG_EXT)$(SO)
1594Modules/resource.o: $(srcdir)/Modules/resource.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/resource.c -o Modules/resource.o
1595Modules/resource$(DEBUG_EXT)$(SO):  Modules/resource.o; $(BLDSHARED)  Modules/resource.o   -o Modules/resource$(DEBUG_EXT)$(SO)
1596Modules/audioop.o: $(srcdir)/Modules/audioop.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/audioop.c -o Modules/audioop.o
1597Modules/audioop$(DEBUG_EXT)$(SO):  Modules/audioop.o; $(BLDSHARED)  Modules/audioop.o   -o Modules/audioop$(DEBUG_EXT)$(SO)
1598Modules/imageop.o: $(srcdir)/Modules/imageop.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/imageop.c -o Modules/imageop.o
1599Modules/imageop$(DEBUG_EXT)$(SO):  Modules/imageop.o; $(BLDSHARED)  Modules/imageop.o   -o Modules/imageop$(DEBUG_EXT)$(SO)
1600Modules/md5module.o: $(srcdir)/Modules/md5module.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/md5module.c -o Modules/md5module.o
1601Modules/md5.o: $(srcdir)/Modules/md5.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/md5.c -o Modules/md5.o
1602Modules/_md5module$(DEBUG_EXT)$(SO):  Modules/md5module.o Modules/md5.o; $(BLDSHARED)  Modules/md5module.o Modules/md5.o   -o Modules/_md5module$(DEBUG_EXT)$(SO)
1603Modules/shamodule.o: $(srcdir)/Modules/shamodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/shamodule.c -o Modules/shamodule.o
1604Modules/_shamodule$(DEBUG_EXT)$(SO):  Modules/shamodule.o; $(BLDSHARED)  Modules/shamodule.o   -o Modules/_shamodule$(DEBUG_EXT)$(SO)
1605Modules/sha256module.o: $(srcdir)/Modules/sha256module.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/sha256module.c -o Modules/sha256module.o
1606Modules/_sha256module$(DEBUG_EXT)$(SO):  Modules/sha256module.o; $(BLDSHARED)  Modules/sha256module.o   -o Modules/_sha256module$(DEBUG_EXT)$(SO)
1607Modules/sha512module.o: $(srcdir)/Modules/sha512module.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/sha512module.c -o Modules/sha512module.o
1608Modules/_sha512module$(DEBUG_EXT)$(SO):  Modules/sha512module.o; $(BLDSHARED)  Modules/sha512module.o   -o Modules/_sha512module$(DEBUG_EXT)$(SO)
1609Modules/linuxaudiodev.o: $(srcdir)/Modules/linuxaudiodev.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/linuxaudiodev.c -o Modules/linuxaudiodev.o
1610Modules/linuxaudiodev$(DEBUG_EXT)$(SO):  Modules/linuxaudiodev.o; $(BLDSHARED)  Modules/linuxaudiodev.o   -o Modules/linuxaudiodev$(DEBUG_EXT)$(SO)
1611Modules/timingmodule.o: $(srcdir)/Modules/timingmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/timingmodule.c -o Modules/timingmodule.o
1612Modules/timingmodule$(DEBUG_EXT)$(SO):  Modules/timingmodule.o; $(BLDSHARED)  Modules/timingmodule.o   -o Modules/timingmodule$(DEBUG_EXT)$(SO)
1613Modules/_tkinter.o: $(srcdir)/Modules/_tkinter.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -DWITH_APPINIT -DWITH_TIX -c $(srcdir)/Modules/_tkinter.c -o Modules/_tkinter.o
1614Modules/tkappinit.o: $(srcdir)/Modules/tkappinit.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -DWITH_APPINIT -DWITH_TIX -c $(srcdir)/Modules/tkappinit.c -o Modules/tkappinit.o
1615Modules/_tkinter$(DEBUG_EXT)$(SO):  Modules/_tkinter.o Modules/tkappinit.o; $(BLDSHARED)  Modules/_tkinter.o Modules/tkappinit.o  -ltix -ltk -ltcl -lX11  -o Modules/_tkinter$(DEBUG_EXT)$(SO)
1616Modules/dlmodule.o: $(srcdir)/Modules/dlmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/dlmodule.c -o Modules/dlmodule.o
1617Modules/dlmodule$(DEBUG_EXT)$(SO):  Modules/dlmodule.o; $(BLDSHARED)  Modules/dlmodule.o   -o Modules/dlmodule$(DEBUG_EXT)$(SO)
1618Modules/gdbmmodule.o: $(srcdir)/Modules/gdbmmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/gdbmmodule.c -o Modules/gdbmmodule.o
1619Modules/gdbmmodule$(DEBUG_EXT)$(SO):  Modules/gdbmmodule.o; $(BLDSHARED)  Modules/gdbmmodule.o  -lgdbm  -o Modules/gdbmmodule$(DEBUG_EXT)$(SO)
1620Modules/_bsddb.o: $(srcdir)/Modules/_bsddb.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -I$(DBINC) -c $(srcdir)/Modules/_bsddb.c -o Modules/_bsddb.o
1621Modules/_bsddb$(DEBUG_EXT)$(SO):  Modules/_bsddb.o; $(BLDSHARED)  Modules/_bsddb.o  -L$(DBLIB) -ldb  -o Modules/_bsddb$(DEBUG_EXT)$(SO)
1622Modules/binascii.o: $(srcdir)/Modules/binascii.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/binascii.c -o Modules/binascii.o
1623Modules/binascii$(DEBUG_EXT)$(SO):  Modules/binascii.o; $(BLDSHARED)  Modules/binascii.o   -o Modules/binascii$(DEBUG_EXT)$(SO)
1624Modules/parsermodule.o: $(srcdir)/Modules/parsermodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/parsermodule.c -o Modules/parsermodule.o
1625Modules/parsermodule$(DEBUG_EXT)$(SO):  Modules/parsermodule.o; $(BLDSHARED)  Modules/parsermodule.o   -o Modules/parsermodule$(DEBUG_EXT)$(SO)
1626Modules/cStringIO.o: $(srcdir)/Modules/cStringIO.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cStringIO.c -o Modules/cStringIO.o
1627Modules/cStringIO$(DEBUG_EXT)$(SO):  Modules/cStringIO.o; $(BLDSHARED)  Modules/cStringIO.o   -o Modules/cStringIO$(DEBUG_EXT)$(SO)
1628Modules/cPickle.o: $(srcdir)/Modules/cPickle.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cPickle.c -o Modules/cPickle.o
1629Modules/cPickle$(DEBUG_EXT)$(SO):  Modules/cPickle.o; $(BLDSHARED)  Modules/cPickle.o   -o Modules/cPickle$(DEBUG_EXT)$(SO)
1630Modules/zlibmodule.o: $(srcdir)/Modules/zlibmodule.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -I$(prefix)/include -c $(srcdir)/Modules/zlibmodule.c -o Modules/zlibmodule.o
1631Modules/zlibmodule$(DEBUG_EXT)$(SO):  Modules/zlibmodule.o; $(BLDSHARED)  Modules/zlibmodule.o  -L$(exec_prefix)/lib64 -lz  -o Modules/zlibmodule$(DEBUG_EXT)$(SO)
1632Modules/multibytecodec.o: $(srcdir)/Modules/cjkcodecs/multibytecodec.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cjkcodecs/multibytecodec.c -o Modules/multibytecodec.o
1633Modules/_multibytecodecmodule$(DEBUG_EXT)$(SO):  Modules/multibytecodec.o; $(BLDSHARED)  Modules/multibytecodec.o   -o Modules/_multibytecodecmodule$(DEBUG_EXT)$(SO)
1634Modules/_codecs_cn.o: $(srcdir)/Modules/cjkcodecs/_codecs_cn.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cjkcodecs/_codecs_cn.c -o Modules/_codecs_cn.o
1635Modules/_codecs_cn$(DEBUG_EXT)$(SO):  Modules/_codecs_cn.o; $(BLDSHARED)  Modules/_codecs_cn.o   -o Modules/_codecs_cn$(DEBUG_EXT)$(SO)
1636Modules/_codecs_hk.o: $(srcdir)/Modules/cjkcodecs/_codecs_hk.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cjkcodecs/_codecs_hk.c -o Modules/_codecs_hk.o
1637Modules/_codecs_hk$(DEBUG_EXT)$(SO):  Modules/_codecs_hk.o; $(BLDSHARED)  Modules/_codecs_hk.o   -o Modules/_codecs_hk$(DEBUG_EXT)$(SO)
1638Modules/_codecs_iso2022.o: $(srcdir)/Modules/cjkcodecs/_codecs_iso2022.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cjkcodecs/_codecs_iso2022.c -o Modules/_codecs_iso2022.o
1639Modules/_codecs_iso2022$(DEBUG_EXT)$(SO):  Modules/_codecs_iso2022.o; $(BLDSHARED)  Modules/_codecs_iso2022.o   -o Modules/_codecs_iso2022$(DEBUG_EXT)$(SO)
1640Modules/_codecs_jp.o: $(srcdir)/Modules/cjkcodecs/_codecs_jp.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cjkcodecs/_codecs_jp.c -o Modules/_codecs_jp.o
1641Modules/_codecs_jp$(DEBUG_EXT)$(SO):  Modules/_codecs_jp.o; $(BLDSHARED)  Modules/_codecs_jp.o   -o Modules/_codecs_jp$(DEBUG_EXT)$(SO)
1642Modules/_codecs_kr.o: $(srcdir)/Modules/cjkcodecs/_codecs_kr.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cjkcodecs/_codecs_kr.c -o Modules/_codecs_kr.o
1643Modules/_codecs_kr$(DEBUG_EXT)$(SO):  Modules/_codecs_kr.o; $(BLDSHARED)  Modules/_codecs_kr.o   -o Modules/_codecs_kr$(DEBUG_EXT)$(SO)
1644Modules/_codecs_tw.o: $(srcdir)/Modules/cjkcodecs/_codecs_tw.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/cjkcodecs/_codecs_tw.c -o Modules/_codecs_tw.o
1645Modules/_codecs_tw$(DEBUG_EXT)$(SO):  Modules/_codecs_tw.o; $(BLDSHARED)  Modules/_codecs_tw.o   -o Modules/_codecs_tw$(DEBUG_EXT)$(SO)
1646Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c; $(CC) $(CCSHARED) $(CFLAGS) $(CPPFLAGS)  -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o
1647Modules/xxsubtype$(DEBUG_EXT)$(SO):  Modules/xxsubtype.o; $(BLDSHARED)  Modules/xxsubtype.o   -o Modules/xxsubtype$(DEBUG_EXT)$(SO)
1648