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