blob: 2d81409dda23968453489a6b1df382ba0c79bf47 [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
Guido van Rossumf631d131997-01-22 03:45:38 +000010VERSION= 1.5
Guido van Rossum4daf6ad1996-07-24 02:33:33 +000011
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 Rossum2fff2e61997-01-20 18:34:26 +000096ADDOBJS= main.o config.o getpath.o getbuildinfo.o
Guido van Rossum37ba0bc1995-08-04 04:20:45 +000097
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 Rossum2fff2e61997-01-20 18:34:26 +0000123../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 Rossum07b983d1996-08-19 21:59:32 +0000128 $(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
Guido van Rossum72824ba1994-08-19 12:03:04 +0000129 $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python
Guido van Rossumb6775db1994-08-01 11:34:53 +0000130 mv python ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +0000131
Guido van Rossum2fff2e61997-01-20 18:34:26 +0000132buildno:
133 echo 0 >buildno
134
Guido van Rossumfba715a1994-01-02 00:26:09 +0000135clean:
136 -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej
137
138clobber: clean
Guido van Rossumb6775db1994-08-01 11:34:53 +0000139 -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
Guido van Rossum65544191996-08-08 19:07:46 +0000140 -rm -f *.so *.sl so_locations
Guido van Rossumfba715a1994-01-02 00:26:09 +0000141
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000142getpath.o: getpath.c Makefile
143 $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
Guido van Rossumc34c9a51996-06-12 04:20:27 +0000144 -DPREFIX='"$(prefix)"' \
145 -DEXEC_PREFIX='"$(exec_prefix)"' \
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000146 $(srcdir)/getpath.c
147
Guido van Rossum6fe01d41996-09-11 23:13:07 +0000148config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup Setup.local
149 $(SHELL) $(MAKESETUP) Setup Setup.local
Guido van Rossumfba715a1994-01-02 00:26:09 +0000150
Guido van Rossumb6775db1994-08-01 11:34:53 +0000151Setup:
152 cp $(srcdir)/Setup.in Setup
153
Guido van Rossum6fe01d41996-09-11 23:13:07 +0000154Setup.local:
155 echo "# Edit this file for local setup changes" >Setup.local
156
Guido van Rossumb6775db1994-08-01 11:34:53 +0000157Makefile.pre: Makefile.pre.in ../config.status
158 (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \
159 $(SHELL) config.status)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000160
161depend:
Guido van Rossumb6775db1994-08-01 11:34:53 +0000162 $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
163 sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
Guido van Rossumfba715a1994-01-02 00:26:09 +0000164
Guido van Rossumb6775db1994-08-01 11:34:53 +0000165.PRECIOUS: ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +0000166
Guido van Rossumb6775db1994-08-01 11:34:53 +0000167glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs
168 python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c
Guido van Rossumfba715a1994-01-02 00:26:09 +0000169
Guido van Rossumb6775db1994-08-01 11:34:53 +0000170almodule.o: almodule.c
171arraymodule.o: arraymodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000172audioop.o: audioop.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000173cdmodule.o: cdmodule.c
174clmodule.o: clmodule.c
175dbmmodule.o: dbmmodule.c
Guido van Rossum02530b01996-07-31 22:43:38 +0000176errnomodule.o: errnomodule.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000177fcntlmodule.o: fcntlmodule.c
178flmodule.o: flmodule.c
179fmmodule.o: fmmodule.c
180glmodule.o: glmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000181imageop.o: imageop.c
182imgfile.o: imgfile.c
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000183main.o: main.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000184mathmodule.o: mathmodule.c
185md5c.o: md5c.c
186md5module.o: md5module.c
187mpzmodule.o: mpzmodule.c
188nismodule.o: nismodule.c
Guido van Rossum02530b01996-07-31 22:43:38 +0000189operator.o: operator.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000190parsermodule.o: parsermodule.c
191posixmodule.o: posixmodule.c
192pwdmodule.o: pwdmodule.c
193regexmodule.o: regexmodule.c
194regexpr.o: regexpr.c
Guido van Rossum2e631391996-12-18 18:37:27 +0000195resource.o: resource.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000196rgbimgmodule.o: rgbimgmodule.c
197rotormodule.o: rotormodule.c
198selectmodule.o: selectmodule.c
199sgimodule.o: sgimodule.c
200socketmodule.o: socketmodule.c
201stdwinmodule.o: stdwinmodule.c
202stropmodule.o: stropmodule.c
203structmodule.o: structmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000204sunaudiodev.o: sunaudiodev.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000205svmodule.o: svmodule.c
206threadmodule.o: threadmodule.c
207timemodule.o: timemodule.c
208timingmodule.o: timingmodule.c
209xxmodule.o: xxmodule.c
210yuvconvert.o: yuvconvert.c
211
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000212# Rules to build and install all shared modules
213sharedmods: $(SHAREDMODS)
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000214sharedinstall: $(DESTSHARED) $(SHAREDMODS)
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000215 -for i in X $(SHAREDMODS); do \
216 if test $$i != X; \
Guido van Rossumcde317a1996-08-20 19:46:35 +0000217 then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000218 fi; \
219 done
Guido van Rossumfba715a1994-01-02 00:26:09 +0000220
Guido van Rossum450b9b31996-07-21 02:35:58 +0000221# Install a shared module from outside of setup
222asharedinstall: $(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:
227echodestshared: $(DESTSHARED)
228 echo $(DESTSHARED)
229
Guido van Rossum704fef21996-07-30 16:53:14 +0000230DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
Guido van Rossum2bd37e61996-06-17 17:33:11 +0000231
Guido van Rossum4daf6ad1996-07-24 02:33:33 +0000232$(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 Rossum811fbbc1995-01-22 00:47:59 +0000242
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000243# Stuff is appended here by makesetup and make depend