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