blob: 393e076a94c311e5a9da764cdde738c0e203ce5f [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.
69INSTALL_SHARED= ${INSTALL} -m 755
Guido van Rossumddcb36b1996-05-24 21:14:44 +000070
Guido van Rossum275fbe21995-09-30 17:01:49 +000071# === Variables that are customizable by hand or by inclusion in Setup ===
Guido van Rossumfba715a1994-01-02 00:26:09 +000072
Guido van Rossumf4449de1995-04-10 11:37:18 +000073LINKCC= $(CC)
Guido van Rossumb6775db1994-08-01 11:34:53 +000074INCLDIR= $(srcdir)/../Include
Guido van Rossum450b9b31996-07-21 02:35:58 +000075CONFIGINCLDIR= ..
76CFLAGS= $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS)
Guido van Rossumfba715a1994-01-02 00:26:09 +000077
Guido van Rossumfba715a1994-01-02 00:26:09 +000078MKDEP= mkdep
79SHELL= /bin/sh
80
Guido van Rossumb6775db1994-08-01 11:34:53 +000081MAKESETUP= $(srcdir)/makesetup
Guido van Rossumfba715a1994-01-02 00:26:09 +000082
Guido van Rossum275fbe21995-09-30 17:01:49 +000083# (The makesetup script inserts all variable definitions found
84# found in the Setup file just below the following line.
85# This means that the Setup file can override any of the definitions
86# given before this point, but not any given below.
87# The script insert the definitions in reverse order,
88# for the benefits of independent extensions.)
89# === Definitions added by makesetup ===
90
Guido van Rossumfba715a1994-01-02 00:26:09 +000091# === Fixed definitions ===
92
93OBJS= $(MODOBJS)
94
Guido van Rossum37ba0bc1995-08-04 04:20:45 +000095ADDOBJS= main.o config.o getpath.o
96
Guido van Rossumfba715a1994-01-02 00:26:09 +000097LIB= libModules.a
98
99MYLIBS= $(LIB) \
100 ../Python/libPython.a \
101 ../Objects/libObjects.a \
102 ../Parser/libParser.a
103
Guido van Rossumb6775db1994-08-01 11:34:53 +0000104SYSLIBS= $(LIBM) $(LIBC)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000105
106
107# === Rules ===
108
Guido van Rossum2ce15a51994-10-20 21:59:38 +0000109all: $(LIB) ../python sharedmods
Guido van Rossumfba715a1994-01-02 00:26:09 +0000110
Guido van Rossum450b9b31996-07-21 02:35:58 +0000111asharedmodule: $(ASHAREDMODULE)$(SO)
112
113$(ASHAREDMODULE)$(SO): $(ASHAREDMODULESOBS)
Guido van Rossum07b983d1996-08-19 21:59:32 +0000114 $(LDSHARED) $(LDFLAGS) -o $(ASHAREDMODULE)$(SO) $(ASHAREDMODULESOBS) \
Guido van Rossum450b9b31996-07-21 02:35:58 +0000115 $(ASHAREDMODULESEXTRA)
116
Guido van Rossum087579e1995-01-17 16:11:29 +0000117$(LIB): $& $(OBJS) Makefile
Guido van Rossum794b93e1994-08-23 13:51:25 +0000118 -rm -f $(LIB)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000119 $(AR) cr $(LIB) $(OBJS)
120 $(RANLIB) $(LIB)
121
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000122../python: $(MYLIBS) $(ADDOBJS) Makefile
Guido van Rossum07b983d1996-08-19 21:59:32 +0000123 $(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
Guido van Rossum72824ba1994-08-19 12:03:04 +0000124 $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python
Guido van Rossumb6775db1994-08-01 11:34:53 +0000125 mv python ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +0000126
Guido van Rossumfba715a1994-01-02 00:26:09 +0000127clean:
128 -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej
129
130clobber: clean
Guido van Rossumb6775db1994-08-01 11:34:53 +0000131 -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
Guido van Rossum65544191996-08-08 19:07:46 +0000132 -rm -f *.so *.sl so_locations
Guido van Rossumfba715a1994-01-02 00:26:09 +0000133
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000134getpath.o: getpath.c Makefile
135 $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
Guido van Rossumc34c9a51996-06-12 04:20:27 +0000136 -DPREFIX='"$(prefix)"' \
137 -DEXEC_PREFIX='"$(exec_prefix)"' \
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000138 $(srcdir)/getpath.c
139
Guido van Rossumb6775db1994-08-01 11:34:53 +0000140config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup
141 $(SHELL) $(MAKESETUP) Setup
Guido van Rossumfba715a1994-01-02 00:26:09 +0000142
Guido van Rossumb6775db1994-08-01 11:34:53 +0000143Setup:
144 cp $(srcdir)/Setup.in Setup
145
146Makefile.pre: Makefile.pre.in ../config.status
147 (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \
148 $(SHELL) config.status)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000149
150depend:
Guido van Rossumb6775db1994-08-01 11:34:53 +0000151 $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
152 sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
Guido van Rossumfba715a1994-01-02 00:26:09 +0000153
Guido van Rossumb6775db1994-08-01 11:34:53 +0000154.PRECIOUS: ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +0000155
Guido van Rossumb6775db1994-08-01 11:34:53 +0000156glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs
157 python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c
Guido van Rossumfba715a1994-01-02 00:26:09 +0000158
Guido van Rossumb6775db1994-08-01 11:34:53 +0000159almodule.o: almodule.c
160arraymodule.o: arraymodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000161audioop.o: audioop.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000162cdmodule.o: cdmodule.c
163clmodule.o: clmodule.c
164dbmmodule.o: dbmmodule.c
Guido van Rossum02530b01996-07-31 22:43:38 +0000165errnomodule.o: errnomodule.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000166fcntlmodule.o: fcntlmodule.c
167flmodule.o: flmodule.c
168fmmodule.o: fmmodule.c
169glmodule.o: glmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000170imageop.o: imageop.c
171imgfile.o: imgfile.c
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000172main.o: main.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000173mathmodule.o: mathmodule.c
174md5c.o: md5c.c
175md5module.o: md5module.c
176mpzmodule.o: mpzmodule.c
177nismodule.o: nismodule.c
Guido van Rossum02530b01996-07-31 22:43:38 +0000178operator.o: operator.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000179parsermodule.o: parsermodule.c
180posixmodule.o: posixmodule.c
181pwdmodule.o: pwdmodule.c
182regexmodule.o: regexmodule.c
183regexpr.o: regexpr.c
184rgbimgmodule.o: rgbimgmodule.c
185rotormodule.o: rotormodule.c
186selectmodule.o: selectmodule.c
187sgimodule.o: sgimodule.c
188socketmodule.o: socketmodule.c
189stdwinmodule.o: stdwinmodule.c
190stropmodule.o: stropmodule.c
191structmodule.o: structmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000192sunaudiodev.o: sunaudiodev.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000193svmodule.o: svmodule.c
194threadmodule.o: threadmodule.c
195timemodule.o: timemodule.c
196timingmodule.o: timingmodule.c
197xxmodule.o: xxmodule.c
198yuvconvert.o: yuvconvert.c
199
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000200# Rules to build and install all shared modules
201sharedmods: $(SHAREDMODS)
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000202sharedinstall: $(DESTSHARED) $(SHAREDMODS)
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000203 -for i in X $(SHAREDMODS); do \
204 if test $$i != X; \
Guido van Rossumcde317a1996-08-20 19:46:35 +0000205 then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000206 fi; \
207 done
Guido van Rossumfba715a1994-01-02 00:26:09 +0000208
Guido van Rossum450b9b31996-07-21 02:35:58 +0000209# Install a shared module from outside of setup
210asharedinstall: $(DESTSHARED) $(ASHAREDMODULE)$(SO)
211 -for i in dummy $(ASHAREDMODULE)$(SO); do \
212 if test -f $$i; then mv $$i $(DESTSHARED)/$$i; fi; done
213
214# This is handy when modules need to know where the destination directory is:
215echodestshared: $(DESTSHARED)
216 echo $(DESTSHARED)
217
Guido van Rossum704fef21996-07-30 16:53:14 +0000218DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
Guido van Rossum2bd37e61996-06-17 17:33:11 +0000219
Guido van Rossum4daf6ad1996-07-24 02:33:33 +0000220$(DESTSHARED):
221 @for i in $(DESTDIRS); \
222 do \
223 if test ! -d $$i; then \
224 echo "Creating directory $$i"; \
225 mkdir $$i; \
226 chmod 755 $$i; \
227 else true; \
228 fi; \
229 done
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000230
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000231# Stuff is appended here by makesetup and make depend