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 | 4daf6ad | 1996-07-24 02:33:33 +0000 | [diff] [blame] | 9 | # Interpreter version number, for library destination pathnames |
Guido van Rossum | f631d13 | 1997-01-22 03:45:38 +0000 | [diff] [blame] | 10 | VERSION= 1.5 |
Guido van Rossum | 4daf6ad | 1996-07-24 02:33:33 +0000 | [diff] [blame] | 11 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 12 | # === Variables set by makesetup === |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 13 | |
Guido van Rossum | 3bbc62e | 1995-01-02 19:30:30 +0000 | [diff] [blame] | 14 | MODOBJS= _MODOBJS_ |
| 15 | MODLIBS= _MODLIBS_ |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 16 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 17 | # === Variables set by configure === |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 18 | |
| 19 | srcdir= @srcdir@ |
| 20 | VPATH= @srcdir@ |
| 21 | |
| 22 | CC= @CC@ |
| 23 | RANLIB= @RANLIB@ |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 24 | AR= @AR@ |
| 25 | |
Guido van Rossum | f4449de | 1995-04-10 11:37:18 +0000 | [diff] [blame] | 26 | OPT= @OPT@ |
Guido van Rossum | 07b983d | 1996-08-19 21:59:32 +0000 | [diff] [blame] | 27 | LDFLAGS= @LDFLAGS@ |
Guido van Rossum | bd5f193 | 1997-01-28 02:21:24 +0000 | [diff] [blame] | 28 | LDLAST= @LDLAST@ |
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 | 704fef2 | 1996-07-30 16:53:14 +0000 | [diff] [blame] | 62 | DESTSHARED= $(BINLIBDEST)/sharedmodules |
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 | f4449de | 1995-04-10 11:37:18 +0000 | [diff] [blame] | 75 | LINKCC= $(CC) |
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 | 275fbe2 | 1995-09-30 17:01:49 +0000 | [diff] [blame] | 85 | # (The makesetup script inserts all variable definitions found |
| 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 | |
| 95 | OBJS= $(MODOBJS) |
| 96 | |
Guido van Rossum | 4f1099f | 1997-04-29 15:41:53 +0000 | [diff] [blame] | 97 | # XXX Should getpath.o (and may be others) be added to OBJS? |
| 98 | |
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame] | 99 | ADDOBJS= main.o config.o getpath.o getbuildinfo.o |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 100 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 101 | LIB= libModules.a |
| 102 | |
| 103 | MYLIBS= $(LIB) \ |
| 104 | ../Python/libPython.a \ |
| 105 | ../Objects/libObjects.a \ |
| 106 | ../Parser/libParser.a |
| 107 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 108 | SYSLIBS= $(LIBM) $(LIBC) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 109 | |
| 110 | |
| 111 | # === Rules === |
| 112 | |
Guido van Rossum | 2ce15a5 | 1994-10-20 21:59:38 +0000 | [diff] [blame] | 113 | all: $(LIB) ../python sharedmods |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 114 | |
Guido van Rossum | 450b9b3 | 1996-07-21 02:35:58 +0000 | [diff] [blame] | 115 | asharedmodule: $(ASHAREDMODULE)$(SO) |
| 116 | |
| 117 | $(ASHAREDMODULE)$(SO): $(ASHAREDMODULESOBS) |
Guido van Rossum | 07b983d | 1996-08-19 21:59:32 +0000 | [diff] [blame] | 118 | $(LDSHARED) $(LDFLAGS) -o $(ASHAREDMODULE)$(SO) $(ASHAREDMODULESOBS) \ |
Guido van Rossum | 450b9b3 | 1996-07-21 02:35:58 +0000 | [diff] [blame] | 119 | $(ASHAREDMODULESEXTRA) |
| 120 | |
Guido van Rossum | 087579e | 1995-01-17 16:11:29 +0000 | [diff] [blame] | 121 | $(LIB): $& $(OBJS) Makefile |
Guido van Rossum | 794b93e | 1994-08-23 13:51:25 +0000 | [diff] [blame] | 122 | -rm -f $(LIB) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 123 | $(AR) cr $(LIB) $(OBJS) |
| 124 | $(RANLIB) $(LIB) |
| 125 | |
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame] | 126 | ../python: $(MYLIBS) $(ADDOBJS) Makefile buildno |
| 127 | expr `cat buildno` + 1 >@buildno |
| 128 | mv @buildno buildno |
| 129 | $(CC) -c $(CFLAGS) -DBUILD=`cat buildno` $(srcdir)/getbuildinfo.c |
| 130 | $(AR) r $(LIB) getbuildinfo.o |
Guido van Rossum | 07b983d | 1996-08-19 21:59:32 +0000 | [diff] [blame] | 131 | $(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \ |
Guido van Rossum | bd5f193 | 1997-01-28 02:21:24 +0000 | [diff] [blame] | 132 | $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST) |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 133 | mv python ../python |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 134 | |
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame] | 135 | buildno: |
| 136 | echo 0 >buildno |
| 137 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 138 | clean: |
| 139 | -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej |
| 140 | |
| 141 | clobber: clean |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 142 | -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre |
Guido van Rossum | 6554419 | 1996-08-08 19:07:46 +0000 | [diff] [blame] | 143 | -rm -f *.so *.sl so_locations |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 144 | |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 145 | getpath.o: getpath.c Makefile |
| 146 | $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ |
Guido van Rossum | c34c9a5 | 1996-06-12 04:20:27 +0000 | [diff] [blame] | 147 | -DPREFIX='"$(prefix)"' \ |
| 148 | -DEXEC_PREFIX='"$(exec_prefix)"' \ |
Guido van Rossum | ec61b77 | 1997-04-11 17:04:49 +0000 | [diff] [blame] | 149 | -DVERSION='"$(VERSION)"' \ |
| 150 | -DVPATH='"$(VPATH)"' \ |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 151 | $(srcdir)/getpath.c |
| 152 | |
Guido van Rossum | 6fe01d4 | 1996-09-11 23:13:07 +0000 | [diff] [blame] | 153 | config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup Setup.local |
| 154 | $(SHELL) $(MAKESETUP) Setup Setup.local |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 155 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 156 | Setup: |
| 157 | cp $(srcdir)/Setup.in Setup |
| 158 | |
Guido van Rossum | 6fe01d4 | 1996-09-11 23:13:07 +0000 | [diff] [blame] | 159 | Setup.local: |
| 160 | echo "# Edit this file for local setup changes" >Setup.local |
| 161 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 162 | Makefile.pre: Makefile.pre.in ../config.status |
| 163 | (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \ |
| 164 | $(SHELL) config.status) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 165 | |
| 166 | depend: |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 167 | $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \ |
| 168 | sed 's|\(.*\)\.o|$(srcdir)/\1.c|'` |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 169 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 170 | .PRECIOUS: ../python |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 171 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 172 | glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs |
| 173 | python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 174 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 175 | almodule.o: almodule.c |
| 176 | arraymodule.o: arraymodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 177 | audioop.o: audioop.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 178 | cdmodule.o: cdmodule.c |
Guido van Rossum | 4f1099f | 1997-04-29 15:41:53 +0000 | [diff] [blame] | 179 | cgensupport.o: cgensupport.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 180 | clmodule.o: clmodule.c |
| 181 | dbmmodule.o: dbmmodule.c |
Guido van Rossum | 02530b0 | 1996-07-31 22:43:38 +0000 | [diff] [blame] | 182 | errnomodule.o: errnomodule.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 183 | fcntlmodule.o: fcntlmodule.c |
| 184 | flmodule.o: flmodule.c |
| 185 | fmmodule.o: fmmodule.c |
| 186 | glmodule.o: glmodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 187 | imageop.o: imageop.c |
| 188 | imgfile.o: imgfile.c |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 189 | main.o: main.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 190 | mathmodule.o: mathmodule.c |
| 191 | md5c.o: md5c.c |
| 192 | md5module.o: md5module.c |
| 193 | mpzmodule.o: mpzmodule.c |
| 194 | nismodule.o: nismodule.c |
Guido van Rossum | 02530b0 | 1996-07-31 22:43:38 +0000 | [diff] [blame] | 195 | operator.o: operator.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 196 | parsermodule.o: parsermodule.c |
| 197 | posixmodule.o: posixmodule.c |
| 198 | pwdmodule.o: pwdmodule.c |
| 199 | regexmodule.o: regexmodule.c |
| 200 | regexpr.o: regexpr.c |
Guido van Rossum | 2e63139 | 1996-12-18 18:37:27 +0000 | [diff] [blame] | 201 | resource.o: resource.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 202 | rgbimgmodule.o: rgbimgmodule.c |
| 203 | rotormodule.o: rotormodule.c |
| 204 | selectmodule.o: selectmodule.c |
| 205 | sgimodule.o: sgimodule.c |
| 206 | socketmodule.o: socketmodule.c |
| 207 | stdwinmodule.o: stdwinmodule.c |
| 208 | stropmodule.o: stropmodule.c |
| 209 | structmodule.o: structmodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 210 | sunaudiodev.o: sunaudiodev.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 211 | svmodule.o: svmodule.c |
| 212 | threadmodule.o: threadmodule.c |
| 213 | timemodule.o: timemodule.c |
| 214 | timingmodule.o: timingmodule.c |
| 215 | xxmodule.o: xxmodule.c |
| 216 | yuvconvert.o: yuvconvert.c |
| 217 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 218 | # Rules to build and install all shared modules |
| 219 | sharedmods: $(SHAREDMODS) |
Guido van Rossum | 811fbbc | 1995-01-22 00:47:59 +0000 | [diff] [blame] | 220 | sharedinstall: $(DESTSHARED) $(SHAREDMODS) |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 221 | -for i in X $(SHAREDMODS); do \ |
| 222 | if test $$i != X; \ |
Guido van Rossum | cde317a | 1996-08-20 19:46:35 +0000 | [diff] [blame] | 223 | then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \ |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 224 | fi; \ |
| 225 | done |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 226 | |
Guido van Rossum | 450b9b3 | 1996-07-21 02:35:58 +0000 | [diff] [blame] | 227 | # Install a shared module from outside of setup |
| 228 | asharedinstall: $(DESTSHARED) $(ASHAREDMODULE)$(SO) |
| 229 | -for i in dummy $(ASHAREDMODULE)$(SO); do \ |
| 230 | if test -f $$i; then mv $$i $(DESTSHARED)/$$i; fi; done |
| 231 | |
| 232 | # This is handy when modules need to know where the destination directory is: |
| 233 | echodestshared: $(DESTSHARED) |
| 234 | echo $(DESTSHARED) |
| 235 | |
Guido van Rossum | 704fef2 | 1996-07-30 16:53:14 +0000 | [diff] [blame] | 236 | DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) |
Guido van Rossum | 2bd37e6 | 1996-06-17 17:33:11 +0000 | [diff] [blame] | 237 | |
Guido van Rossum | 4daf6ad | 1996-07-24 02:33:33 +0000 | [diff] [blame] | 238 | $(DESTSHARED): |
| 239 | @for i in $(DESTDIRS); \ |
| 240 | do \ |
| 241 | if test ! -d $$i; then \ |
| 242 | echo "Creating directory $$i"; \ |
| 243 | mkdir $$i; \ |
| 244 | chmod 755 $$i; \ |
| 245 | else true; \ |
| 246 | fi; \ |
| 247 | done |
Guido van Rossum | 811fbbc | 1995-01-22 00:47:59 +0000 | [diff] [blame] | 248 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 249 | # Stuff is appended here by makesetup and make depend |