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