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 | 6c1874f | 1995-01-10 17:43:33 +0000 | [diff] [blame] | 9 | LINKCC = $(CC) |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 10 | # === Variables set by makesetup === |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 11 | |
Guido van Rossum | 3bbc62e | 1995-01-02 19:30:30 +0000 | [diff] [blame] | 12 | MODOBJS= _MODOBJS_ |
| 13 | MODLIBS= _MODLIBS_ |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 14 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 15 | # === Definitions added by makesetup === |
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 | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 26 | DEFS= @DEFS@ |
| 27 | LIBS= @LIBS@ |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 28 | LIBM= @LIBM@ |
| 29 | LIBC= @LIBC@ |
| 30 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 31 | # Machine-dependent subdirectories |
| 32 | MACHDEP= @MACHDEP@ |
| 33 | |
Guido van Rossum | 3bbc62e | 1995-01-02 19:30:30 +0000 | [diff] [blame] | 34 | # Install prefix for architecture-independent files |
| 35 | prefix= @prefix@ |
| 36 | |
| 37 | # Install prefix for architecture-dependent files |
| 38 | exec_prefix= @exec_prefix@ |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 39 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 40 | # Symbols used for using shared libraries |
| 41 | SO= @SO@ |
| 42 | LDSHARED= @LDSHARED@ |
| 43 | CCSHARED= @CCSHARED@ |
| 44 | LINKFORSHARED= @LINKFORSHARED@ |
Guido van Rossum | 3bbc62e | 1995-01-02 19:30:30 +0000 | [diff] [blame] | 45 | DESTSHARED= $(exec_prefix)/lib/python/$(MACHDEP) |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 46 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 47 | |
| 48 | # === Variables that are customizable by hand === |
| 49 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 50 | INCLDIR= $(srcdir)/../Include |
Guido van Rossum | 794b93e | 1994-08-23 13:51:25 +0000 | [diff] [blame] | 51 | OPT= @OPT@ |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 52 | CFLAGS= $(OPT) -I$(INCLDIR) -I.. $(DEFS) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 53 | |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 54 | MKDEP= mkdep |
| 55 | SHELL= /bin/sh |
| 56 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 57 | MAKESETUP= $(srcdir)/makesetup |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 58 | |
| 59 | # === Fixed definitions === |
| 60 | |
| 61 | OBJS= $(MODOBJS) |
| 62 | |
| 63 | LIB= libModules.a |
| 64 | |
| 65 | MYLIBS= $(LIB) \ |
| 66 | ../Python/libPython.a \ |
| 67 | ../Objects/libObjects.a \ |
| 68 | ../Parser/libParser.a |
| 69 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 70 | SYSLIBS= $(LIBM) $(LIBC) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 71 | |
| 72 | |
| 73 | # === Rules === |
| 74 | |
Guido van Rossum | 2ce15a5 | 1994-10-20 21:59:38 +0000 | [diff] [blame] | 75 | all: $(LIB) ../python sharedmods |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 76 | |
Guido van Rossum | 087579e | 1995-01-17 16:11:29 +0000 | [diff] [blame^] | 77 | $(LIB): $& $(OBJS) Makefile |
Guido van Rossum | 794b93e | 1994-08-23 13:51:25 +0000 | [diff] [blame] | 78 | -rm -f $(LIB) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 79 | $(AR) cr $(LIB) $(OBJS) |
| 80 | $(RANLIB) $(LIB) |
| 81 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 82 | ../python: config.o $(MYLIBS) Makefile |
Guido van Rossum | 6c1874f | 1995-01-10 17:43:33 +0000 | [diff] [blame] | 83 | $(LINKCC) $(OPT) config.o $(LINKFORSHARED) \ |
Guido van Rossum | 72824ba | 1994-08-19 12:03:04 +0000 | [diff] [blame] | 84 | $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 85 | mv python ../python |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 86 | |
Guido van Rossum | 72824ba | 1994-08-19 12:03:04 +0000 | [diff] [blame] | 87 | config.o: config.c Makefile $(MYLIBS) |
Guido van Rossum | 6c1874f | 1995-01-10 17:43:33 +0000 | [diff] [blame] | 88 | $(LINKCC) $(CFLAGS) -DPYTHONPATH=\"$(PYTHONPATH)\" -c config.c |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 89 | |
| 90 | clean: |
| 91 | -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej |
| 92 | |
| 93 | clobber: clean |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 94 | -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre |
Guido van Rossum | f5e0ea8 | 1994-09-12 15:35:36 +0000 | [diff] [blame] | 95 | -rm -f *.so so_locations |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 96 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 97 | config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup |
| 98 | $(SHELL) $(MAKESETUP) Setup |
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 | Setup: |
| 101 | cp $(srcdir)/Setup.in Setup |
| 102 | |
| 103 | Makefile.pre: Makefile.pre.in ../config.status |
| 104 | (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \ |
| 105 | $(SHELL) config.status) |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 106 | |
| 107 | depend: |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 108 | $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \ |
| 109 | sed 's|\(.*\)\.o|$(srcdir)/\1.c|'` |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 110 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 111 | .PRECIOUS: ../python |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 112 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 113 | glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs |
| 114 | python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 115 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 116 | almodule.o: almodule.c |
| 117 | arraymodule.o: arraymodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 118 | audioop.o: audioop.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 119 | cdmodule.o: cdmodule.c |
| 120 | clmodule.o: clmodule.c |
| 121 | dbmmodule.o: dbmmodule.c |
| 122 | fcntlmodule.o: fcntlmodule.c |
| 123 | flmodule.o: flmodule.c |
| 124 | fmmodule.o: fmmodule.c |
| 125 | glmodule.o: glmodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 126 | imageop.o: imageop.c |
| 127 | imgfile.o: imgfile.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 128 | mathmodule.o: mathmodule.c |
| 129 | md5c.o: md5c.c |
| 130 | md5module.o: md5module.c |
| 131 | mpzmodule.o: mpzmodule.c |
| 132 | nismodule.o: nismodule.c |
| 133 | parsermodule.o: parsermodule.c |
| 134 | posixmodule.o: posixmodule.c |
| 135 | pwdmodule.o: pwdmodule.c |
| 136 | regexmodule.o: regexmodule.c |
| 137 | regexpr.o: regexpr.c |
| 138 | rgbimgmodule.o: rgbimgmodule.c |
| 139 | rotormodule.o: rotormodule.c |
| 140 | selectmodule.o: selectmodule.c |
| 141 | sgimodule.o: sgimodule.c |
| 142 | socketmodule.o: socketmodule.c |
| 143 | stdwinmodule.o: stdwinmodule.c |
| 144 | stropmodule.o: stropmodule.c |
| 145 | structmodule.o: structmodule.c |
Guido van Rossum | c65a525 | 1994-08-05 13:44:50 +0000 | [diff] [blame] | 146 | sunaudiodev.o: sunaudiodev.c |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 147 | svmodule.o: svmodule.c |
| 148 | threadmodule.o: threadmodule.c |
| 149 | timemodule.o: timemodule.c |
| 150 | timingmodule.o: timingmodule.c |
| 151 | xxmodule.o: xxmodule.c |
| 152 | yuvconvert.o: yuvconvert.c |
| 153 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 154 | # Rules to build and install all shared modules |
| 155 | sharedmods: $(SHAREDMODS) |
| 156 | sharedinstall: $(SHAREDMODS) |
Guido van Rossum | 3bbc62e | 1995-01-02 19:30:30 +0000 | [diff] [blame] | 157 | for i in dummy $(SHAREDMODS); do \ |
| 158 | if test -f $$i; then mv $$i $(DESTSHARED)/$$i; fi; done |
Guido van Rossum | fba715a | 1994-01-02 00:26:09 +0000 | [diff] [blame] | 159 | |
Guido van Rossum | 7cc5abd | 1994-09-12 10:42:20 +0000 | [diff] [blame] | 160 | # Stuff is appended here by makesetup and make depend |