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@ |
| 30 | |
| 31 | CC= @CC@ |
| 32 | CXX= @CXX@ |
| 33 | LINKCC= @LINKCC@ |
| 34 | AR= @AR@ |
| 35 | RANLIB= @RANLIB@ |
| 36 | |
| 37 | # Shell used by make (some versions default to the login shell, which is bad) |
| 38 | SHELL= /bin/sh |
| 39 | |
| 40 | # Use this to make a link between python$(VERSION) and python in $(BINDIR) |
| 41 | LN= @LN@ |
| 42 | |
| 43 | # Portable install script (configure doesn't always guess right) |
| 44 | INSTALL= @INSTALL@ |
| 45 | INSTALL_PROGRAM=@INSTALL_PROGRAM@ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 46 | INSTALL_SCRIPT= @INSTALL_SCRIPT@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 47 | INSTALL_DATA= @INSTALL_DATA@ |
| 48 | # Shared libraries must be installed with executable mode on some systems; |
| 49 | # rather than figuring out exactly which, we always give them executable mode. |
| 50 | # Also, making them read-only seems to be a good idea... |
| 51 | INSTALL_SHARED= ${INSTALL} -m 555 |
| 52 | |
| 53 | MAKESETUP= $(srcdir)/Modules/makesetup |
| 54 | |
| 55 | # Compiler options |
| 56 | OPT= @OPT@ |
| 57 | DEFS= @DEFS@ |
Neil Schemenauer | 89e90d6 | 2001-06-02 06:16:02 +0000 | [diff] [blame] | 58 | CFLAGS= $(OPT) |
| 59 | CPPFLAGS= -I. -I$(srcdir)/Include $(DEFS) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 60 | LDFLAGS= @LDFLAGS@ |
| 61 | LDLAST= @LDLAST@ |
| 62 | SGI_ABI= @SGI_ABI@ |
Neil Schemenauer | 7ac954b | 2001-01-26 16:14:41 +0000 | [diff] [blame] | 63 | CCSHARED= @CCSHARED@ |
| 64 | LINKFORSHARED= @LINKFORSHARED@ |
| 65 | # Extra C flags added for building the interpreter object files. |
| 66 | CFLAGSFORSHARED=@CFLAGSFORSHARED@ |
| 67 | # C flags used for building the interpreter object files |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 68 | PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE |
Neil Schemenauer | 7ac954b | 2001-01-26 16:14:41 +0000 | [diff] [blame] | 69 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 70 | |
| 71 | # Machine-dependent subdirectories |
| 72 | MACHDEP= @MACHDEP@ |
| 73 | |
| 74 | # Install prefix for architecture-independent files |
| 75 | prefix= @prefix@ |
| 76 | |
| 77 | # Install prefix for architecture-dependent files |
| 78 | exec_prefix= @exec_prefix@ |
| 79 | |
| 80 | # Expanded directories |
| 81 | BINDIR= $(exec_prefix)/bin |
| 82 | LIBDIR= $(exec_prefix)/lib |
Martin v. Löwis | d429ab6 | 2001-08-02 06:20:20 +0000 | [diff] [blame] | 83 | MANDIR= @mandir@ |
| 84 | INCLUDEDIR= @includedir@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 85 | CONFINCLUDEDIR= $(exec_prefix)/include |
| 86 | SCRIPTDIR= $(prefix)/lib |
| 87 | |
| 88 | # Detailed destination directories |
| 89 | BINLIBDEST= $(LIBDIR)/python$(VERSION) |
| 90 | LIBDEST= $(SCRIPTDIR)/python$(VERSION) |
| 91 | INCLUDEPY= $(INCLUDEDIR)/python$(VERSION) |
| 92 | CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION) |
| 93 | LIBP= $(LIBDIR)/python$(VERSION) |
| 94 | |
| 95 | # Symbols used for using shared libraries |
| 96 | SO= @SO@ |
| 97 | LDSHARED= @LDSHARED@ |
Neil Schemenauer | 75e3389 | 2001-02-16 03:36:53 +0000 | [diff] [blame] | 98 | BLDSHARED= @BLDSHARED@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 99 | DESTSHARED= $(BINLIBDEST)/lib-dynload |
| 100 | |
| 101 | # Executable suffix (.exe on Windows and Mac OS X) |
Neil Schemenauer | cf9926c | 2001-02-27 18:50:56 +0000 | [diff] [blame] | 102 | EXE= @EXEEXT@ |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 103 | BUILDEXE= @BUILDEXEEXT@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 104 | |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 105 | # Short name and location for Mac OS X Python framework |
| 106 | PYTHONFRAMEWORK= @PYTHONFRAMEWORK@ |
| 107 | PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@ |
| 108 | PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@ |
| 109 | PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@ |
| 110 | |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 111 | # Environment to run shared python without installed libraries |
| 112 | RUNSHARED= @RUNSHARED@ |
| 113 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 114 | # Modes for directories, executables and data files created by the |
| 115 | # install process. Default to user-only-writable for all file types. |
| 116 | DIRMODE= 755 |
| 117 | EXEMODE= 755 |
| 118 | FILEMODE= 644 |
| 119 | |
Neil Schemenauer | 64b1b68 | 2001-03-22 00:32:32 +0000 | [diff] [blame] | 120 | # configure script arguments |
| 121 | CONFIG_ARGS= @CONFIG_ARGS@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 122 | |
| 123 | |
| 124 | # Subdirectories with code |
| 125 | SRCDIRS= @SRCDIRS@ |
| 126 | |
| 127 | # Other subdirectories |
| 128 | SUBDIRSTOO= Include Lib Misc Demo |
| 129 | |
| 130 | # Files and directories to be distributed |
Martin v. Löwis | 4f1cd8b | 2001-07-26 13:41:06 +0000 | [diff] [blame] | 131 | CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 132 | DISTFILES= README ChangeLog $(CONFIGFILES) |
| 133 | DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy |
| 134 | DIST= $(DISTFILES) $(DISTDIRS) |
| 135 | |
| 136 | |
Neil Schemenauer | 7ac954b | 2001-01-26 16:14:41 +0000 | [diff] [blame] | 137 | LIBRARY= @LIBRARY@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 138 | LDLIBRARY= @LDLIBRARY@ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 139 | BLDLIBRARY= @BLDLIBRARY@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 140 | DLLLIBRARY= @DLLLIBRARY@ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 141 | LDLIBRARYDIR= @LDLIBRARYDIR@ |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 142 | INSTSONAME= @INSTSONAME@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 143 | |
| 144 | |
| 145 | LIBS= @LIBS@ |
| 146 | LIBM= @LIBM@ |
| 147 | LIBC= @LIBC@ |
| 148 | SYSLIBS= $(LIBM) $(LIBC) |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 149 | SHLIBS= @SHLIBS@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 150 | |
| 151 | MAINOBJ= @MAINOBJ@ |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 152 | THREADOBJ= @THREADOBJ@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 153 | DLINCLDIR= @DLINCLDIR@ |
| 154 | DYNLOADFILE= @DYNLOADFILE@ |
Jack Jansen | c49e5b7 | 2001-06-19 15:00:23 +0000 | [diff] [blame] | 155 | MACHDEP_OBJS= @MACHDEP_OBJS@ |
Martin v. Löwis | 339d0f7 | 2001-08-17 18:39:25 +0000 | [diff] [blame] | 156 | UNICODE_OBJS= @UNICODE_OBJS@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 157 | |
Neil Schemenauer | cf9926c | 2001-02-27 18:50:56 +0000 | [diff] [blame] | 158 | PYTHON= python$(EXE) |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 159 | BUILDPYTHON= python$(BUILDEXE) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 160 | |
| 161 | # === Definitions added by makesetup === |
| 162 | |
| 163 | |
| 164 | ########################################################################## |
| 165 | # Modules |
| 166 | MODULE_OBJS= \ |
| 167 | Modules/config.o \ |
| 168 | Modules/getpath.o \ |
Neil Schemenauer | 9c63e6d | 2001-08-29 23:44:38 +0000 | [diff] [blame] | 169 | Modules/main.o \ |
| 170 | Modules/gcmodule.o |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 171 | |
| 172 | # Used of signalmodule.o is not available |
| 173 | SIGNAL_OBJS= @SIGNAL_OBJS@ |
| 174 | |
| 175 | |
| 176 | ########################################################################## |
| 177 | # Grammar |
Neil Schemenauer | 7cd124c | 2001-02-27 02:19:16 +0000 | [diff] [blame] | 178 | GRAMMAR_H= $(srcdir)/Include/graminit.h |
| 179 | GRAMMAR_C= $(srcdir)/Python/graminit.c |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 180 | GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar |
| 181 | |
| 182 | |
| 183 | ########################################################################## |
| 184 | # Parser |
Neil Schemenauer | cf9926c | 2001-02-27 18:50:56 +0000 | [diff] [blame] | 185 | PGEN= Parser/pgen$(EXE) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 186 | |
| 187 | POBJS= \ |
| 188 | Parser/acceler.o \ |
| 189 | Parser/grammar1.o \ |
| 190 | Parser/listnode.o \ |
| 191 | Parser/node.o \ |
| 192 | Parser/parser.o \ |
| 193 | Parser/parsetok.o \ |
| 194 | Parser/tokenizer.o \ |
| 195 | Parser/bitset.o \ |
| 196 | Parser/metagrammar.o |
| 197 | |
| 198 | PARSER_OBJS= $(POBJS) Parser/myreadline.o |
| 199 | |
| 200 | PGOBJS= \ |
Neil Schemenauer | fd1030e | 2002-04-22 03:05:25 +0000 | [diff] [blame] | 201 | Objects/obmalloc.o \ |
Guido van Rossum | f227252 | 2001-12-04 03:54:08 +0000 | [diff] [blame] | 202 | Python/mysnprintf.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 203 | Parser/firstsets.o \ |
| 204 | Parser/grammar.o \ |
| 205 | Parser/pgen.o \ |
| 206 | Parser/printgrammar.o \ |
| 207 | Parser/pgenmain.o |
| 208 | |
| 209 | PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS) |
| 210 | |
| 211 | |
| 212 | ########################################################################## |
| 213 | # Python |
| 214 | PYTHON_OBJS= \ |
| 215 | Python/bltinmodule.o \ |
| 216 | Python/exceptions.o \ |
| 217 | Python/ceval.o \ |
| 218 | Python/compile.o \ |
| 219 | Python/codecs.o \ |
| 220 | Python/errors.o \ |
| 221 | Python/frozen.o \ |
| 222 | Python/frozenmain.o \ |
Jeremy Hylton | 4db62b1 | 2001-02-27 19:07:02 +0000 | [diff] [blame] | 223 | Python/future.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 224 | Python/getargs.o \ |
| 225 | Python/getcompiler.o \ |
| 226 | Python/getcopyright.o \ |
| 227 | Python/getmtime.o \ |
| 228 | Python/getplatform.o \ |
| 229 | Python/getversion.o \ |
| 230 | Python/graminit.o \ |
| 231 | Python/import.o \ |
| 232 | Python/importdl.o \ |
| 233 | Python/marshal.o \ |
| 234 | Python/modsupport.o \ |
| 235 | Python/mystrtoul.o \ |
Marc-André Lemburg | e5006eb | 2001-07-31 13:24:44 +0000 | [diff] [blame] | 236 | Python/mysnprintf.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 237 | Python/pyfpe.o \ |
| 238 | Python/pystate.o \ |
| 239 | Python/pythonrun.o \ |
| 240 | Python/structmember.o \ |
Jeremy Hylton | cb17ae8 | 2001-02-09 22:22:18 +0000 | [diff] [blame] | 241 | Python/symtable.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 242 | Python/sysmodule.o \ |
| 243 | Python/traceback.o \ |
| 244 | Python/getopt.o \ |
| 245 | Python/$(DYNLOADFILE) \ |
Jack Jansen | c49e5b7 | 2001-06-19 15:00:23 +0000 | [diff] [blame] | 246 | $(MACHDEP_OBJS) \ |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 247 | $(THREADOBJ) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 248 | |
| 249 | |
| 250 | ########################################################################## |
| 251 | # Objects |
| 252 | OBJECT_OBJS= \ |
| 253 | Objects/abstract.o \ |
Guido van Rossum | 77f6a65 | 2002-04-03 22:41:51 +0000 | [diff] [blame] | 254 | Objects/boolobject.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 255 | Objects/bufferobject.o \ |
Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 256 | Objects/cellobject.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 257 | Objects/classobject.o \ |
| 258 | Objects/cobject.o \ |
| 259 | Objects/complexobject.o \ |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 260 | Objects/descrobject.o \ |
Guido van Rossum | 7dab242 | 2002-04-26 19:40:56 +0000 | [diff] [blame] | 261 | Objects/enumobject.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 262 | Objects/fileobject.o \ |
| 263 | Objects/floatobject.o \ |
| 264 | Objects/frameobject.o \ |
| 265 | Objects/funcobject.o \ |
| 266 | Objects/intobject.o \ |
Guido van Rossum | 59d1d2b | 2001-04-20 19:13:02 +0000 | [diff] [blame] | 267 | Objects/iterobject.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 268 | Objects/listobject.o \ |
| 269 | Objects/longobject.o \ |
| 270 | Objects/dictobject.o \ |
| 271 | Objects/methodobject.o \ |
| 272 | Objects/moduleobject.o \ |
| 273 | Objects/object.o \ |
Tim Peters | 1221c0a | 2002-03-23 00:20:15 +0000 | [diff] [blame] | 274 | Objects/obmalloc.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 275 | Objects/rangeobject.o \ |
| 276 | Objects/sliceobject.o \ |
| 277 | Objects/stringobject.o \ |
Guido van Rossum | 98bf58f | 2001-10-18 20:34:25 +0000 | [diff] [blame] | 278 | Objects/structseq.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 279 | Objects/tupleobject.o \ |
| 280 | Objects/typeobject.o \ |
Fred Drake | 502ed82 | 2001-10-05 21:56:02 +0000 | [diff] [blame] | 281 | Objects/weakrefobject.o \ |
Martin v. Löwis | 339d0f7 | 2001-08-17 18:39:25 +0000 | [diff] [blame] | 282 | $(UNICODE_OBJS) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 283 | |
| 284 | |
| 285 | ########################################################################## |
| 286 | # objects that get linked into the Python library |
| 287 | LIBRARY_OBJS= \ |
Neil Schemenauer | 1882182 | 2001-01-27 21:42:38 +0000 | [diff] [blame] | 288 | Modules/getbuildinfo.o \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 289 | $(PARSER_OBJS) \ |
| 290 | $(OBJECT_OBJS) \ |
| 291 | $(PYTHON_OBJS) \ |
| 292 | $(MODULE_OBJS) \ |
| 293 | $(SIGNAL_OBJS) \ |
| 294 | $(MODOBJS) |
| 295 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 296 | ######################################################################### |
| 297 | # Rules |
| 298 | |
| 299 | # Default target |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 300 | all: $(BUILDPYTHON) oldsharedmods sharedmods |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 301 | |
| 302 | # Build the interpreter |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 303 | $(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY) |
Fred Drake | a1a84e7 | 2001-03-06 05:52:16 +0000 | [diff] [blame] | 304 | $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ |
| 305 | Modules/$(MAINOBJ) \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 306 | $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 307 | |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 308 | platform: $(BUILDPYTHON) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 309 | $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 310 | |
| 311 | |
| 312 | # Build the shared modules |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 313 | sharedmods: $(BUILDPYTHON) |
Guido van Rossum | 1140cb2 | 2001-09-12 18:59:25 +0000 | [diff] [blame] | 314 | case $$MAKEFLAGS in \ |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 315 | *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ |
| 316 | *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ |
Guido van Rossum | 1140cb2 | 2001-09-12 18:59:25 +0000 | [diff] [blame] | 317 | esac |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 318 | |
Neil Schemenauer | 1882182 | 2001-01-27 21:42:38 +0000 | [diff] [blame] | 319 | # buildno should really depend on something like LIBRARY_SRC |
| 320 | buildno: $(PARSER_OBJS) \ |
| 321 | $(OBJECT_OBJS) \ |
| 322 | $(PYTHON_OBJS) \ |
| 323 | $(MODULE_OBJS) \ |
| 324 | $(SIGNAL_OBJS) \ |
| 325 | $(MODOBJS) \ |
| 326 | $(srcdir)/Modules/getbuildinfo.c |
| 327 | if test -f buildno; then \ |
| 328 | expr `cat buildno` + 1 >buildno1; \ |
| 329 | mv -f buildno1 buildno; \ |
| 330 | else echo 1 >buildno; fi |
| 331 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 332 | # Build static library |
Guido van Rossum | 4e6a7a6 | 2001-04-09 22:23:22 +0000 | [diff] [blame] | 333 | # avoid long command lines, same as LIBRARY_OBJS |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 334 | $(LIBRARY): $(LIBRARY_OBJS) |
| 335 | -rm -f $@ |
Neil Schemenauer | 1882182 | 2001-01-27 21:42:38 +0000 | [diff] [blame] | 336 | $(AR) cr $@ Modules/getbuildinfo.o |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 337 | $(AR) cr $@ $(PARSER_OBJS) |
| 338 | $(AR) cr $@ $(OBJECT_OBJS) |
| 339 | $(AR) cr $@ $(PYTHON_OBJS) |
| 340 | $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS) |
| 341 | $(AR) cr $@ $(MODOBJS) |
| 342 | $(RANLIB) $@ |
| 343 | |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 344 | libpython$(VERSION).so: $(LIBRARY_OBJS) |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 345 | $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 346 | |
| 347 | libpython$(VERSION).sl: $(LIBRARY_OBJS) |
| 348 | $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 349 | |
| 350 | # This rule is here for OPENSTEP/Rhapsody/MacOSX |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 351 | $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): $(LIBRARY) $(PYTHONFRAMEWORKDIR) |
Jack Jansen | 246debb | 2002-02-12 21:30:53 +0000 | [diff] [blame] | 352 | $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 353 | libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \ |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 354 | -framework System @LIBTOOL_CRUFT@ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 355 | |
| 356 | # This rule builds the Cygwin Python DLL |
| 357 | libpython$(VERSION).dll.a: $(LIBRARY_OBJS) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 358 | $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ |
| 359 | $(LIBS) $(MODLIBS) $(SYSLIBS) |
| 360 | |
| 361 | |
| 362 | oldsharedmods: $(SHAREDMODS) |
| 363 | |
| 364 | |
| 365 | Makefile Modules/config.c: Makefile.pre \ |
| 366 | $(srcdir)/Modules/config.c.in \ |
| 367 | $(MAKESETUP) \ |
| 368 | Modules/Setup.config \ |
| 369 | Modules/Setup \ |
| 370 | Modules/Setup.local |
| 371 | $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \ |
| 372 | -s Modules \ |
| 373 | Modules/Setup.config \ |
| 374 | Modules/Setup.local \ |
| 375 | Modules/Setup |
| 376 | @mv config.c Modules |
| 377 | @echo "The Makefile was updated, you may need to re-run make." |
| 378 | |
| 379 | |
| 380 | Modules/Setup: $(srcdir)/Modules/Setup.dist |
| 381 | @if test -f Modules/Setup; then \ |
| 382 | echo "-----------------------------------------------"; \ |
| 383 | echo "Modules/Setup.dist is newer than Modules/Setup;"; \ |
| 384 | echo "check to make sure you have all the updates you"; \ |
| 385 | echo "need in your Modules/Setup file."; \ |
Guido van Rossum | bb29b9c | 2001-09-29 00:42:19 +0000 | [diff] [blame] | 386 | echo "Usually, copying Setup.dist to Setup will work."; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 387 | echo "-----------------------------------------------"; \ |
Neil Schemenauer | 7ac954b | 2001-01-26 16:14:41 +0000 | [diff] [blame] | 388 | fi |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 389 | |
| 390 | ############################################################################ |
| 391 | # Special rules for object files |
| 392 | |
| 393 | Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno |
Sjoerd Mullender | 30be870 | 2001-01-29 09:39:14 +0000 | [diff] [blame] | 394 | $(CC) -c $(PY_CFLAGS) -DBUILD=`cat buildno` -o $@ $(srcdir)/Modules/getbuildinfo.c |
Andrew M. Kuchling | 03184e2 | 2001-01-26 22:52:45 +0000 | [diff] [blame] | 395 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 396 | Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile |
Neil Schemenauer | 7ac954b | 2001-01-26 16:14:41 +0000 | [diff] [blame] | 397 | $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ |
| 398 | -DPREFIX='"$(prefix)"' \ |
| 399 | -DEXEC_PREFIX='"$(exec_prefix)"' \ |
| 400 | -DVERSION='"$(VERSION)"' \ |
| 401 | -DVPATH='"$(VPATH)"' \ |
Sjoerd Mullender | 30be870 | 2001-01-29 09:39:14 +0000 | [diff] [blame] | 402 | -o $@ $(srcdir)/Modules/getpath.c |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 403 | |
Sjoerd Mullender | 30be870 | 2001-01-29 09:39:14 +0000 | [diff] [blame] | 404 | Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc |
| 405 | $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 406 | |
| 407 | |
| 408 | $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) |
Neil Schemenauer | 7cd124c | 2001-02-27 02:19:16 +0000 | [diff] [blame] | 409 | -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 410 | |
| 411 | $(PGEN): $(PGENOBJS) |
| 412 | $(CC) $(OPT) $(PGENOBJS) $(LIBS) -o $(PGEN) |
| 413 | |
| 414 | Parser/grammar.o: $(srcdir)/Parser/grammar.c \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 415 | $(srcdir)/Include/token.h \ |
| 416 | $(srcdir)/Include/grammar.h |
| 417 | Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c |
| 418 | |
| 419 | |
Neil Schemenauer | 4041774 | 2001-02-27 02:45:36 +0000 | [diff] [blame] | 420 | Python/compile.o Python/symtable.o: $(GRAMMAR_H) |
| 421 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 422 | Python/getplatform.o: $(srcdir)/Python/getplatform.c |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 423 | $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 424 | |
| 425 | Python/importdl.o: $(srcdir)/Python/importdl.c |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 426 | $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 427 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 428 | Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \ |
| 429 | $(srcdir)/Objects/unicodetype_db.h |
| 430 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 431 | ############################################################################ |
| 432 | # Header files |
| 433 | |
Neil Schemenauer | f65e500 | 2001-01-25 20:07:50 +0000 | [diff] [blame] | 434 | PYTHON_HEADERS= \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 435 | Include/Python.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 436 | Include/abstract.h \ |
Guido van Rossum | 77f6a65 | 2002-04-03 22:41:51 +0000 | [diff] [blame] | 437 | Include/boolobject.h \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 438 | Include/bufferobject.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 439 | Include/ceval.h \ |
| 440 | Include/classobject.h \ |
| 441 | Include/cobject.h \ |
| 442 | Include/codecs.h \ |
| 443 | Include/compile.h \ |
| 444 | Include/complexobject.h \ |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 445 | Include/descrobject.h \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 446 | Include/dictobject.h \ |
Guido van Rossum | 7dab242 | 2002-04-26 19:40:56 +0000 | [diff] [blame] | 447 | Include/enumobject.h \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 448 | Include/fileobject.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 449 | Include/floatobject.h \ |
| 450 | Include/funcobject.h \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 451 | Include/import.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 452 | Include/intobject.h \ |
| 453 | Include/intrcheck.h \ |
| 454 | Include/iterobject.h \ |
| 455 | Include/listobject.h \ |
| 456 | Include/longobject.h \ |
| 457 | Include/methodobject.h \ |
| 458 | Include/modsupport.h \ |
| 459 | Include/moduleobject.h \ |
| 460 | Include/object.h \ |
| 461 | Include/objimpl.h \ |
| 462 | Include/patchlevel.h \ |
| 463 | Include/pydebug.h \ |
| 464 | Include/pyerrors.h \ |
| 465 | Include/pyfpe.h \ |
| 466 | Include/pymem.h \ |
| 467 | Include/pyport.h \ |
| 468 | Include/pystate.h \ |
| 469 | Include/pythonrun.h \ |
| 470 | Include/rangeobject.h \ |
| 471 | Include/sliceobject.h \ |
| 472 | Include/stringobject.h \ |
Guido van Rossum | 98bf58f | 2001-10-18 20:34:25 +0000 | [diff] [blame] | 473 | Include/structseq.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 474 | Include/structmember.h \ |
| 475 | Include/symtable.h \ |
| 476 | Include/sysmodule.h \ |
| 477 | Include/traceback.h \ |
| 478 | Include/tupleobject.h \ |
| 479 | Include/unicodeobject.h \ |
Fred Drake | 502ed82 | 2001-10-05 21:56:02 +0000 | [diff] [blame] | 480 | Include/weakrefobject.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 481 | pyconfig.h |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 482 | |
Fred Drake | a1a84e7 | 2001-03-06 05:52:16 +0000 | [diff] [blame] | 483 | $(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS) |
Neil Schemenauer | f65e500 | 2001-01-25 20:07:50 +0000 | [diff] [blame] | 484 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 485 | |
| 486 | ###################################################################### |
| 487 | |
| 488 | # Test the interpreter (twice, once without .pyc files, once with) |
| 489 | TESTOPTS= -l |
| 490 | TESTPROG= $(srcdir)/Lib/test/regrtest.py |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 491 | TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 492 | test: all platform |
Guido van Rossum | cd81ea1 | 2001-03-01 00:36:53 +0000 | [diff] [blame] | 493 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f |
Neil Schemenauer | 7d4bb9f | 2001-07-23 16:30:27 +0000 | [diff] [blame] | 494 | -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) |
| 495 | $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 496 | |
Jeremy Hylton | 2a850d9 | 2001-02-01 19:51:28 +0000 | [diff] [blame] | 497 | QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \ |
Fred Drake | 042f313 | 2001-02-02 03:03:33 +0000 | [diff] [blame] | 498 | test_unicodedata test_re test_sre test_select test_poll \ |
Jeremy Hylton | 57d930b | 2002-07-17 15:55:09 +0000 | [diff] [blame] | 499 | test_linuxaudiodev test_struct test_sunaudiodev test_zlib |
Jeremy Hylton | 2a850d9 | 2001-02-01 19:51:28 +0000 | [diff] [blame] | 500 | quicktest: all platform |
Guido van Rossum | cd81ea1 | 2001-03-01 00:36:53 +0000 | [diff] [blame] | 501 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f |
Neil Schemenauer | 7d4bb9f | 2001-07-23 16:30:27 +0000 | [diff] [blame] | 502 | -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS) |
| 503 | $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS) |
Jeremy Hylton | 2a850d9 | 2001-02-01 19:51:28 +0000 | [diff] [blame] | 504 | |
Barry Warsaw | 4211925 | 2001-03-03 04:14:21 +0000 | [diff] [blame] | 505 | MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \ |
| 506 | test_longexp |
| 507 | memtest: all platform |
| 508 | -rm -f $(srcdir)/Lib/test/*.py[co] |
Neil Schemenauer | 7d4bb9f | 2001-07-23 16:30:27 +0000 | [diff] [blame] | 509 | -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) |
| 510 | $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) |
Barry Warsaw | 4211925 | 2001-03-03 04:14:21 +0000 | [diff] [blame] | 511 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 512 | # Install everything |
| 513 | install: altinstall bininstall maninstall |
| 514 | |
| 515 | # Install almost everything without disturbing previous versions |
Andrew M. Kuchling | bddd878 | 2001-01-29 20:18:59 +0000 | [diff] [blame] | 516 | altinstall: altbininstall libinstall inclinstall libainstall \ |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 517 | sharedinstall oldsharedinstall |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 518 | |
| 519 | # Install shared libraries enabled by Setup |
| 520 | DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) |
| 521 | |
| 522 | oldsharedinstall: $(DESTSHARED) $(SHAREDMODS) |
| 523 | @for i in X $(SHAREDMODS); do \ |
Neil Schemenauer | ac95977 | 2001-02-06 14:50:27 +0000 | [diff] [blame] | 524 | if test $$i != X; then \ |
| 525 | echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \ |
| 526 | $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \ |
| 527 | fi; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 528 | done |
| 529 | |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 530 | $(DESTSHARED): |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 531 | @for i in $(DESTDIRS); \ |
| 532 | do \ |
| 533 | if test ! -d $$i; then \ |
| 534 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 535 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 536 | else true; \ |
| 537 | fi; \ |
| 538 | done |
| 539 | |
| 540 | |
| 541 | # Install the interpreter (by creating a hard link to python$(VERSION)) |
| 542 | bininstall: altbininstall |
| 543 | -if test -f $(BINDIR)/$(PYTHON); \ |
| 544 | then rm -f $(BINDIR)/$(PYTHON); \ |
| 545 | else true; \ |
| 546 | fi |
Neil Schemenauer | cf9926c | 2001-02-27 18:50:56 +0000 | [diff] [blame] | 547 | (cd $(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 548 | |
| 549 | # Install the interpreter with $(VERSION) affixed |
| 550 | # This goes into $(exec_prefix) |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 551 | altbininstall: $(BUILDPYTHON) |
Martin v. Löwis | d8a20d2 | 2002-05-08 08:59:59 +0000 | [diff] [blame] | 552 | @for i in $(BINDIR) $(LIBDIR); \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 553 | do \ |
| 554 | if test ! -d $$i; then \ |
| 555 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 556 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 557 | else true; \ |
| 558 | fi; \ |
| 559 | done |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 560 | $(INSTALL_PROGRAM) $(BUILDPYTHON) $(BINDIR)/python$(VERSION)$(EXE) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 561 | if test -f libpython$(VERSION)$(SO); then \ |
| 562 | $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(LIBDIR)/$(INSTSONAME); \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 563 | else true; \ |
| 564 | fi |
| 565 | if test -f "$(DLLLIBRARY)"; then \ |
Neil Schemenauer | cf20d4f | 2001-03-16 11:50:43 +0000 | [diff] [blame] | 566 | $(INSTALL_SHARED) $(DLLLIBRARY) $(BINDIR); \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 567 | else true; \ |
| 568 | fi |
| 569 | |
| 570 | # Install the manual page |
| 571 | maninstall: |
| 572 | @for i in $(MANDIR) $(MANDIR)/man1; \ |
| 573 | do \ |
| 574 | if test ! -d $$i; then \ |
| 575 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 576 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 577 | else true; \ |
| 578 | fi; \ |
| 579 | done |
| 580 | $(INSTALL_DATA) $(srcdir)/Misc/python.man \ |
| 581 | $(MANDIR)/man1/python.1 |
| 582 | |
| 583 | # Install the library |
| 584 | PLATDIR= plat-$(MACHDEP) |
| 585 | MACHDEPS= $(PLATDIR) |
| 586 | XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax |
Barry Warsaw | f4c20d3 | 2001-12-03 18:51:41 +0000 | [diff] [blame] | 587 | LIBSUBDIRS= lib-old lib-tk site-packages test test/output test/data \ |
| 588 | encodings email compiler hotshot \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 589 | distutils distutils/command $(XMLLIBSUBDIRS) curses $(MACHDEPS) |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 590 | libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 591 | @for i in $(SCRIPTDIR) $(LIBDEST); \ |
| 592 | do \ |
| 593 | if test ! -d $$i; then \ |
| 594 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 595 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 596 | else true; \ |
| 597 | fi; \ |
| 598 | done |
| 599 | @for d in $(LIBSUBDIRS); \ |
| 600 | do \ |
| 601 | a=$(srcdir)/Lib/$$d; \ |
| 602 | if test ! -d $$a; then continue; else true; fi; \ |
| 603 | b=$(LIBDEST)/$$d; \ |
| 604 | if test ! -d $$b; then \ |
| 605 | echo "Creating directory $$b"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 606 | $(INSTALL) -d -m $(DIRMODE) $$b; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 607 | else true; \ |
| 608 | fi; \ |
| 609 | done |
| 610 | @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \ |
| 611 | do \ |
| 612 | if test -x $$i; then \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 613 | $(INSTALL_SCRIPT) $$i $(LIBDEST); \ |
| 614 | echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 615 | else \ |
| 616 | $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 617 | echo $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 618 | fi; \ |
| 619 | done |
| 620 | @for d in $(LIBSUBDIRS); \ |
| 621 | do \ |
| 622 | a=$(srcdir)/Lib/$$d; \ |
| 623 | if test ! -d $$a; then continue; else true; fi; \ |
| 624 | b=$(LIBDEST)/$$d; \ |
| 625 | for i in $$a/*; \ |
| 626 | do \ |
| 627 | case $$i in \ |
| 628 | *CVS) ;; \ |
| 629 | *.py[co]) ;; \ |
| 630 | *.orig) ;; \ |
| 631 | *~) ;; \ |
| 632 | *) \ |
| 633 | if test -d $$i; then continue; fi; \ |
| 634 | if test -x $$i; then \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 635 | echo $(INSTALL_SCRIPT) $$i $$b; \ |
| 636 | $(INSTALL_SCRIPT) $$i $$b; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 637 | else \ |
| 638 | echo $(INSTALL_DATA) $$i $$b; \ |
| 639 | $(INSTALL_DATA) $$i $$b; \ |
| 640 | fi;; \ |
| 641 | esac; \ |
| 642 | done; \ |
| 643 | done |
| 644 | $(INSTALL_DATA) $(srcdir)/LICENSE $(LIBDEST)/LICENSE.txt |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 645 | PYTHONPATH=$(LIBDEST) $(RUNSHARED) \ |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 646 | ./$(BUILDPYTHON) -tt $(LIBDEST)/compileall.py -x badsyntax \ |
Jeremy Hylton | 12b6457 | 2001-04-18 01:20:21 +0000 | [diff] [blame] | 647 | $(LIBDEST) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 648 | PYTHONPATH=$(LIBDEST) $(RUNSHARED) \ |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 649 | ./$(BUILDPYTHON) -O $(LIBDEST)/compileall.py -x badsyntax $(LIBDEST) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 650 | |
| 651 | # Create the PLATDIR source directory, if one wasn't distributed.. |
| 652 | $(srcdir)/Lib/$(PLATDIR): |
| 653 | mkdir $(srcdir)/Lib/$(PLATDIR) |
| 654 | cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen |
| 655 | export PATH; PATH="`pwd`:$$PATH"; \ |
| 656 | export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 657 | export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ |
Jack Jansen | 0d15366 | 2001-12-19 09:24:40 +0000 | [diff] [blame] | 658 | export EXE; EXE="$(BUILDEXE)"; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 659 | cd $(srcdir)/Lib/$(PLATDIR); ./regen |
| 660 | |
| 661 | # Install the include files |
| 662 | INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) |
| 663 | inclinstall: |
| 664 | @for i in $(INCLDIRSTOMAKE); \ |
| 665 | do \ |
| 666 | if test ! -d $$i; then \ |
| 667 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 668 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 669 | else true; \ |
| 670 | fi; \ |
| 671 | done |
| 672 | @for i in $(srcdir)/Include/*.h; \ |
| 673 | do \ |
| 674 | echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 675 | $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 676 | done |
Martin v. Löwis | 4f1cd8b | 2001-07-26 13:41:06 +0000 | [diff] [blame] | 677 | $(INSTALL_DATA) pyconfig.h $(CONFINCLUDEPY)/pyconfig.h |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 678 | |
| 679 | # Install the library and miscellaneous stuff needed for extending/embedding |
| 680 | # This goes into $(exec_prefix) |
| 681 | LIBPL= $(LIBP)/config |
| 682 | libainstall: all |
| 683 | @for i in $(LIBDIR) $(LIBP) $(LIBPL); \ |
| 684 | do \ |
| 685 | if test ! -d $$i; then \ |
| 686 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 687 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 688 | else true; \ |
| 689 | fi; \ |
| 690 | done |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 691 | @if test -d $(LIBRARY); then :; else \ |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 692 | if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 693 | $(INSTALL_DATA) $(LIBRARY) $(LIBPL)/$(LIBRARY) ; \ |
| 694 | $(RANLIB) $(LIBPL)/$(LIBRARY) ; \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 695 | else \ |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 696 | echo Skip install of $(LIBRARY) - use make frameworkinstall; \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 697 | fi; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 698 | fi |
| 699 | $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c |
Fred Drake | a1a84e7 | 2001-03-06 05:52:16 +0000 | [diff] [blame] | 700 | $(INSTALL_DATA) Modules/$(MAINOBJ) $(LIBPL)/$(MAINOBJ) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 701 | $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in |
| 702 | $(INSTALL_DATA) Makefile $(LIBPL)/Makefile |
| 703 | $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup |
| 704 | $(INSTALL_DATA) Modules/Setup.local $(LIBPL)/Setup.local |
| 705 | $(INSTALL_DATA) Modules/Setup.config $(LIBPL)/Setup.config |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 706 | $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup |
| 707 | $(INSTALL_SCRIPT) $(srcdir)/install-sh $(LIBPL)/install-sh |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 708 | @if [ -s Modules/python.exp -a \ |
| 709 | "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \ |
| 710 | echo; echo "Installing support files for building shared extension modules on AIX:"; \ |
| 711 | $(INSTALL_DATA) Modules/python.exp \ |
| 712 | $(LIBPL)/python.exp; \ |
| 713 | echo; echo "$(LIBPL)/python.exp"; \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 714 | $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 715 | $(LIBPL)/makexp_aix; \ |
| 716 | echo "$(LIBPL)/makexp_aix"; \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 717 | $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 718 | $(LIBPL)/ld_so_aix; \ |
| 719 | echo "$(LIBPL)/ld_so_aix"; \ |
| 720 | echo; echo "See Misc/AIX-NOTES for details."; \ |
| 721 | else true; \ |
| 722 | fi |
| 723 | @case "$(MACHDEP)" in beos*) \ |
| 724 | echo; echo "Installing support files for building shared extension modules on BeOS:"; \ |
Neil Schemenauer | 75e3389 | 2001-02-16 03:36:53 +0000 | [diff] [blame] | 725 | $(INSTALL_DATA) Misc/BeOS-NOTES $(LIBPL)/README; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 726 | echo; echo "$(LIBPL)/README"; \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 727 | $(INSTALL_SCRIPT) Modules/ar_beos $(LIBPL)/ar_beos; \ |
Neil Schemenauer | 75e3389 | 2001-02-16 03:36:53 +0000 | [diff] [blame] | 728 | echo "$(LIBPL)/ar_beos"; \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 729 | $(INSTALL_SCRIPT) Modules/ld_so_beos $(LIBPL)/ld_so_beos; \ |
Neil Schemenauer | 75e3389 | 2001-02-16 03:36:53 +0000 | [diff] [blame] | 730 | echo "$(LIBPL)/ld_so_beos"; \ |
| 731 | echo; echo "See Misc/BeOS-NOTES for details."; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 732 | ;; \ |
| 733 | esac |
| 734 | |
| 735 | # Install the dynamically loadable modules |
| 736 | # This goes into $(exec_prefix) |
| 737 | sharedinstall: |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 738 | $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ |
| 739 | --prefix=$(prefix) \ |
Guido van Rossum | b33e789 | 2001-10-17 06:26:53 +0000 | [diff] [blame] | 740 | --install-scripts=$(BINDIR) \ |
Andrew M. Kuchling | 03184e2 | 2001-01-26 22:52:45 +0000 | [diff] [blame] | 741 | --install-platlib=$(DESTSHARED) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 742 | |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 743 | # Install a MacOSX framework During build (before |
| 744 | # setup.py), make a minimal Python.framework directory structure in the build |
| 745 | # directory. This framework is minimal, it doesn't contain the Lib directory |
| 746 | # and such, but together with some magic in Modules/getpath.c it is good enough |
| 747 | # to run python from the install dir. |
| 748 | |
| 749 | FRAMEWORKDEST=$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION) |
| 750 | RESSRCDIR=$(srcdir)/Mac/OSXResources/framework |
| 751 | $(PYTHONFRAMEWORKDIR): $(RESSRCDIR)/Info.plist \ |
| 752 | $(RESSRCDIR)/version.plist \ |
| 753 | $(RESSRCDIR)/English.lproj/InfoPlist.strings |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 754 | @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 755 | echo Not configured with --enable-framework; \ |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 756 | exit 1; \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 757 | else true; \ |
| 758 | fi |
| 759 | $(INSTALL) -d -m $(DIRMODE) $(FRAMEWORKDEST)/Resources/English.lproj |
| 760 | $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKDEST)/Resources/Info.plist |
| 761 | $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKDEST)/Resources/version.plist |
| 762 | $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ |
| 763 | $(FRAMEWORKDEST)/Resources/English.lproj/InfoPlist.strings |
Jack Jansen | 246debb | 2002-02-12 21:30:53 +0000 | [diff] [blame] | 764 | $(LN) -fsh $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current |
| 765 | $(LN) -fsh Versions/Current/Python $(PYTHONFRAMEWORKDIR)/Python |
| 766 | $(LN) -fsh Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers |
| 767 | $(LN) -fsh Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 768 | |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 769 | # On install, we re-make the framework |
| 770 | # structure in the install location, /Library/Frameworks/ or the argument to |
| 771 | # --enable-framework. If --enable-framework has been specified then we have |
| 772 | # automatically set prefix to the location deep down in the framework, so we |
| 773 | # only have to cater for the structural bits of the framework. |
| 774 | |
| 775 | frameworkinstall: install frameworkinfrastructureinstall |
| 776 | FRAMEWORKFINALDEST=$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION) |
| 777 | frameworkinfrastructureinstall: $(LDLIBRARY) |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 778 | @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 779 | echo Not configured with --enable-framework; \ |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 780 | exit 1; \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 781 | else true; \ |
| 782 | fi |
| 783 | @for i in $(FRAMEWORKFINALDEST)/Resources/English.lproj $(FRAMEWORKFINALDEST)/lib; do\ |
| 784 | if test ! -d $$i; then \ |
| 785 | echo "Creating directory $$i"; \ |
| 786 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
| 787 | else true; \ |
| 788 | fi; \ |
| 789 | done |
Jack Jansen | a8278cc | 2001-08-17 22:37:02 +0000 | [diff] [blame] | 790 | $(LN) -sf $(INCLUDEPY) $(FRAMEWORKFINALDEST)/Headers |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 791 | $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKFINALDEST)/Resources/Info.plist |
| 792 | $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKFINALDEST)/Resources/version.plist |
| 793 | $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ |
| 794 | $(FRAMEWORKFINALDEST)/Resources/English.lproj/InfoPlist.strings |
Jack Jansen | 246debb | 2002-02-12 21:30:53 +0000 | [diff] [blame] | 795 | $(LN) -fsh $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current |
| 796 | $(LN) -fsh Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python |
| 797 | $(LN) -fsh Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers |
| 798 | $(LN) -fsh Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 799 | $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 800 | |
Jack Jansen | 0b06be7 | 2002-06-21 14:48:38 +0000 | [diff] [blame] | 801 | # Build Python executable that can run GUI code. Another MacOSX pseudo |
| 802 | # target. |
| 803 | python.app: |
| 804 | $(MAKE) -f $(srcdir)/Mac/OSX/Makefile install installmacsubtree \ |
| 805 | PYTHONSRCDIR=$(srcdir) PYTHONBUILDDIR=. |
| 806 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 807 | # Build the toplevel Makefile |
| 808 | Makefile.pre: Makefile.pre.in config.status |
| 809 | CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status |
| 810 | $(MAKE) -f Makefile.pre Makefile |
| 811 | |
Neil Schemenauer | 64b1b68 | 2001-03-22 00:32:32 +0000 | [diff] [blame] | 812 | # Run the configure script. |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 813 | config.status: $(srcdir)/configure |
Neil Schemenauer | 64b1b68 | 2001-03-22 00:32:32 +0000 | [diff] [blame] | 814 | $(SHELL) $(srcdir)/configure $(CONFIG_ARGS) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 815 | |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 816 | .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 817 | |
| 818 | # Some make's put the object file in the current directory |
| 819 | .c.o: |
Neil Schemenauer | 7ac954b | 2001-01-26 16:14:41 +0000 | [diff] [blame] | 820 | $(CC) -c $(PY_CFLAGS) -o $@ $< |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 821 | |
| 822 | # Rerun configure with the same options as it was run last time, |
| 823 | # provided the config.status script exists |
| 824 | recheck: |
| 825 | $(SHELL) config.status --recheck |
| 826 | $(SHELL) config.status |
| 827 | |
Martin v. Löwis | 4f1cd8b | 2001-07-26 13:41:06 +0000 | [diff] [blame] | 828 | # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 829 | autoconf: |
| 830 | (cd $(srcdir); autoconf) |
| 831 | (cd $(srcdir); autoheader) |
| 832 | |
| 833 | # Create a tags file for vi |
| 834 | tags:: |
| 835 | cd $(srcdir); \ |
| 836 | ctags -w -t Include/*.h; \ |
| 837 | for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \ |
| 838 | done; \ |
Guido van Rossum | c948966 | 2002-02-28 19:26:08 +0000 | [diff] [blame] | 839 | sort -o tags tags |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 840 | |
| 841 | # Create a tags file for GNU Emacs |
| 842 | TAGS:: |
| 843 | cd $(srcdir); \ |
| 844 | etags Include/*.h; \ |
| 845 | for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done |
| 846 | |
| 847 | # Sanitation targets -- clean leaves libraries, executables and tags |
| 848 | # files, which clobber removes those as well |
| 849 | |
| 850 | clean: |
Neil Schemenauer | c5cfcb4 | 2001-02-19 04:35:11 +0000 | [diff] [blame] | 851 | find . -name '*.o' -exec rm -f {} ';' |
Guido van Rossum | cd0ed97 | 2001-04-14 17:57:07 +0000 | [diff] [blame] | 852 | find . -name '*.s[ol]' -exec rm -f {} ';' |
Neil Schemenauer | e0d4357 | 2001-02-03 17:16:29 +0000 | [diff] [blame] | 853 | find $(srcdir) -name '*.py[co]' -exec rm -f {} ';' |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 854 | |
| 855 | clobber: clean |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 856 | -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ |
Guido van Rossum | cd0ed97 | 2001-04-14 17:57:07 +0000 | [diff] [blame] | 857 | tags TAGS \ |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 858 | config.cache config.log pyconfig.h Modules/config.c |
Guido van Rossum | 1d88c59 | 2001-06-06 17:51:57 +0000 | [diff] [blame] | 859 | -rm -rf build platform |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 860 | |
| 861 | # Make things extra clean, before making a distribution: |
| 862 | # remove all generated files, even Makefile[.pre] |
| 863 | distclean: clobber |
Neil Schemenauer | e0d4357 | 2001-02-03 17:16:29 +0000 | [diff] [blame] | 864 | -rm -f core Makefile Makefile.pre buildno config.status \ |
Neil Schemenauer | 7ac954b | 2001-01-26 16:14:41 +0000 | [diff] [blame] | 865 | Modules/Setup Modules/Setup.local Modules/Setup.config |
Neil Schemenauer | e0d4357 | 2001-02-03 17:16:29 +0000 | [diff] [blame] | 866 | find $(srcdir) '(' -name '*.fdc' -o -name '*~' \ |
| 867 | -o -name '[@,#]*' -o -name '*.old' \ |
| 868 | -o -name '*.orig' -o -name '*.rej' \ |
| 869 | -o -name '*.bak' ')' \ |
| 870 | -exec rm -f {} ';' |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 871 | |
| 872 | # Check for smelly exported symbols (not starting with Py/_Py) |
| 873 | smelly: all |
| 874 | nm -p $(LIBRARY) | \ |
| 875 | sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ |
| 876 | |
| 877 | # Find files with funny names |
| 878 | funny: |
| 879 | find $(DISTDIRS) -type d \ |
| 880 | -o -name '*.[chs]' \ |
| 881 | -o -name '*.py' \ |
| 882 | -o -name '*.doc' \ |
| 883 | -o -name '*.sty' \ |
| 884 | -o -name '*.bib' \ |
| 885 | -o -name '*.dat' \ |
| 886 | -o -name '*.el' \ |
| 887 | -o -name '*.fd' \ |
| 888 | -o -name '*.in' \ |
| 889 | -o -name '*.tex' \ |
| 890 | -o -name '*,[vpt]' \ |
| 891 | -o -name 'Setup' \ |
| 892 | -o -name 'Setup.*' \ |
| 893 | -o -name README \ |
| 894 | -o -name Makefile \ |
| 895 | -o -name ChangeLog \ |
| 896 | -o -name Repository \ |
| 897 | -o -name Root \ |
| 898 | -o -name Entries \ |
| 899 | -o -name Tag \ |
| 900 | -o -name tags \ |
| 901 | -o -name TAGS \ |
| 902 | -o -name .cvsignore \ |
| 903 | -o -name MANIFEST \ |
| 904 | -o -print |
| 905 | |
Guido van Rossum | 9454ad7 | 2001-08-18 21:08:22 +0000 | [diff] [blame] | 906 | # Dependencies |
| 907 | |
Martin v. Löwis | 06f15bb | 2001-12-02 13:02:32 +0000 | [diff] [blame] | 908 | Python/thread.o: @THREADHEADERS@ |
Guido van Rossum | 9454ad7 | 2001-08-18 21:08:22 +0000 | [diff] [blame] | 909 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 910 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |