blob: 4d306e732bde1684aaf04462095d726055c8113b [file] [log] [blame]
Guido van Rossumb6775db1994-08-01 11:34:53 +00001# 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 Rossumfba715a1994-01-02 00:26:09 +00008
Guido van Rossumb6775db1994-08-01 11:34:53 +00009# === Variables set by makesetup ===
Guido van Rossumfba715a1994-01-02 00:26:09 +000010
Guido van Rossum3bbc62e1995-01-02 19:30:30 +000011MODOBJS= _MODOBJS_
12MODLIBS= _MODLIBS_
Guido van Rossumfba715a1994-01-02 00:26:09 +000013
Guido van Rossumb6775db1994-08-01 11:34:53 +000014# === Variables set by configure ===
Guido van Rossumfba715a1994-01-02 00:26:09 +000015
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +000016VERSION= @VERSION@
Guido van Rossumfba715a1994-01-02 00:26:09 +000017srcdir= @srcdir@
18VPATH= @srcdir@
19
Guido van Rossum91922671997-10-09 20:24:13 +000020@SET_CCC@
Guido van Rossumfba715a1994-01-02 00:26:09 +000021CC= @CC@
22RANLIB= @RANLIB@
Guido van Rossumb6775db1994-08-01 11:34:53 +000023AR= @AR@
24
Guido van Rossumf4449de1995-04-10 11:37:18 +000025OPT= @OPT@
Guido van Rossum07b983d1996-08-19 21:59:32 +000026LDFLAGS= @LDFLAGS@
Guido van Rossumbd5f1931997-01-28 02:21:24 +000027LDLAST= @LDLAST@
Guido van Rossum91922671997-10-09 20:24:13 +000028SGI_ABI= @SGI_ABI@
Guido van Rossumf4449de1995-04-10 11:37:18 +000029
Guido van Rossumfba715a1994-01-02 00:26:09 +000030DEFS= @DEFS@
31LIBS= @LIBS@
Guido van Rossumb6775db1994-08-01 11:34:53 +000032LIBM= @LIBM@
33LIBC= @LIBC@
34
Guido van Rossum45a91041995-08-08 14:18:12 +000035# Machine-dependent subdirectories
36MACHDEP= @MACHDEP@
37
Guido van Rossum3bbc62e1995-01-02 19:30:30 +000038# Install prefix for architecture-independent files
39prefix= @prefix@
40
41# Install prefix for architecture-dependent files
42exec_prefix= @exec_prefix@
Guido van Rossumfba715a1994-01-02 00:26:09 +000043
Guido van Rossum276de581996-07-31 17:37:07 +000044# Expanded directories
45BINDIR= $(exec_prefix)/bin
46LIBDIR= $(exec_prefix)/lib
47MANDIR= $(prefix)/man
48INCLUDEDIR= $(prefix)/include
49SCRIPTDIR= $(prefix)/lib
50
51# Detailed destination directories
52BINLIBDEST= $(LIBDIR)/python$(VERSION)
53LIBDEST= $(SCRIPTDIR)/python$(VERSION)
54INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
55LIBP= $(LIBDIR)/python$(VERSION)
56
Guido van Rossum7cc5abd1994-09-12 10:42:20 +000057# Symbols used for using shared libraries
58SO= @SO@
59LDSHARED= @LDSHARED@
60CCSHARED= @CCSHARED@
61LINKFORSHARED= @LINKFORSHARED@
Guido van Rossum266033e1997-10-20 23:20:32 +000062DESTSHARED= $(BINLIBDEST)/lib-dynload
Guido van Rossum7cc5abd1994-09-12 10:42:20 +000063
Guido van Rossumddcb36b1996-05-24 21:14:44 +000064# Portable install script (configure doesn't always guess right)
65INSTALL= @srcdir@/../install-sh -c
Guido van Rossum704fef21996-07-30 16:53:14 +000066INSTALL_PROGRAM=${INSTALL} -m 755
Guido van Rossumddcb36b1996-05-24 21:14:44 +000067INSTALL_DATA= ${INSTALL} -m 644
Guido van Rossumcde317a1996-08-20 19:46:35 +000068# 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 Rossum6fe01d41996-09-11 23:13:07 +000070# Also, making them read-only seems to be a good idea...
71INSTALL_SHARED= ${INSTALL} -m 555
Guido van Rossumddcb36b1996-05-24 21:14:44 +000072
Guido van Rossum275fbe21995-09-30 17:01:49 +000073# === Variables that are customizable by hand or by inclusion in Setup ===
Guido van Rossumfba715a1994-01-02 00:26:09 +000074
Guido van Rossum25f93031997-08-18 16:00:04 +000075LINKCC= @LINKCC@
Guido van Rossumb6775db1994-08-01 11:34:53 +000076INCLDIR= $(srcdir)/../Include
Guido van Rossum450b9b31996-07-21 02:35:58 +000077CONFIGINCLDIR= ..
78CFLAGS= $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS)
Guido van Rossumfba715a1994-01-02 00:26:09 +000079
Guido van Rossumfba715a1994-01-02 00:26:09 +000080MKDEP= mkdep
81SHELL= /bin/sh
82
Guido van Rossumb6775db1994-08-01 11:34:53 +000083MAKESETUP= $(srcdir)/makesetup
Guido van Rossumfba715a1994-01-02 00:26:09 +000084
Guido van Rossumbcc20741998-08-04 22:53:56 +000085# (The makesetup script inserts all variable definitions
Guido van Rossum275fbe21995-09-30 17:01:49 +000086# 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 Rossumfba715a1994-01-02 00:26:09 +000093# === Fixed definitions ===
94
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +000095FIXOBJS= config.o getpath.o main.o getbuildinfo.o
96OBJS= $(MODOBJS) $(FIXOBJS)
Guido van Rossumfba715a1994-01-02 00:26:09 +000097
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +000098MAINOBJ= python.o
Guido van Rossumfba715a1994-01-02 00:26:09 +000099
Guido van Rossumb6775db1994-08-01 11:34:53 +0000100SYSLIBS= $(LIBM) $(LIBC)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000101
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +0000102LIBRARY= ../libpython$(VERSION).a
Guido van Rossum3c4bb801997-12-18 23:55:32 +0000103REALLIBRARY= ../@REALLIBRARY@
Guido van Rossumfba715a1994-01-02 00:26:09 +0000104
105# === Rules ===
106
Guido van Rossum79fa8b01997-08-18 14:23:13 +0000107all: $(OBJS)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000108
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +0000109# This target is used by the master Makefile to add the objects to the library.
Guido van Rossum4f46fc61997-08-20 22:45:52 +0000110# 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 Rossum5ec8e4b1997-07-25 22:35:24 +0000112add2lib: $(OBJS)
Guido van Rossum2a570041998-10-07 22:51:56 +0000113 -if test -f hassignal; \
114 then echo removing sigcheck.o intrcheck.o; \
115 $(AR) d $(LIBRARY) sigcheck.o intrcheck.o 2>/dev/null; \
116 else echo leaving sigcheck.o intrcheck.o in; fi
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +0000117 $(AR) cr $(LIBRARY) $(OBJS)
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +0000118 touch add2lib
119
Guido van Rossumd14c0681997-08-22 20:53:47 +0000120# Use ``EXE=.exe'' for Unix emulations on DOS/Windows
121EXE=
122
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +0000123# This target is used by the master Makefile to link the final binary.
124link: $(MAINOBJ)
Guido van Rossum3c4bb801997-12-18 23:55:32 +0000125 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \
Guido van Rossum3dd264c1998-01-13 18:57:24 +0000126 $(LIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
Guido van Rossumd14c0681997-08-22 20:53:47 +0000127 mv python$(EXE) ../python$(EXE)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000128
Guido van Rossumfba715a1994-01-02 00:26:09 +0000129clean:
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +0000130 -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej add2lib
Guido van Rossumfba715a1994-01-02 00:26:09 +0000131
132clobber: clean
Guido van Rossum02759c01998-05-14 02:33:57 +0000133 -rm -f *.a tags TAGS config.c Makefile.pre
Guido van Rossum65544191996-08-08 19:07:46 +0000134 -rm -f *.so *.sl so_locations
Guido van Rossumfba715a1994-01-02 00:26:09 +0000135
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000136getpath.o: getpath.c Makefile
137 $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
Guido van Rossumc34c9a51996-06-12 04:20:27 +0000138 -DPREFIX='"$(prefix)"' \
139 -DEXEC_PREFIX='"$(exec_prefix)"' \
Guido van Rossumec61b771997-04-11 17:04:49 +0000140 -DVERSION='"$(VERSION)"' \
141 -DVPATH='"$(VPATH)"' \
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000142 $(srcdir)/getpath.c
143
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +0000144# When the configuration changes, we remove the library, so that it
145# gets remade from scratch; this ensures to remove modules that are no
146# longer pertinent (but that were in a previous configuration).
Guido van Rossuma0cbb3d1997-12-04 00:48:27 +0000147config.c Makefile: Makefile.pre config.c.in $(MAKESETUP)
148config.c Makefile: Setup.thread Setup Setup.local
149config.c Makefile:
Guido van Rossumf6ca6aa1997-07-19 19:39:57 +0000150 -rm -f $(LIBRARY)
Guido van Rossuma0cbb3d1997-12-04 00:48:27 +0000151 $(SHELL) $(MAKESETUP) Setup.thread Setup.local Setup
Guido van Rossumfba715a1994-01-02 00:26:09 +0000152
Guido van Rossum2a570041998-10-07 22:51:56 +0000153hassignal:
154 -rm -f hassignal
155 -for i in $(OBJS); do \
156 if test "$$i" = "signalmodule.o"; then \
157 echo yes >hassignal; break; \
158 fi; \
159 done
160
Guido van Rossumb6775db1994-08-01 11:34:53 +0000161Setup:
162 cp $(srcdir)/Setup.in Setup
163
Guido van Rossum6fe01d41996-09-11 23:13:07 +0000164Setup.local:
165 echo "# Edit this file for local setup changes" >Setup.local
166
Guido van Rossumb6775db1994-08-01 11:34:53 +0000167Makefile.pre: Makefile.pre.in ../config.status
168 (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \
169 $(SHELL) config.status)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000170
171depend:
Guido van Rossumb6775db1994-08-01 11:34:53 +0000172 $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
173 sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
Guido van Rossumfba715a1994-01-02 00:26:09 +0000174
Guido van Rossumb6775db1994-08-01 11:34:53 +0000175.PRECIOUS: ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +0000176
Guido van Rossumb6775db1994-08-01 11:34:53 +0000177glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs
178 python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c
Guido van Rossumfba715a1994-01-02 00:26:09 +0000179
Guido van Rossumb6775db1994-08-01 11:34:53 +0000180almodule.o: almodule.c
181arraymodule.o: arraymodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000182audioop.o: audioop.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000183cdmodule.o: cdmodule.c
Guido van Rossum4f1099f1997-04-29 15:41:53 +0000184cgensupport.o: cgensupport.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000185clmodule.o: clmodule.c
186dbmmodule.o: dbmmodule.c
Guido van Rossum02530b01996-07-31 22:43:38 +0000187errnomodule.o: errnomodule.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000188fcntlmodule.o: fcntlmodule.c
189flmodule.o: flmodule.c
190fmmodule.o: fmmodule.c
191glmodule.o: glmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000192imageop.o: imageop.c
193imgfile.o: imgfile.c
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000194main.o: main.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000195mathmodule.o: mathmodule.c
196md5c.o: md5c.c
197md5module.o: md5module.c
198mpzmodule.o: mpzmodule.c
199nismodule.o: nismodule.c
Guido van Rossum02530b01996-07-31 22:43:38 +0000200operator.o: operator.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000201parsermodule.o: parsermodule.c
202posixmodule.o: posixmodule.c
203pwdmodule.o: pwdmodule.c
204regexmodule.o: regexmodule.c
205regexpr.o: regexpr.c
Guido van Rossum2e631391996-12-18 18:37:27 +0000206resource.o: resource.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000207rgbimgmodule.o: rgbimgmodule.c
208rotormodule.o: rotormodule.c
209selectmodule.o: selectmodule.c
210sgimodule.o: sgimodule.c
211socketmodule.o: socketmodule.c
212stdwinmodule.o: stdwinmodule.c
213stropmodule.o: stropmodule.c
214structmodule.o: structmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000215sunaudiodev.o: sunaudiodev.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000216svmodule.o: svmodule.c
217threadmodule.o: threadmodule.c
218timemodule.o: timemodule.c
219timingmodule.o: timingmodule.c
220xxmodule.o: xxmodule.c
221yuvconvert.o: yuvconvert.c
222
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000223# Rules to build and install all shared modules
224sharedmods: $(SHAREDMODS)
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000225sharedinstall: $(DESTSHARED) $(SHAREDMODS)
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000226 -for i in X $(SHAREDMODS); do \
227 if test $$i != X; \
Guido van Rossumcde317a1996-08-20 19:46:35 +0000228 then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000229 fi; \
230 done
Guido van Rossumfba715a1994-01-02 00:26:09 +0000231
Guido van Rossum704fef21996-07-30 16:53:14 +0000232DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
Guido van Rossum2bd37e61996-06-17 17:33:11 +0000233
Guido van Rossum4daf6ad1996-07-24 02:33:33 +0000234$(DESTSHARED):
235 @for i in $(DESTDIRS); \
236 do \
237 if test ! -d $$i; then \
238 echo "Creating directory $$i"; \
239 mkdir $$i; \
240 chmod 755 $$i; \
241 else true; \
242 fi; \
243 done
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000244
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000245# Stuff is appended here by makesetup and make depend