Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 1 | # META-NOTE: this note is different from the note in the other Makefiles! |
| 2 | # NOTE: Makefile.pre.in is converted into Makefile.pre by the configure |
| 3 | # script in the toplevel directory or by ../config.status. |
| 4 | # Makefile.pre is converted into Makefile by running the makesetup |
| 5 | # script in the source directory. Once Makefile exists, it can be |
| 6 | # brought up to date by running "make Makefile". (The makesetup also |
| 7 | # creates config.c from config.c.in in the source directory.) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 8 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 9 | # === Variables set by makesetup === |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | 3bbc62e | 1995-01-02 19:30:30 +0000 | [diff] [blame] | 11 | MODOBJS= _MODOBJS_ |
| 12 | MODLIBS= _MODLIBS_ |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 13 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 14 | # === Variables set by configure === |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 15 | |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 16 | VERSION= @VERSION@ |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 17 | srcdir= @srcdir@ |
| 18 | VPATH= @srcdir@ |
| 19 | |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 20 | @SET_CCC@ |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 21 | CC= @CC@ |
| 22 | RANLIB= @RANLIB@ |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 23 | AR= @AR@ |
| 24 | |
Guido van Rossum | f4449de | 1995-04-10 11:37:18 +0000 | [diff] [blame] | 25 | OPT= @OPT@ |
Guido van Rossum | 07b983d | 1996-08-19 21:59:32 +0000 | [diff] [blame] | 26 | LDFLAGS= @LDFLAGS@ |
Guido van Rossum | bd5f193 | 1997-01-28 02:21:24 +0000 | [diff] [blame] | 27 | LDLAST= @LDLAST@ |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 28 | SGI_ABI= @SGI_ABI@ |
Guido van Rossum | f4449de | 1995-04-10 11:37:18 +0000 | [diff] [blame] | 29 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 30 | DEFS= @DEFS@ |
| 31 | LIBS= @LIBS@ |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 32 | LIBM= @LIBM@ |
| 33 | LIBC= @LIBC@ |
| 34 | |
Guido van Rossum | 45a9104 | 1995-08-08 14:18:12 +0000 | [diff] [blame] | 35 | # Machine-dependent subdirectories |
| 36 | MACHDEP= @MACHDEP@ |
| 37 | |
Guido van Rossum | 3bbc62e | 1995-01-02 19:30:30 +0000 | [diff] [blame] | 38 | # Install prefix for architecture-independent files |
| 39 | prefix= @prefix@ |
| 40 | |
| 41 | # Install prefix for architecture-dependent files |
| 42 | exec_prefix= @exec_prefix@ |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 43 | |
Guido van Rossum | 276de58 | 1996-07-31 17:37:07 +0000 | [diff] [blame] | 44 | # Expanded directories |
| 45 | BINDIR= $(exec_prefix)/bin |
| 46 | LIBDIR= $(exec_prefix)/lib |
| 47 | MANDIR= $(prefix)/man |
| 48 | INCLUDEDIR= $(prefix)/include |
| 49 | SCRIPTDIR= $(prefix)/lib |
| 50 | |
| 51 | # Detailed destination directories |
| 52 | BINLIBDEST= $(LIBDIR)/python$(VERSION) |
| 53 | LIBDEST= $(SCRIPTDIR)/python$(VERSION) |
| 54 | INCLUDEPY= $(INCLUDEDIR)/python$(VERSION) |
| 55 | LIBP= $(LIBDIR)/python$(VERSION) |
| 56 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 57 | # Symbols used for using shared libraries |
| 58 | SO= @SO@ |
| 59 | LDSHARED= @LDSHARED@ |
| 60 | CCSHARED= @CCSHARED@ |
| 61 | LINKFORSHARED= @LINKFORSHARED@ |
Guido van Rossum | 266033e | 1997-10-20 23:20:32 +0000 | [diff] [blame] | 62 | DESTSHARED= $(BINLIBDEST)/lib-dynload |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 63 | |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 64 | # Portable install script (configure doesn't always guess right) |
| 65 | INSTALL= @srcdir@/../install-sh -c |
Guido van Rossum | 704fef2 | 1996-07-30 16:53:14 +0000 | [diff] [blame] | 66 | INSTALL_PROGRAM=${INSTALL} -m 755 |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 67 | INSTALL_DATA= ${INSTALL} -m 644 |
Guido van Rossum | cde317a | 1996-08-20 19:46:35 +0000 | [diff] [blame] | 68 | # Shared libraries must be installed with executable mode on some systems; |
| 69 | # rather than figuring out exactly which, we always give them executable mode. |
Guido van Rossum | 6fe01d4 | 1996-09-11 23:13:07 +0000 | [diff] [blame] | 70 | # Also, making them read-only seems to be a good idea... |
| 71 | INSTALL_SHARED= ${INSTALL} -m 555 |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 72 | |
Guido van Rossum | 275fbe2 | 1995-09-30 17:01:49 +0000 | [diff] [blame] | 73 | # === Variables that are customizable by hand or by inclusion in Setup === |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 74 | |
Guido van Rossum | 25f9303 | 1997-08-18 16:00:04 +0000 | [diff] [blame] | 75 | LINKCC= @LINKCC@ |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 76 | INCLDIR= $(srcdir)/../Include |
Guido van Rossum | 450b9b3 | 1996-07-21 02:35:58 +0000 | [diff] [blame] | 77 | CONFIGINCLDIR= .. |
| 78 | CFLAGS= $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 79 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 80 | MKDEP= mkdep |
| 81 | SHELL= /bin/sh |
| 82 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 83 | MAKESETUP= $(srcdir)/makesetup |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 84 | |
Guido van Rossum | bcc2074 | 1998-08-04 22:53:56 +0000 | [diff] [blame] | 85 | # (The makesetup script inserts all variable definitions |
Guido van Rossum | 275fbe2 | 1995-09-30 17:01:49 +0000 | [diff] [blame] | 86 | # found in the Setup file just below the following line. |
| 87 | # This means that the Setup file can override any of the definitions |
| 88 | # given before this point, but not any given below. |
| 89 | # The script insert the definitions in reverse order, |
| 90 | # for the benefits of independent extensions.) |
| 91 | # === Definitions added by makesetup === |
| 92 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 93 | # === Fixed definitions === |
| 94 | |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 95 | FIXOBJS= config.o getpath.o main.o getbuildinfo.o |
| 96 | OBJS= $(MODOBJS) $(FIXOBJS) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 97 | |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 98 | MAINOBJ= python.o |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 99 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 100 | SYSLIBS= $(LIBM) $(LIBC) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 101 | |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 102 | LIBRARY= ../libpython$(VERSION).a |
Guido van Rossum | 3c4bb80 | 1997-12-18 23:55:32 +0000 | [diff] [blame] | 103 | REALLIBRARY= ../@REALLIBRARY@ |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 104 | |
| 105 | # === Rules === |
| 106 | |
Guido van Rossum | 79fa8b0 | 1997-08-18 14:23:13 +0000 | [diff] [blame] | 107 | all: $(OBJS) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 108 | |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 109 | # This target is used by the master Makefile to add the objects to the library. |
Guido van Rossum | 4f46fc6 | 1997-08-20 22:45:52 +0000 | [diff] [blame] | 110 | # To deal with the conflict between signalmodule.o and |
| 111 | # sigcheck.o+intrcheck.o, we remove the latter two if we have the former. |
Guido van Rossum | 5ec8e4b | 1997-07-25 22:35:24 +0000 | [diff] [blame] | 112 | add2lib: $(OBJS) |
Guido van Rossum | bae6523 | 1997-08-21 02:30:20 +0000 | [diff] [blame] | 113 | -for i in $(OBJS); do \ |
| 114 | if test "$$i" = "signalmodule.o"; then \ |
Guido van Rossum | bcc2074 | 1998-08-04 22:53:56 +0000 | [diff] [blame] | 115 | $(AR) d $(LIBRARY) sigcheck.o intrcheck.o 2>/dev/null; \ |
Guido van Rossum | bae6523 | 1997-08-21 02:30:20 +0000 | [diff] [blame] | 116 | break; \ |
| 117 | fi; \ |
| 118 | done |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 119 | $(AR) cr $(LIBRARY) $(OBJS) |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 120 | touch add2lib |
| 121 | |
Guido van Rossum | d14c068 | 1997-08-22 20:53:47 +0000 | [diff] [blame] | 122 | # Use ``EXE=.exe'' for Unix emulations on DOS/Windows |
| 123 | EXE= |
| 124 | |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 125 | # This target is used by the master Makefile to link the final binary. |
| 126 | link: $(MAINOBJ) |
Guido van Rossum | 3c4bb80 | 1997-12-18 23:55:32 +0000 | [diff] [blame] | 127 | $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \ |
Guido van Rossum | 3dd264c | 1998-01-13 18:57:24 +0000 | [diff] [blame] | 128 | $(LIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST) |
Guido van Rossum | d14c068 | 1997-08-22 20:53:47 +0000 | [diff] [blame] | 129 | mv python$(EXE) ../python$(EXE) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 130 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 131 | clean: |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 132 | -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej add2lib |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 133 | |
| 134 | clobber: clean |
Guido van Rossum | 02759c0 | 1998-05-14 02:33:57 +0000 | [diff] [blame] | 135 | -rm -f *.a tags TAGS config.c Makefile.pre |
Guido van Rossum | 6554419 | 1996-08-08 19:07:46 +0000 | [diff] [blame] | 136 | -rm -f *.so *.sl so_locations |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 137 | |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 138 | getpath.o: getpath.c Makefile |
| 139 | $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ |
Guido van Rossum | c34c9a5 | 1996-06-12 04:20:27 +0000 | [diff] [blame] | 140 | -DPREFIX='"$(prefix)"' \ |
| 141 | -DEXEC_PREFIX='"$(exec_prefix)"' \ |
Guido van Rossum | ec61b77 | 1997-04-11 17:04:49 +0000 | [diff] [blame] | 142 | -DVERSION='"$(VERSION)"' \ |
| 143 | -DVPATH='"$(VPATH)"' \ |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 144 | $(srcdir)/getpath.c |
| 145 | |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 146 | # When the configuration changes, we remove the library, so that it |
| 147 | # gets remade from scratch; this ensures to remove modules that are no |
| 148 | # longer pertinent (but that were in a previous configuration). |
Guido van Rossum | a0cbb3d | 1997-12-04 00:48:27 +0000 | [diff] [blame] | 149 | config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) |
| 150 | config.c Makefile: Setup.thread Setup Setup.local |
| 151 | config.c Makefile: |
Guido van Rossum | f6ca6aa | 1997-07-19 19:39:57 +0000 | [diff] [blame] | 152 | -rm -f $(LIBRARY) |
Guido van Rossum | a0cbb3d | 1997-12-04 00:48:27 +0000 | [diff] [blame] | 153 | $(SHELL) $(MAKESETUP) Setup.thread Setup.local Setup |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 154 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 155 | Setup: |
| 156 | cp $(srcdir)/Setup.in Setup |
| 157 | |
Guido van Rossum | 6fe01d4 | 1996-09-11 23:13:07 +0000 | [diff] [blame] | 158 | Setup.local: |
| 159 | echo "# Edit this file for local setup changes" >Setup.local |
| 160 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 161 | Makefile.pre: Makefile.pre.in ../config.status |
| 162 | (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \ |
| 163 | $(SHELL) config.status) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 164 | |
| 165 | depend: |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 166 | $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \ |
| 167 | sed 's|\(.*\)\.o|$(srcdir)/\1.c|'` |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 168 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 169 | .PRECIOUS: ../python |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 170 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 171 | glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs |
| 172 | python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 173 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 174 | almodule.o: almodule.c |
| 175 | arraymodule.o: arraymodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 176 | audioop.o: audioop.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 177 | cdmodule.o: cdmodule.c |
Guido van Rossum | 4f1099f | 1997-04-29 15:41:53 +0000 | [diff] [blame] | 178 | cgensupport.o: cgensupport.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 179 | clmodule.o: clmodule.c |
| 180 | dbmmodule.o: dbmmodule.c |
Guido van Rossum | 02530b0 | 1996-07-31 22:43:38 +0000 | [diff] [blame] | 181 | errnomodule.o: errnomodule.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 182 | fcntlmodule.o: fcntlmodule.c |
| 183 | flmodule.o: flmodule.c |
| 184 | fmmodule.o: fmmodule.c |
| 185 | glmodule.o: glmodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 186 | imageop.o: imageop.c |
| 187 | imgfile.o: imgfile.c |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 188 | main.o: main.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 189 | mathmodule.o: mathmodule.c |
| 190 | md5c.o: md5c.c |
| 191 | md5module.o: md5module.c |
| 192 | mpzmodule.o: mpzmodule.c |
| 193 | nismodule.o: nismodule.c |
Guido van Rossum | 02530b0 | 1996-07-31 22:43:38 +0000 | [diff] [blame] | 194 | operator.o: operator.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 195 | parsermodule.o: parsermodule.c |
| 196 | posixmodule.o: posixmodule.c |
| 197 | pwdmodule.o: pwdmodule.c |
| 198 | regexmodule.o: regexmodule.c |
| 199 | regexpr.o: regexpr.c |
Guido van Rossum | 2e63139 | 1996-12-18 18:37:27 +0000 | [diff] [blame] | 200 | resource.o: resource.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 201 | rgbimgmodule.o: rgbimgmodule.c |
| 202 | rotormodule.o: rotormodule.c |
| 203 | selectmodule.o: selectmodule.c |
| 204 | sgimodule.o: sgimodule.c |
| 205 | socketmodule.o: socketmodule.c |
| 206 | stdwinmodule.o: stdwinmodule.c |
| 207 | stropmodule.o: stropmodule.c |
| 208 | structmodule.o: structmodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 209 | sunaudiodev.o: sunaudiodev.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 210 | svmodule.o: svmodule.c |
| 211 | threadmodule.o: threadmodule.c |
| 212 | timemodule.o: timemodule.c |
| 213 | timingmodule.o: timingmodule.c |
| 214 | xxmodule.o: xxmodule.c |
| 215 | yuvconvert.o: yuvconvert.c |
| 216 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 217 | # Rules to build and install all shared modules |
| 218 | sharedmods: $(SHAREDMODS) |
Guido van Rossum | 811fbbc | 1995-01-22 00:47:59 +0000 | [diff] [blame] | 219 | sharedinstall: $(DESTSHARED) $(SHAREDMODS) |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 220 | -for i in X $(SHAREDMODS); do \ |
| 221 | if test $$i != X; \ |
Guido van Rossum | cde317a | 1996-08-20 19:46:35 +0000 | [diff] [blame] | 222 | then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \ |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 223 | fi; \ |
| 224 | done |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 225 | |
Guido van Rossum | 704fef2 | 1996-07-30 16:53:14 +0000 | [diff] [blame] | 226 | DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) |
Guido van Rossum | 2bd37e6 | 1996-06-17 17:33:11 +0000 | [diff] [blame] | 227 | |
Guido van Rossum | 4daf6ad | 1996-07-24 02:33:33 +0000 | [diff] [blame] | 228 | $(DESTSHARED): |
| 229 | @for i in $(DESTDIRS); \ |
| 230 | do \ |
| 231 | if test ! -d $$i; then \ |
| 232 | echo "Creating directory $$i"; \ |
| 233 | mkdir $$i; \ |
| 234 | chmod 755 $$i; \ |
| 235 | else true; \ |
| 236 | fi; \ |
| 237 | done |
Guido van Rossum | 811fbbc | 1995-01-22 00:47:59 +0000 | [diff] [blame] | 238 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 239 | # Stuff is appended here by makesetup and make depend |