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