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