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 \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 193 | Parser/bitset.o \ |
| 194 | Parser/metagrammar.o |
| 195 | |
Martin v. Löwis | 00f1e3f | 2002-08-04 17:29:52 +0000 | [diff] [blame] | 196 | PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 197 | |
| 198 | PGOBJS= \ |
Neil Schemenauer | fd1030e | 2002-04-22 03:05:25 +0000 | [diff] [blame] | 199 | Objects/obmalloc.o \ |
Guido van Rossum | f227252 | 2001-12-04 03:54:08 +0000 | [diff] [blame] | 200 | Python/mysnprintf.o \ |
Martin v. Löwis | 00f1e3f | 2002-08-04 17:29:52 +0000 | [diff] [blame] | 201 | Parser/tokenizer_pgen.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 |
Jack Jansen | c736b8d | 2002-08-04 21:17:20 +0000 | [diff] [blame] | 369 | $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current |
| 370 | $(LN) -fsn Versions/Current/Python $(PYTHONFRAMEWORKDIR)/Python |
| 371 | $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers |
| 372 | $(LN) -fsn 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 | |
Martin v. Löwis | 00f1e3f | 2002-08-04 17:29:52 +0000 | [diff] [blame] | 437 | Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c |
| 438 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 439 | |
Neil Schemenauer | 4041774 | 2001-02-27 02:45:36 +0000 | [diff] [blame] | 440 | Python/compile.o Python/symtable.o: $(GRAMMAR_H) |
| 441 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 442 | Python/getplatform.o: $(srcdir)/Python/getplatform.c |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 443 | $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 444 | |
| 445 | Python/importdl.o: $(srcdir)/Python/importdl.c |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 446 | $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 447 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 448 | Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \ |
| 449 | $(srcdir)/Objects/unicodetype_db.h |
| 450 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 451 | ############################################################################ |
| 452 | # Header files |
| 453 | |
Neil Schemenauer | f65e500 | 2001-01-25 20:07:50 +0000 | [diff] [blame] | 454 | PYTHON_HEADERS= \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 455 | Include/Python.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 456 | Include/abstract.h \ |
Guido van Rossum | 77f6a65 | 2002-04-03 22:41:51 +0000 | [diff] [blame] | 457 | Include/boolobject.h \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 458 | Include/bufferobject.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 459 | Include/ceval.h \ |
| 460 | Include/classobject.h \ |
| 461 | Include/cobject.h \ |
| 462 | Include/codecs.h \ |
| 463 | Include/compile.h \ |
| 464 | Include/complexobject.h \ |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 465 | Include/descrobject.h \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 466 | Include/dictobject.h \ |
Guido van Rossum | 7dab242 | 2002-04-26 19:40:56 +0000 | [diff] [blame] | 467 | Include/enumobject.h \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 468 | Include/fileobject.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 469 | Include/floatobject.h \ |
| 470 | Include/funcobject.h \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 471 | Include/import.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 472 | Include/intobject.h \ |
| 473 | Include/intrcheck.h \ |
| 474 | Include/iterobject.h \ |
| 475 | Include/listobject.h \ |
| 476 | Include/longobject.h \ |
| 477 | Include/methodobject.h \ |
| 478 | Include/modsupport.h \ |
| 479 | Include/moduleobject.h \ |
| 480 | Include/object.h \ |
| 481 | Include/objimpl.h \ |
| 482 | Include/patchlevel.h \ |
| 483 | Include/pydebug.h \ |
| 484 | Include/pyerrors.h \ |
| 485 | Include/pyfpe.h \ |
| 486 | Include/pymem.h \ |
| 487 | Include/pyport.h \ |
| 488 | Include/pystate.h \ |
| 489 | Include/pythonrun.h \ |
| 490 | Include/rangeobject.h \ |
| 491 | Include/sliceobject.h \ |
| 492 | Include/stringobject.h \ |
Guido van Rossum | 98bf58f | 2001-10-18 20:34:25 +0000 | [diff] [blame] | 493 | Include/structseq.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 494 | Include/structmember.h \ |
| 495 | Include/symtable.h \ |
| 496 | Include/sysmodule.h \ |
| 497 | Include/traceback.h \ |
| 498 | Include/tupleobject.h \ |
| 499 | Include/unicodeobject.h \ |
Fred Drake | 502ed82 | 2001-10-05 21:56:02 +0000 | [diff] [blame] | 500 | Include/weakrefobject.h \ |
Guido van Rossum | 427ce80 | 2001-09-18 02:40:21 +0000 | [diff] [blame] | 501 | pyconfig.h |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 502 | |
Fred Drake | a1a84e7 | 2001-03-06 05:52:16 +0000 | [diff] [blame] | 503 | $(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS) |
Neil Schemenauer | f65e500 | 2001-01-25 20:07:50 +0000 | [diff] [blame] | 504 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 505 | |
| 506 | ###################################################################### |
| 507 | |
| 508 | # Test the interpreter (twice, once without .pyc files, once with) |
| 509 | TESTOPTS= -l |
| 510 | TESTPROG= $(srcdir)/Lib/test/regrtest.py |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 511 | TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 512 | test: all platform |
Guido van Rossum | cd81ea1 | 2001-03-01 00:36:53 +0000 | [diff] [blame] | 513 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f |
Neil Schemenauer | 7d4bb9f | 2001-07-23 16:30:27 +0000 | [diff] [blame] | 514 | -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) |
| 515 | $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 516 | |
Jeremy Hylton | 2a850d9 | 2001-02-01 19:51:28 +0000 | [diff] [blame] | 517 | QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \ |
Fred Drake | 042f313 | 2001-02-02 03:03:33 +0000 | [diff] [blame] | 518 | test_unicodedata test_re test_sre test_select test_poll \ |
Guido van Rossum | ed2f725 | 2002-08-09 19:18:25 +0000 | [diff] [blame] | 519 | test_linuxaudiodev test_struct test_sunaudiodev test_zlib |
Jeremy Hylton | 2a850d9 | 2001-02-01 19:51:28 +0000 | [diff] [blame] | 520 | quicktest: all platform |
Guido van Rossum | cd81ea1 | 2001-03-01 00:36:53 +0000 | [diff] [blame] | 521 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f |
Neil Schemenauer | 7d4bb9f | 2001-07-23 16:30:27 +0000 | [diff] [blame] | 522 | -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS) |
| 523 | $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS) |
Jeremy Hylton | 2a850d9 | 2001-02-01 19:51:28 +0000 | [diff] [blame] | 524 | |
Barry Warsaw | 4211925 | 2001-03-03 04:14:21 +0000 | [diff] [blame] | 525 | MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \ |
| 526 | test_longexp |
| 527 | memtest: all platform |
| 528 | -rm -f $(srcdir)/Lib/test/*.py[co] |
Neil Schemenauer | 7d4bb9f | 2001-07-23 16:30:27 +0000 | [diff] [blame] | 529 | -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) |
| 530 | $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) |
Barry Warsaw | 4211925 | 2001-03-03 04:14:21 +0000 | [diff] [blame] | 531 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 532 | # Install everything |
| 533 | install: altinstall bininstall maninstall |
| 534 | |
| 535 | # Install almost everything without disturbing previous versions |
Andrew M. Kuchling | bddd878 | 2001-01-29 20:18:59 +0000 | [diff] [blame] | 536 | altinstall: altbininstall libinstall inclinstall libainstall \ |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 537 | sharedinstall oldsharedinstall |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 538 | |
| 539 | # Install shared libraries enabled by Setup |
| 540 | DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) |
| 541 | |
| 542 | oldsharedinstall: $(DESTSHARED) $(SHAREDMODS) |
| 543 | @for i in X $(SHAREDMODS); do \ |
Neil Schemenauer | ac95977 | 2001-02-06 14:50:27 +0000 | [diff] [blame] | 544 | if test $$i != X; then \ |
| 545 | echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \ |
| 546 | $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \ |
| 547 | fi; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 548 | done |
| 549 | |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 550 | $(DESTSHARED): |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 551 | @for i in $(DESTDIRS); \ |
| 552 | do \ |
| 553 | if test ! -d $$i; then \ |
| 554 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 555 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 556 | else true; \ |
| 557 | fi; \ |
| 558 | done |
| 559 | |
| 560 | |
| 561 | # Install the interpreter (by creating a hard link to python$(VERSION)) |
| 562 | bininstall: altbininstall |
Jack Jansen | 1403b9f | 2002-08-09 14:42:57 +0000 | [diff] [blame] | 563 | -if test -f $(BINDIR)/$(PYTHON) -o -L $(BINDIR)/$(PYTHON); \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 564 | then rm -f $(BINDIR)/$(PYTHON); \ |
| 565 | else true; \ |
| 566 | fi |
Neil Schemenauer | cf9926c | 2001-02-27 18:50:56 +0000 | [diff] [blame] | 567 | (cd $(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 568 | |
| 569 | # Install the interpreter with $(VERSION) affixed |
| 570 | # This goes into $(exec_prefix) |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 571 | altbininstall: $(BUILDPYTHON) |
Jack Jansen | 3a451b1 | 2002-08-06 13:40:31 +0000 | [diff] [blame] | 572 | @if test "$(PYTHONFRAMEWORKDIR)" != no-framework; then \ |
| 573 | if test ! -f $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current/Resources/Info.plist; then \ |
| 574 | echo 'Framework build: use "make frameworkinstall" in stead of "make install"'; \ |
| 575 | exit 1; \ |
| 576 | fi; \ |
| 577 | fi |
Martin v. Löwis | d8a20d2 | 2002-05-08 08:59:59 +0000 | [diff] [blame] | 578 | @for i in $(BINDIR) $(LIBDIR); \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 579 | do \ |
| 580 | if test ! -d $$i; then \ |
| 581 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 582 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 583 | else true; \ |
| 584 | fi; \ |
| 585 | done |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 586 | $(INSTALL_PROGRAM) $(BUILDPYTHON) $(BINDIR)/python$(VERSION)$(EXE) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 587 | if test -f libpython$(VERSION)$(SO); then \ |
Jason Tishler | c0f1e77 | 2002-07-29 16:18:23 +0000 | [diff] [blame] | 588 | if test "$(SO)" = .dll; then \ |
| 589 | $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(BINDIR); \ |
| 590 | else \ |
| 591 | $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(LIBDIR)/$(INSTSONAME); \ |
| 592 | fi; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 593 | else true; \ |
| 594 | fi |
| 595 | |
| 596 | # Install the manual page |
| 597 | maninstall: |
| 598 | @for i in $(MANDIR) $(MANDIR)/man1; \ |
| 599 | do \ |
| 600 | if test ! -d $$i; then \ |
| 601 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 602 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 603 | else true; \ |
| 604 | fi; \ |
| 605 | done |
| 606 | $(INSTALL_DATA) $(srcdir)/Misc/python.man \ |
| 607 | $(MANDIR)/man1/python.1 |
| 608 | |
| 609 | # Install the library |
| 610 | PLATDIR= plat-$(MACHDEP) |
| 611 | MACHDEPS= $(PLATDIR) |
| 612 | XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax |
Barry Warsaw | f4c20d3 | 2001-12-03 18:51:41 +0000 | [diff] [blame] | 613 | LIBSUBDIRS= lib-old lib-tk site-packages test test/output test/data \ |
| 614 | encodings email compiler hotshot \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 615 | distutils distutils/command $(XMLLIBSUBDIRS) curses $(MACHDEPS) |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 616 | libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 617 | @for i in $(SCRIPTDIR) $(LIBDEST); \ |
| 618 | do \ |
| 619 | if test ! -d $$i; then \ |
| 620 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 621 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 622 | else true; \ |
| 623 | fi; \ |
| 624 | done |
| 625 | @for d in $(LIBSUBDIRS); \ |
| 626 | do \ |
| 627 | a=$(srcdir)/Lib/$$d; \ |
| 628 | if test ! -d $$a; then continue; else true; fi; \ |
| 629 | b=$(LIBDEST)/$$d; \ |
| 630 | if test ! -d $$b; then \ |
| 631 | echo "Creating directory $$b"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 632 | $(INSTALL) -d -m $(DIRMODE) $$b; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 633 | else true; \ |
| 634 | fi; \ |
| 635 | done |
| 636 | @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \ |
| 637 | do \ |
| 638 | if test -x $$i; then \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 639 | $(INSTALL_SCRIPT) $$i $(LIBDEST); \ |
| 640 | echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 641 | else \ |
| 642 | $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 643 | echo $(INSTALL_DATA) $$i $(LIBDEST); \ |
| 644 | fi; \ |
| 645 | done |
| 646 | @for d in $(LIBSUBDIRS); \ |
| 647 | do \ |
| 648 | a=$(srcdir)/Lib/$$d; \ |
| 649 | if test ! -d $$a; then continue; else true; fi; \ |
| 650 | b=$(LIBDEST)/$$d; \ |
| 651 | for i in $$a/*; \ |
| 652 | do \ |
| 653 | case $$i in \ |
| 654 | *CVS) ;; \ |
| 655 | *.py[co]) ;; \ |
| 656 | *.orig) ;; \ |
| 657 | *~) ;; \ |
| 658 | *) \ |
| 659 | if test -d $$i; then continue; fi; \ |
| 660 | if test -x $$i; then \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 661 | echo $(INSTALL_SCRIPT) $$i $$b; \ |
| 662 | $(INSTALL_SCRIPT) $$i $$b; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 663 | else \ |
| 664 | echo $(INSTALL_DATA) $$i $$b; \ |
| 665 | $(INSTALL_DATA) $$i $$b; \ |
| 666 | fi;; \ |
| 667 | esac; \ |
| 668 | done; \ |
| 669 | done |
| 670 | $(INSTALL_DATA) $(srcdir)/LICENSE $(LIBDEST)/LICENSE.txt |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 671 | PYTHONPATH=$(LIBDEST) $(RUNSHARED) \ |
Guido van Rossum | a29eafa | 2002-08-29 15:04:37 +0000 | [diff] [blame] | 672 | ./$(BUILDPYTHON) -Wi -tt $(LIBDEST)/compileall.py \ |
| 673 | -x badsyntax $(LIBDEST) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 674 | PYTHONPATH=$(LIBDEST) $(RUNSHARED) \ |
Guido van Rossum | a29eafa | 2002-08-29 15:04:37 +0000 | [diff] [blame] | 675 | ./$(BUILDPYTHON) -Wi -tt -O $(LIBDEST)/compileall.py \ |
| 676 | -x badsyntax $(LIBDEST) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 677 | |
| 678 | # Create the PLATDIR source directory, if one wasn't distributed.. |
| 679 | $(srcdir)/Lib/$(PLATDIR): |
| 680 | mkdir $(srcdir)/Lib/$(PLATDIR) |
| 681 | cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen |
| 682 | export PATH; PATH="`pwd`:$$PATH"; \ |
| 683 | export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 684 | export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ |
Jack Jansen | 0d15366 | 2001-12-19 09:24:40 +0000 | [diff] [blame] | 685 | export EXE; EXE="$(BUILDEXE)"; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 686 | cd $(srcdir)/Lib/$(PLATDIR); ./regen |
| 687 | |
| 688 | # Install the include files |
| 689 | INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) |
| 690 | inclinstall: |
| 691 | @for i in $(INCLDIRSTOMAKE); \ |
| 692 | do \ |
| 693 | if test ! -d $$i; then \ |
| 694 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 695 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 696 | else true; \ |
| 697 | fi; \ |
| 698 | done |
| 699 | @for i in $(srcdir)/Include/*.h; \ |
| 700 | do \ |
| 701 | echo $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 702 | $(INSTALL_DATA) $$i $(INCLUDEPY); \ |
| 703 | done |
Martin v. Löwis | 4f1cd8b | 2001-07-26 13:41:06 +0000 | [diff] [blame] | 704 | $(INSTALL_DATA) pyconfig.h $(CONFINCLUDEPY)/pyconfig.h |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 705 | |
| 706 | # Install the library and miscellaneous stuff needed for extending/embedding |
| 707 | # This goes into $(exec_prefix) |
| 708 | LIBPL= $(LIBP)/config |
| 709 | libainstall: all |
| 710 | @for i in $(LIBDIR) $(LIBP) $(LIBPL); \ |
| 711 | do \ |
| 712 | if test ! -d $$i; then \ |
| 713 | echo "Creating directory $$i"; \ |
Neil Schemenauer | 8d3274e | 2001-02-10 20:07:38 +0000 | [diff] [blame] | 714 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 715 | else true; \ |
| 716 | fi; \ |
| 717 | done |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 718 | @if test -d $(LIBRARY); then :; else \ |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 719 | if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ |
Jason Tishler | c0f1e77 | 2002-07-29 16:18:23 +0000 | [diff] [blame] | 720 | if test "$(SO)" = .dll; then \ |
| 721 | $(INSTALL_DATA) $(LDLIBRARY) $(LIBPL) ; \ |
| 722 | else \ |
| 723 | $(INSTALL_DATA) $(LIBRARY) $(LIBPL)/$(LIBRARY) ; \ |
| 724 | $(RANLIB) $(LIBPL)/$(LIBRARY) ; \ |
| 725 | fi; \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 726 | else \ |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 727 | echo Skip install of $(LIBRARY) - use make frameworkinstall; \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 728 | fi; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 729 | fi |
| 730 | $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c |
Fred Drake | a1a84e7 | 2001-03-06 05:52:16 +0000 | [diff] [blame] | 731 | $(INSTALL_DATA) Modules/$(MAINOBJ) $(LIBPL)/$(MAINOBJ) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 732 | $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in |
| 733 | $(INSTALL_DATA) Makefile $(LIBPL)/Makefile |
| 734 | $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup |
| 735 | $(INSTALL_DATA) Modules/Setup.local $(LIBPL)/Setup.local |
| 736 | $(INSTALL_DATA) Modules/Setup.config $(LIBPL)/Setup.config |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 737 | $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup |
| 738 | $(INSTALL_SCRIPT) $(srcdir)/install-sh $(LIBPL)/install-sh |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 739 | @if [ -s Modules/python.exp -a \ |
| 740 | "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \ |
| 741 | echo; echo "Installing support files for building shared extension modules on AIX:"; \ |
| 742 | $(INSTALL_DATA) Modules/python.exp \ |
| 743 | $(LIBPL)/python.exp; \ |
| 744 | echo; echo "$(LIBPL)/python.exp"; \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 745 | $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 746 | $(LIBPL)/makexp_aix; \ |
| 747 | echo "$(LIBPL)/makexp_aix"; \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 748 | $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 749 | $(LIBPL)/ld_so_aix; \ |
| 750 | echo "$(LIBPL)/ld_so_aix"; \ |
| 751 | echo; echo "See Misc/AIX-NOTES for details."; \ |
| 752 | else true; \ |
| 753 | fi |
| 754 | @case "$(MACHDEP)" in beos*) \ |
| 755 | echo; echo "Installing support files for building shared extension modules on BeOS:"; \ |
Neil Schemenauer | 75e3389 | 2001-02-16 03:36:53 +0000 | [diff] [blame] | 756 | $(INSTALL_DATA) Misc/BeOS-NOTES $(LIBPL)/README; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 757 | echo; echo "$(LIBPL)/README"; \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 758 | $(INSTALL_SCRIPT) Modules/ar_beos $(LIBPL)/ar_beos; \ |
Neil Schemenauer | 75e3389 | 2001-02-16 03:36:53 +0000 | [diff] [blame] | 759 | echo "$(LIBPL)/ar_beos"; \ |
Neil Schemenauer | 3f5cc20 | 2001-04-10 23:03:35 +0000 | [diff] [blame] | 760 | $(INSTALL_SCRIPT) Modules/ld_so_beos $(LIBPL)/ld_so_beos; \ |
Neil Schemenauer | 75e3389 | 2001-02-16 03:36:53 +0000 | [diff] [blame] | 761 | echo "$(LIBPL)/ld_so_beos"; \ |
| 762 | echo; echo "See Misc/BeOS-NOTES for details."; \ |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 763 | ;; \ |
| 764 | esac |
| 765 | |
| 766 | # Install the dynamically loadable modules |
| 767 | # This goes into $(exec_prefix) |
| 768 | sharedinstall: |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 769 | $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ |
| 770 | --prefix=$(prefix) \ |
Guido van Rossum | b33e789 | 2001-10-17 06:26:53 +0000 | [diff] [blame] | 771 | --install-scripts=$(BINDIR) \ |
Andrew M. Kuchling | 03184e2 | 2001-01-26 22:52:45 +0000 | [diff] [blame] | 772 | --install-platlib=$(DESTSHARED) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 773 | |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 774 | # Here are a couple of targets for MacOSX again, to install a full |
| 775 | # framework-based Python. frameworkinstall installs everything, the |
| 776 | # subtargets install specific parts. Much of the actual work is offloaded to |
| 777 | # the Makefile in Mac/OSX |
| 778 | # |
| 779 | frameworkinstall: frameworkinstallframework \ |
| 780 | frameworkinstallapps frameworkinstallunixtools |
Guido van Rossum | ed2f725 | 2002-08-09 19:18:25 +0000 | [diff] [blame] | 781 | |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 782 | # On install, we re-make the framework |
| 783 | # structure in the install location, /Library/Frameworks/ or the argument to |
| 784 | # --enable-framework. If --enable-framework has been specified then we have |
| 785 | # automatically set prefix to the location deep down in the framework, so we |
| 786 | # only have to cater for the structural bits of the framework. |
| 787 | |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 788 | frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib |
| 789 | |
| 790 | frameworkinstallstructure: $(LDLIBRARY) |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 791 | @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 792 | echo Not configured with --enable-framework; \ |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 793 | exit 1; \ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 794 | else true; \ |
| 795 | fi |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 796 | @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 797 | if test ! -d $$i; then \ |
| 798 | echo "Creating directory $$i"; \ |
| 799 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
| 800 | else true; \ |
| 801 | fi; \ |
| 802 | done |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 803 | $(LN) -fsn include/python$(VERSION) $(prefix)/Headers |
| 804 | $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(prefix)/Resources/Info.plist |
| 805 | $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(prefix)/Resources/version.plist |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 806 | $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 807 | $(prefix)/Resources/English.lproj/InfoPlist.strings |
Jack Jansen | c736b8d | 2002-08-04 21:17:20 +0000 | [diff] [blame] | 808 | $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current |
| 809 | $(LN) -fsn Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python |
| 810 | $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers |
| 811 | $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 812 | $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 813 | |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 814 | # This installs Mac/Lib into the framework |
| 815 | frameworkinstallmaclib: |
| 816 | $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installmacsubtree \ |
| 817 | srcdir=$(srcdir) builddir=. prefix=$(prefix) LIBDEST=$(LIBDEST) |
| 818 | |
| 819 | # This installs the IDE, the Launcher and other apps into /Applications |
| 820 | frameworkinstallapps: |
| 821 | $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installapps \ |
| 822 | srcdir=$(srcdir) builddir=. dstroot=$(PYTHONFRAMEWORKPREFIX)/../.. |
| 823 | |
| 824 | # This install the unix python and pythonw tools in /usr/local/bin |
| 825 | frameworkinstallunixtools: |
| 826 | $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installunixtools \ |
| 827 | srcdir=$(srcdir) builddir=. dstroot=$(PYTHONFRAMEWORKPREFIX)/../.. |
Jack Jansen | 0b06be7 | 2002-06-21 14:48:38 +0000 | [diff] [blame] | 828 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 829 | # Build the toplevel Makefile |
| 830 | Makefile.pre: Makefile.pre.in config.status |
| 831 | CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status |
| 832 | $(MAKE) -f Makefile.pre Makefile |
| 833 | |
Neil Schemenauer | 64b1b68 | 2001-03-22 00:32:32 +0000 | [diff] [blame] | 834 | # Run the configure script. |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 835 | config.status: $(srcdir)/configure |
Neil Schemenauer | 64b1b68 | 2001-03-22 00:32:32 +0000 | [diff] [blame] | 836 | $(SHELL) $(srcdir)/configure $(CONFIG_ARGS) |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 837 | |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 838 | .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 839 | |
| 840 | # Some make's put the object file in the current directory |
| 841 | .c.o: |
Neil Schemenauer | 7ac954b | 2001-01-26 16:14:41 +0000 | [diff] [blame] | 842 | $(CC) -c $(PY_CFLAGS) -o $@ $< |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 843 | |
| 844 | # Rerun configure with the same options as it was run last time, |
| 845 | # provided the config.status script exists |
| 846 | recheck: |
| 847 | $(SHELL) config.status --recheck |
| 848 | $(SHELL) config.status |
| 849 | |
Martin v. Löwis | 4f1cd8b | 2001-07-26 13:41:06 +0000 | [diff] [blame] | 850 | # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 851 | autoconf: |
| 852 | (cd $(srcdir); autoconf) |
| 853 | (cd $(srcdir); autoheader) |
| 854 | |
| 855 | # Create a tags file for vi |
| 856 | tags:: |
| 857 | cd $(srcdir); \ |
| 858 | ctags -w -t Include/*.h; \ |
| 859 | for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \ |
| 860 | done; \ |
Guido van Rossum | c948966 | 2002-02-28 19:26:08 +0000 | [diff] [blame] | 861 | sort -o tags tags |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 862 | |
| 863 | # Create a tags file for GNU Emacs |
| 864 | TAGS:: |
| 865 | cd $(srcdir); \ |
| 866 | etags Include/*.h; \ |
| 867 | for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done |
| 868 | |
| 869 | # Sanitation targets -- clean leaves libraries, executables and tags |
| 870 | # files, which clobber removes those as well |
| 871 | |
| 872 | clean: |
Neil Schemenauer | c5cfcb4 | 2001-02-19 04:35:11 +0000 | [diff] [blame] | 873 | find . -name '*.o' -exec rm -f {} ';' |
Guido van Rossum | cd0ed97 | 2001-04-14 17:57:07 +0000 | [diff] [blame] | 874 | find . -name '*.s[ol]' -exec rm -f {} ';' |
Neil Schemenauer | e0d4357 | 2001-02-03 17:16:29 +0000 | [diff] [blame] | 875 | find $(srcdir) -name '*.py[co]' -exec rm -f {} ';' |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 876 | |
| 877 | clobber: clean |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 878 | -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ |
Guido van Rossum | cd0ed97 | 2001-04-14 17:57:07 +0000 | [diff] [blame] | 879 | tags TAGS \ |
Guido van Rossum | 7cb32ae | 2001-08-17 15:32:31 +0000 | [diff] [blame] | 880 | config.cache config.log pyconfig.h Modules/config.c |
Guido van Rossum | 1d88c59 | 2001-06-06 17:51:57 +0000 | [diff] [blame] | 881 | -rm -rf build platform |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 882 | |
| 883 | # Make things extra clean, before making a distribution: |
| 884 | # remove all generated files, even Makefile[.pre] |
| 885 | distclean: clobber |
Neil Schemenauer | e0d4357 | 2001-02-03 17:16:29 +0000 | [diff] [blame] | 886 | -rm -f core Makefile Makefile.pre buildno config.status \ |
Neil Schemenauer | 7ac954b | 2001-01-26 16:14:41 +0000 | [diff] [blame] | 887 | Modules/Setup Modules/Setup.local Modules/Setup.config |
Neil Schemenauer | e0d4357 | 2001-02-03 17:16:29 +0000 | [diff] [blame] | 888 | find $(srcdir) '(' -name '*.fdc' -o -name '*~' \ |
| 889 | -o -name '[@,#]*' -o -name '*.old' \ |
| 890 | -o -name '*.orig' -o -name '*.rej' \ |
| 891 | -o -name '*.bak' ')' \ |
| 892 | -exec rm -f {} ';' |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 893 | |
| 894 | # Check for smelly exported symbols (not starting with Py/_Py) |
| 895 | smelly: all |
| 896 | nm -p $(LIBRARY) | \ |
| 897 | sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ |
| 898 | |
| 899 | # Find files with funny names |
| 900 | funny: |
| 901 | find $(DISTDIRS) -type d \ |
| 902 | -o -name '*.[chs]' \ |
| 903 | -o -name '*.py' \ |
| 904 | -o -name '*.doc' \ |
| 905 | -o -name '*.sty' \ |
| 906 | -o -name '*.bib' \ |
| 907 | -o -name '*.dat' \ |
| 908 | -o -name '*.el' \ |
| 909 | -o -name '*.fd' \ |
| 910 | -o -name '*.in' \ |
| 911 | -o -name '*.tex' \ |
| 912 | -o -name '*,[vpt]' \ |
| 913 | -o -name 'Setup' \ |
| 914 | -o -name 'Setup.*' \ |
| 915 | -o -name README \ |
| 916 | -o -name Makefile \ |
| 917 | -o -name ChangeLog \ |
| 918 | -o -name Repository \ |
| 919 | -o -name Root \ |
| 920 | -o -name Entries \ |
| 921 | -o -name Tag \ |
| 922 | -o -name tags \ |
| 923 | -o -name TAGS \ |
| 924 | -o -name .cvsignore \ |
| 925 | -o -name MANIFEST \ |
| 926 | -o -print |
| 927 | |
Guido van Rossum | 9454ad7 | 2001-08-18 21:08:22 +0000 | [diff] [blame] | 928 | # Dependencies |
| 929 | |
Martin v. Löwis | 06f15bb | 2001-12-02 13:02:32 +0000 | [diff] [blame] | 930 | Python/thread.o: @THREADHEADERS@ |
Guido van Rossum | 9454ad7 | 2001-08-18 21:08:22 +0000 | [diff] [blame] | 931 | |
Neil Schemenauer | 85515ad | 2001-01-24 17:11:43 +0000 | [diff] [blame] | 932 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |