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