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 |
| 10 | VERSION= 1.4 |
| 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 | f4449de | 1995-04-10 11:37:18 +0000 | [diff] [blame] | 28 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 29 | DEFS= @DEFS@ |
| 30 | LIBS= @LIBS@ |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 31 | LIBM= @LIBM@ |
| 32 | LIBC= @LIBC@ |
| 33 | |
Guido van Rossum | 45a9104 | 1995-08-08 14:18:12 +0000 | [diff] [blame] | 34 | # Machine-dependent subdirectories |
| 35 | MACHDEP= @MACHDEP@ |
| 36 | |
Guido van Rossum | 3bbc62e | 1995-01-02 19:30:30 +0000 | [diff] [blame] | 37 | # Install prefix for architecture-independent files |
| 38 | prefix= @prefix@ |
| 39 | |
| 40 | # Install prefix for architecture-dependent files |
| 41 | exec_prefix= @exec_prefix@ |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 42 | |
Guido van Rossum | 276de58 | 1996-07-31 17:37:07 +0000 | [diff] [blame] | 43 | # Expanded directories |
| 44 | BINDIR= $(exec_prefix)/bin |
| 45 | LIBDIR= $(exec_prefix)/lib |
| 46 | MANDIR= $(prefix)/man |
| 47 | INCLUDEDIR= $(prefix)/include |
| 48 | SCRIPTDIR= $(prefix)/lib |
| 49 | |
| 50 | # Detailed destination directories |
| 51 | BINLIBDEST= $(LIBDIR)/python$(VERSION) |
| 52 | LIBDEST= $(SCRIPTDIR)/python$(VERSION) |
| 53 | INCLUDEPY= $(INCLUDEDIR)/python$(VERSION) |
| 54 | LIBP= $(LIBDIR)/python$(VERSION) |
| 55 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 56 | # Symbols used for using shared libraries |
| 57 | SO= @SO@ |
| 58 | LDSHARED= @LDSHARED@ |
| 59 | CCSHARED= @CCSHARED@ |
| 60 | LINKFORSHARED= @LINKFORSHARED@ |
Guido van Rossum | 704fef2 | 1996-07-30 16:53:14 +0000 | [diff] [blame] | 61 | DESTSHARED= $(BINLIBDEST)/sharedmodules |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 62 | |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 63 | # Portable install script (configure doesn't always guess right) |
| 64 | INSTALL= @srcdir@/../install-sh -c |
Guido van Rossum | 704fef2 | 1996-07-30 16:53:14 +0000 | [diff] [blame] | 65 | INSTALL_PROGRAM=${INSTALL} -m 755 |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 66 | INSTALL_DATA= ${INSTALL} -m 644 |
Guido van Rossum | cde317a | 1996-08-20 19:46:35 +0000 | [diff] [blame] | 67 | # Shared libraries must be installed with executable mode on some systems; |
| 68 | # 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] | 69 | # Also, making them read-only seems to be a good idea... |
| 70 | INSTALL_SHARED= ${INSTALL} -m 555 |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 71 | |
Guido van Rossum | 275fbe2 | 1995-09-30 17:01:49 +0000 | [diff] [blame] | 72 | # === Variables that are customizable by hand or by inclusion in Setup === |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 73 | |
Guido van Rossum | f4449de | 1995-04-10 11:37:18 +0000 | [diff] [blame] | 74 | LINKCC= $(CC) |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 75 | INCLDIR= $(srcdir)/../Include |
Guido van Rossum | 450b9b3 | 1996-07-21 02:35:58 +0000 | [diff] [blame] | 76 | CONFIGINCLDIR= .. |
| 77 | CFLAGS= $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 78 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 79 | MKDEP= mkdep |
| 80 | SHELL= /bin/sh |
| 81 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 82 | MAKESETUP= $(srcdir)/makesetup |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 83 | |
Guido van Rossum | 275fbe2 | 1995-09-30 17:01:49 +0000 | [diff] [blame] | 84 | # (The makesetup script inserts all variable definitions found |
| 85 | # found in the Setup file just below the following line. |
| 86 | # This means that the Setup file can override any of the definitions |
| 87 | # given before this point, but not any given below. |
| 88 | # The script insert the definitions in reverse order, |
| 89 | # for the benefits of independent extensions.) |
| 90 | # === Definitions added by makesetup === |
| 91 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 92 | # === Fixed definitions === |
| 93 | |
| 94 | OBJS= $(MODOBJS) |
| 95 | |
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame^] | 96 | ADDOBJS= main.o config.o getpath.o getbuildinfo.o |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 97 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 98 | LIB= libModules.a |
| 99 | |
| 100 | MYLIBS= $(LIB) \ |
| 101 | ../Python/libPython.a \ |
| 102 | ../Objects/libObjects.a \ |
| 103 | ../Parser/libParser.a |
| 104 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 105 | SYSLIBS= $(LIBM) $(LIBC) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 106 | |
| 107 | |
| 108 | # === Rules === |
| 109 | |
Guido van Rossum | 2ce15a5 | 1994-10-20 21:59:38 +0000 | [diff] [blame] | 110 | all: $(LIB) ../python sharedmods |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 111 | |
Guido van Rossum | 450b9b3 | 1996-07-21 02:35:58 +0000 | [diff] [blame] | 112 | asharedmodule: $(ASHAREDMODULE)$(SO) |
| 113 | |
| 114 | $(ASHAREDMODULE)$(SO): $(ASHAREDMODULESOBS) |
Guido van Rossum | 07b983d | 1996-08-19 21:59:32 +0000 | [diff] [blame] | 115 | $(LDSHARED) $(LDFLAGS) -o $(ASHAREDMODULE)$(SO) $(ASHAREDMODULESOBS) \ |
Guido van Rossum | 450b9b3 | 1996-07-21 02:35:58 +0000 | [diff] [blame] | 116 | $(ASHAREDMODULESEXTRA) |
| 117 | |
Guido van Rossum | 087579e | 1995-01-17 16:11:29 +0000 | [diff] [blame] | 118 | $(LIB): $& $(OBJS) Makefile |
Guido van Rossum | 794b93e | 1994-08-23 13:51:25 +0000 | [diff] [blame] | 119 | -rm -f $(LIB) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 120 | $(AR) cr $(LIB) $(OBJS) |
| 121 | $(RANLIB) $(LIB) |
| 122 | |
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame^] | 123 | ../python: $(MYLIBS) $(ADDOBJS) Makefile buildno |
| 124 | expr `cat buildno` + 1 >@buildno |
| 125 | mv @buildno buildno |
| 126 | $(CC) -c $(CFLAGS) -DBUILD=`cat buildno` $(srcdir)/getbuildinfo.c |
| 127 | $(AR) r $(LIB) getbuildinfo.o |
Guido van Rossum | 07b983d | 1996-08-19 21:59:32 +0000 | [diff] [blame] | 128 | $(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \ |
Guido van Rossum | 72824ba | 1994-08-19 12:03:04 +0000 | [diff] [blame] | 129 | $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 130 | mv python ../python |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 131 | |
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame^] | 132 | buildno: |
| 133 | echo 0 >buildno |
| 134 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 135 | clean: |
| 136 | -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej |
| 137 | |
| 138 | clobber: clean |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 139 | -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre |
Guido van Rossum | 6554419 | 1996-08-08 19:07:46 +0000 | [diff] [blame] | 140 | -rm -f *.so *.sl so_locations |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 141 | |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 142 | getpath.o: getpath.c Makefile |
| 143 | $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ |
Guido van Rossum | c34c9a5 | 1996-06-12 04:20:27 +0000 | [diff] [blame] | 144 | -DPREFIX='"$(prefix)"' \ |
| 145 | -DEXEC_PREFIX='"$(exec_prefix)"' \ |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 146 | $(srcdir)/getpath.c |
| 147 | |
Guido van Rossum | 6fe01d4 | 1996-09-11 23:13:07 +0000 | [diff] [blame] | 148 | config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup Setup.local |
| 149 | $(SHELL) $(MAKESETUP) Setup Setup.local |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 150 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 151 | Setup: |
| 152 | cp $(srcdir)/Setup.in Setup |
| 153 | |
Guido van Rossum | 6fe01d4 | 1996-09-11 23:13:07 +0000 | [diff] [blame] | 154 | Setup.local: |
| 155 | echo "# Edit this file for local setup changes" >Setup.local |
| 156 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 157 | Makefile.pre: Makefile.pre.in ../config.status |
| 158 | (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \ |
| 159 | $(SHELL) config.status) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 160 | |
| 161 | depend: |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 162 | $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \ |
| 163 | sed 's|\(.*\)\.o|$(srcdir)/\1.c|'` |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 164 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 165 | .PRECIOUS: ../python |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 166 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 167 | glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs |
| 168 | python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.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 | almodule.o: almodule.c |
| 171 | arraymodule.o: arraymodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 172 | audioop.o: audioop.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 173 | cdmodule.o: cdmodule.c |
| 174 | clmodule.o: clmodule.c |
| 175 | dbmmodule.o: dbmmodule.c |
Guido van Rossum | 02530b0 | 1996-07-31 22:43:38 +0000 | [diff] [blame] | 176 | errnomodule.o: errnomodule.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 177 | fcntlmodule.o: fcntlmodule.c |
| 178 | flmodule.o: flmodule.c |
| 179 | fmmodule.o: fmmodule.c |
| 180 | glmodule.o: glmodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 181 | imageop.o: imageop.c |
| 182 | imgfile.o: imgfile.c |
Guido van Rossum | 37ba0bc | 1995-08-04 04:20:45 +0000 | [diff] [blame] | 183 | main.o: main.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 184 | mathmodule.o: mathmodule.c |
| 185 | md5c.o: md5c.c |
| 186 | md5module.o: md5module.c |
| 187 | mpzmodule.o: mpzmodule.c |
| 188 | nismodule.o: nismodule.c |
Guido van Rossum | 02530b0 | 1996-07-31 22:43:38 +0000 | [diff] [blame] | 189 | operator.o: operator.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 190 | parsermodule.o: parsermodule.c |
| 191 | posixmodule.o: posixmodule.c |
| 192 | pwdmodule.o: pwdmodule.c |
| 193 | regexmodule.o: regexmodule.c |
| 194 | regexpr.o: regexpr.c |
Guido van Rossum | 2e63139 | 1996-12-18 18:37:27 +0000 | [diff] [blame] | 195 | resource.o: resource.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 196 | rgbimgmodule.o: rgbimgmodule.c |
| 197 | rotormodule.o: rotormodule.c |
| 198 | selectmodule.o: selectmodule.c |
| 199 | sgimodule.o: sgimodule.c |
| 200 | socketmodule.o: socketmodule.c |
| 201 | stdwinmodule.o: stdwinmodule.c |
| 202 | stropmodule.o: stropmodule.c |
| 203 | structmodule.o: structmodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 204 | sunaudiodev.o: sunaudiodev.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 205 | svmodule.o: svmodule.c |
| 206 | threadmodule.o: threadmodule.c |
| 207 | timemodule.o: timemodule.c |
| 208 | timingmodule.o: timingmodule.c |
| 209 | xxmodule.o: xxmodule.c |
| 210 | yuvconvert.o: yuvconvert.c |
| 211 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 212 | # Rules to build and install all shared modules |
| 213 | sharedmods: $(SHAREDMODS) |
Guido van Rossum | 811fbbc | 1995-01-22 00:47:59 +0000 | [diff] [blame] | 214 | sharedinstall: $(DESTSHARED) $(SHAREDMODS) |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 215 | -for i in X $(SHAREDMODS); do \ |
| 216 | if test $$i != X; \ |
Guido van Rossum | cde317a | 1996-08-20 19:46:35 +0000 | [diff] [blame] | 217 | then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \ |
Guido van Rossum | ddcb36b | 1996-05-24 21:14:44 +0000 | [diff] [blame] | 218 | fi; \ |
| 219 | done |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 220 | |
Guido van Rossum | 450b9b3 | 1996-07-21 02:35:58 +0000 | [diff] [blame] | 221 | # Install a shared module from outside of setup |
| 222 | asharedinstall: $(DESTSHARED) $(ASHAREDMODULE)$(SO) |
| 223 | -for i in dummy $(ASHAREDMODULE)$(SO); do \ |
| 224 | if test -f $$i; then mv $$i $(DESTSHARED)/$$i; fi; done |
| 225 | |
| 226 | # This is handy when modules need to know where the destination directory is: |
| 227 | echodestshared: $(DESTSHARED) |
| 228 | echo $(DESTSHARED) |
| 229 | |
Guido van Rossum | 704fef2 | 1996-07-30 16:53:14 +0000 | [diff] [blame] | 230 | DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) |
Guido van Rossum | 2bd37e6 | 1996-06-17 17:33:11 +0000 | [diff] [blame] | 231 | |
Guido van Rossum | 4daf6ad | 1996-07-24 02:33:33 +0000 | [diff] [blame] | 232 | $(DESTSHARED): |
| 233 | @for i in $(DESTDIRS); \ |
| 234 | do \ |
| 235 | if test ! -d $$i; then \ |
| 236 | echo "Creating directory $$i"; \ |
| 237 | mkdir $$i; \ |
| 238 | chmod 755 $$i; \ |
| 239 | else true; \ |
| 240 | fi; \ |
| 241 | done |
Guido van Rossum | 811fbbc | 1995-01-22 00:47:59 +0000 | [diff] [blame] | 242 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 243 | # Stuff is appended here by makesetup and make depend |