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