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