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