blob: a5f0d9a5c4fbfb98e59da8a03c78c85cfcd77f11 [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 Rossum4daf6ad1996-07-24 02:33:33 +00009# Interpreter version number, for library destination pathnames
10VERSION= 1.4
11
Guido van Rossumb6775db1994-08-01 11:34:53 +000012# === Variables set by makesetup ===
Guido van Rossumfba715a1994-01-02 00:26:09 +000013
Guido van Rossum3bbc62e1995-01-02 19:30:30 +000014MODOBJS= _MODOBJS_
15MODLIBS= _MODLIBS_
Guido van Rossumfba715a1994-01-02 00:26:09 +000016
Guido van Rossumb6775db1994-08-01 11:34:53 +000017# === Variables set by configure ===
Guido van Rossumfba715a1994-01-02 00:26:09 +000018
19srcdir= @srcdir@
20VPATH= @srcdir@
21
22CC= @CC@
23RANLIB= @RANLIB@
Guido van Rossumb6775db1994-08-01 11:34:53 +000024AR= @AR@
25
Guido van Rossumf4449de1995-04-10 11:37:18 +000026OPT= @OPT@
Guido van Rossum07b983d1996-08-19 21:59:32 +000027LDFLAGS= @LDFLAGS@
Guido van Rossumf4449de1995-04-10 11:37:18 +000028
Guido van Rossumfba715a1994-01-02 00:26:09 +000029DEFS= @DEFS@
30LIBS= @LIBS@
Guido van Rossumb6775db1994-08-01 11:34:53 +000031LIBM= @LIBM@
32LIBC= @LIBC@
33
Guido van Rossum45a91041995-08-08 14:18:12 +000034# Machine-dependent subdirectories
35MACHDEP= @MACHDEP@
36
Guido van Rossum3bbc62e1995-01-02 19:30:30 +000037# Install prefix for architecture-independent files
38prefix= @prefix@
39
40# Install prefix for architecture-dependent files
41exec_prefix= @exec_prefix@
Guido van Rossumfba715a1994-01-02 00:26:09 +000042
Guido van Rossum276de581996-07-31 17:37:07 +000043# Expanded directories
44BINDIR= $(exec_prefix)/bin
45LIBDIR= $(exec_prefix)/lib
46MANDIR= $(prefix)/man
47INCLUDEDIR= $(prefix)/include
48SCRIPTDIR= $(prefix)/lib
49
50# Detailed destination directories
51BINLIBDEST= $(LIBDIR)/python$(VERSION)
52LIBDEST= $(SCRIPTDIR)/python$(VERSION)
53INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
54LIBP= $(LIBDIR)/python$(VERSION)
55
Guido van Rossum7cc5abd1994-09-12 10:42:20 +000056# Symbols used for using shared libraries
57SO= @SO@
58LDSHARED= @LDSHARED@
59CCSHARED= @CCSHARED@
60LINKFORSHARED= @LINKFORSHARED@
Guido van Rossum704fef21996-07-30 16:53:14 +000061DESTSHARED= $(BINLIBDEST)/sharedmodules
Guido van Rossum7cc5abd1994-09-12 10:42:20 +000062
Guido van Rossumddcb36b1996-05-24 21:14:44 +000063# Portable install script (configure doesn't always guess right)
64INSTALL= @srcdir@/../install-sh -c
Guido van Rossum704fef21996-07-30 16:53:14 +000065INSTALL_PROGRAM=${INSTALL} -m 755
Guido van Rossumddcb36b1996-05-24 21:14:44 +000066INSTALL_DATA= ${INSTALL} -m 644
Guido van Rossumcde317a1996-08-20 19:46:35 +000067# 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 Rossum6fe01d41996-09-11 23:13:07 +000069# Also, making them read-only seems to be a good idea...
70INSTALL_SHARED= ${INSTALL} -m 555
Guido van Rossumddcb36b1996-05-24 21:14:44 +000071
Guido van Rossum275fbe21995-09-30 17:01:49 +000072# === Variables that are customizable by hand or by inclusion in Setup ===
Guido van Rossumfba715a1994-01-02 00:26:09 +000073
Guido van Rossumf4449de1995-04-10 11:37:18 +000074LINKCC= $(CC)
Guido van Rossumb6775db1994-08-01 11:34:53 +000075INCLDIR= $(srcdir)/../Include
Guido van Rossum450b9b31996-07-21 02:35:58 +000076CONFIGINCLDIR= ..
77CFLAGS= $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS)
Guido van Rossumfba715a1994-01-02 00:26:09 +000078
Guido van Rossumfba715a1994-01-02 00:26:09 +000079MKDEP= mkdep
80SHELL= /bin/sh
81
Guido van Rossumb6775db1994-08-01 11:34:53 +000082MAKESETUP= $(srcdir)/makesetup
Guido van Rossumfba715a1994-01-02 00:26:09 +000083
Guido van Rossum275fbe21995-09-30 17:01:49 +000084# (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 Rossumfba715a1994-01-02 00:26:09 +000092# === Fixed definitions ===
93
94OBJS= $(MODOBJS)
95
Guido van Rossum37ba0bc1995-08-04 04:20:45 +000096ADDOBJS= main.o config.o getpath.o
97
Guido van Rossumfba715a1994-01-02 00:26:09 +000098LIB= libModules.a
99
100MYLIBS= $(LIB) \
101 ../Python/libPython.a \
102 ../Objects/libObjects.a \
103 ../Parser/libParser.a
104
Guido van Rossumb6775db1994-08-01 11:34:53 +0000105SYSLIBS= $(LIBM) $(LIBC)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000106
107
108# === Rules ===
109
Guido van Rossum2ce15a51994-10-20 21:59:38 +0000110all: $(LIB) ../python sharedmods
Guido van Rossumfba715a1994-01-02 00:26:09 +0000111
Guido van Rossum450b9b31996-07-21 02:35:58 +0000112asharedmodule: $(ASHAREDMODULE)$(SO)
113
114$(ASHAREDMODULE)$(SO): $(ASHAREDMODULESOBS)
Guido van Rossum07b983d1996-08-19 21:59:32 +0000115 $(LDSHARED) $(LDFLAGS) -o $(ASHAREDMODULE)$(SO) $(ASHAREDMODULESOBS) \
Guido van Rossum450b9b31996-07-21 02:35:58 +0000116 $(ASHAREDMODULESEXTRA)
117
Guido van Rossum087579e1995-01-17 16:11:29 +0000118$(LIB): $& $(OBJS) Makefile
Guido van Rossum794b93e1994-08-23 13:51:25 +0000119 -rm -f $(LIB)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000120 $(AR) cr $(LIB) $(OBJS)
121 $(RANLIB) $(LIB)
122
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000123../python: $(MYLIBS) $(ADDOBJS) Makefile
Guido van Rossum07b983d1996-08-19 21:59:32 +0000124 $(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
Guido van Rossum72824ba1994-08-19 12:03:04 +0000125 $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python
Guido van Rossumb6775db1994-08-01 11:34:53 +0000126 mv python ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +0000127
Guido van Rossumfba715a1994-01-02 00:26:09 +0000128clean:
129 -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej
130
131clobber: clean
Guido van Rossumb6775db1994-08-01 11:34:53 +0000132 -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
Guido van Rossum65544191996-08-08 19:07:46 +0000133 -rm -f *.so *.sl so_locations
Guido van Rossumfba715a1994-01-02 00:26:09 +0000134
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000135getpath.o: getpath.c Makefile
136 $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
Guido van Rossumc34c9a51996-06-12 04:20:27 +0000137 -DPREFIX='"$(prefix)"' \
138 -DEXEC_PREFIX='"$(exec_prefix)"' \
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000139 $(srcdir)/getpath.c
140
Guido van Rossum6fe01d41996-09-11 23:13:07 +0000141config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup Setup.local
142 $(SHELL) $(MAKESETUP) Setup Setup.local
Guido van Rossumfba715a1994-01-02 00:26:09 +0000143
Guido van Rossumb6775db1994-08-01 11:34:53 +0000144Setup:
145 cp $(srcdir)/Setup.in Setup
146
Guido van Rossum6fe01d41996-09-11 23:13:07 +0000147Setup.local:
148 echo "# Edit this file for local setup changes" >Setup.local
149
Guido van Rossumb6775db1994-08-01 11:34:53 +0000150Makefile.pre: Makefile.pre.in ../config.status
151 (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \
152 $(SHELL) config.status)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000153
154depend:
Guido van Rossumb6775db1994-08-01 11:34:53 +0000155 $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
156 sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
Guido van Rossumfba715a1994-01-02 00:26:09 +0000157
Guido van Rossumb6775db1994-08-01 11:34:53 +0000158.PRECIOUS: ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +0000159
Guido van Rossumb6775db1994-08-01 11:34:53 +0000160glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs
161 python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c
Guido van Rossumfba715a1994-01-02 00:26:09 +0000162
Guido van Rossumb6775db1994-08-01 11:34:53 +0000163almodule.o: almodule.c
164arraymodule.o: arraymodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000165audioop.o: audioop.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000166cdmodule.o: cdmodule.c
167clmodule.o: clmodule.c
168dbmmodule.o: dbmmodule.c
Guido van Rossum02530b01996-07-31 22:43:38 +0000169errnomodule.o: errnomodule.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000170fcntlmodule.o: fcntlmodule.c
171flmodule.o: flmodule.c
172fmmodule.o: fmmodule.c
173glmodule.o: glmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000174imageop.o: imageop.c
175imgfile.o: imgfile.c
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000176main.o: main.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000177mathmodule.o: mathmodule.c
178md5c.o: md5c.c
179md5module.o: md5module.c
180mpzmodule.o: mpzmodule.c
181nismodule.o: nismodule.c
Guido van Rossum02530b01996-07-31 22:43:38 +0000182operator.o: operator.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000183parsermodule.o: parsermodule.c
184posixmodule.o: posixmodule.c
185pwdmodule.o: pwdmodule.c
186regexmodule.o: regexmodule.c
187regexpr.o: regexpr.c
Guido van Rossum2e631391996-12-18 18:37:27 +0000188resource.o: resource.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000189rgbimgmodule.o: rgbimgmodule.c
190rotormodule.o: rotormodule.c
191selectmodule.o: selectmodule.c
192sgimodule.o: sgimodule.c
193socketmodule.o: socketmodule.c
194stdwinmodule.o: stdwinmodule.c
195stropmodule.o: stropmodule.c
196structmodule.o: structmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000197sunaudiodev.o: sunaudiodev.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000198svmodule.o: svmodule.c
199threadmodule.o: threadmodule.c
200timemodule.o: timemodule.c
201timingmodule.o: timingmodule.c
202xxmodule.o: xxmodule.c
203yuvconvert.o: yuvconvert.c
204
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000205# Rules to build and install all shared modules
206sharedmods: $(SHAREDMODS)
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000207sharedinstall: $(DESTSHARED) $(SHAREDMODS)
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000208 -for i in X $(SHAREDMODS); do \
209 if test $$i != X; \
Guido van Rossumcde317a1996-08-20 19:46:35 +0000210 then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000211 fi; \
212 done
Guido van Rossumfba715a1994-01-02 00:26:09 +0000213
Guido van Rossum450b9b31996-07-21 02:35:58 +0000214# Install a shared module from outside of setup
215asharedinstall: $(DESTSHARED) $(ASHAREDMODULE)$(SO)
216 -for i in dummy $(ASHAREDMODULE)$(SO); do \
217 if test -f $$i; then mv $$i $(DESTSHARED)/$$i; fi; done
218
219# This is handy when modules need to know where the destination directory is:
220echodestshared: $(DESTSHARED)
221 echo $(DESTSHARED)
222
Guido van Rossum704fef21996-07-30 16:53:14 +0000223DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
Guido van Rossum2bd37e61996-06-17 17:33:11 +0000224
Guido van Rossum4daf6ad1996-07-24 02:33:33 +0000225$(DESTSHARED):
226 @for i in $(DESTDIRS); \
227 do \
228 if test ! -d $$i; then \
229 echo "Creating directory $$i"; \
230 mkdir $$i; \
231 chmod 755 $$i; \
232 else true; \
233 fi; \
234 done
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000235
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000236# Stuff is appended here by makesetup and make depend