blob: 69eb540f8ec97f7e660c1ce2e6cc31329ab17109 [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
16srcdir= @srcdir@
17VPATH= @srcdir@
18
19CC= @CC@
20RANLIB= @RANLIB@
Guido van Rossumb6775db1994-08-01 11:34:53 +000021AR= @AR@
22
Guido van Rossumf4449de1995-04-10 11:37:18 +000023OPT= @OPT@
24
Guido van Rossumfba715a1994-01-02 00:26:09 +000025DEFS= @DEFS@
26LIBS= @LIBS@
Guido van Rossumb6775db1994-08-01 11:34:53 +000027LIBM= @LIBM@
28LIBC= @LIBC@
29
Guido van Rossum45a91041995-08-08 14:18:12 +000030# Machine-dependent subdirectories
31MACHDEP= @MACHDEP@
32
Guido van Rossum3bbc62e1995-01-02 19:30:30 +000033# Install prefix for architecture-independent files
34prefix= @prefix@
35
36# Install prefix for architecture-dependent files
37exec_prefix= @exec_prefix@
Guido van Rossumfba715a1994-01-02 00:26:09 +000038
Guido van Rossum7cc5abd1994-09-12 10:42:20 +000039# Symbols used for using shared libraries
40SO= @SO@
41LDSHARED= @LDSHARED@
42CCSHARED= @CCSHARED@
43LINKFORSHARED= @LINKFORSHARED@
Guido van Rossum3bbc62e1995-01-02 19:30:30 +000044DESTSHARED= $(exec_prefix)/lib/python/$(MACHDEP)
Guido van Rossum7cc5abd1994-09-12 10:42:20 +000045
Guido van Rossumddcb36b1996-05-24 21:14:44 +000046# Portable install script (configure doesn't always guess right)
47INSTALL= @srcdir@/../install-sh -c
48INSTALL_PROGRAM=${INSTALL}
49INSTALL_DATA= ${INSTALL} -m 644
50
Guido van Rossum275fbe21995-09-30 17:01:49 +000051# === Variables that are customizable by hand or by inclusion in Setup ===
Guido van Rossumfba715a1994-01-02 00:26:09 +000052
Guido van Rossumf4449de1995-04-10 11:37:18 +000053LINKCC= $(CC)
Guido van Rossumb6775db1994-08-01 11:34:53 +000054INCLDIR= $(srcdir)/../Include
Guido van Rossumb6775db1994-08-01 11:34:53 +000055CFLAGS= $(OPT) -I$(INCLDIR) -I.. $(DEFS)
Guido van Rossumfba715a1994-01-02 00:26:09 +000056
Guido van Rossumfba715a1994-01-02 00:26:09 +000057MKDEP= mkdep
58SHELL= /bin/sh
59
Guido van Rossumb6775db1994-08-01 11:34:53 +000060MAKESETUP= $(srcdir)/makesetup
Guido van Rossumfba715a1994-01-02 00:26:09 +000061
Guido van Rossum275fbe21995-09-30 17:01:49 +000062# (The makesetup script inserts all variable definitions found
63# found in the Setup file just below the following line.
64# This means that the Setup file can override any of the definitions
65# given before this point, but not any given below.
66# The script insert the definitions in reverse order,
67# for the benefits of independent extensions.)
68# === Definitions added by makesetup ===
69
Guido van Rossumfba715a1994-01-02 00:26:09 +000070# === Fixed definitions ===
71
72OBJS= $(MODOBJS)
73
Guido van Rossum37ba0bc1995-08-04 04:20:45 +000074ADDOBJS= main.o config.o getpath.o
75
Guido van Rossumfba715a1994-01-02 00:26:09 +000076LIB= libModules.a
77
78MYLIBS= $(LIB) \
79 ../Python/libPython.a \
80 ../Objects/libObjects.a \
81 ../Parser/libParser.a
82
Guido van Rossumb6775db1994-08-01 11:34:53 +000083SYSLIBS= $(LIBM) $(LIBC)
Guido van Rossumfba715a1994-01-02 00:26:09 +000084
85
86# === Rules ===
87
Guido van Rossum2ce15a51994-10-20 21:59:38 +000088all: $(LIB) ../python sharedmods
Guido van Rossumfba715a1994-01-02 00:26:09 +000089
Guido van Rossum087579e1995-01-17 16:11:29 +000090$(LIB): $& $(OBJS) Makefile
Guido van Rossum794b93e1994-08-23 13:51:25 +000091 -rm -f $(LIB)
Guido van Rossumfba715a1994-01-02 00:26:09 +000092 $(AR) cr $(LIB) $(OBJS)
93 $(RANLIB) $(LIB)
94
Guido van Rossum37ba0bc1995-08-04 04:20:45 +000095../python: $(MYLIBS) $(ADDOBJS) Makefile
96 $(LINKCC) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
Guido van Rossum72824ba1994-08-19 12:03:04 +000097 $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python
Guido van Rossumb6775db1994-08-01 11:34:53 +000098 mv python ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +000099
Guido van Rossumfba715a1994-01-02 00:26:09 +0000100clean:
101 -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej
102
103clobber: clean
Guido van Rossumb6775db1994-08-01 11:34:53 +0000104 -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
Guido van Rossumf5e0ea81994-09-12 15:35:36 +0000105 -rm -f *.so so_locations
Guido van Rossumfba715a1994-01-02 00:26:09 +0000106
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000107getpath.o: getpath.c Makefile
108 $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
109 $(srcdir)/getpath.c
110
Guido van Rossumb6775db1994-08-01 11:34:53 +0000111config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup
112 $(SHELL) $(MAKESETUP) Setup
Guido van Rossumfba715a1994-01-02 00:26:09 +0000113
Guido van Rossumb6775db1994-08-01 11:34:53 +0000114Setup:
115 cp $(srcdir)/Setup.in Setup
116
117Makefile.pre: Makefile.pre.in ../config.status
118 (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \
119 $(SHELL) config.status)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000120
121depend:
Guido van Rossumb6775db1994-08-01 11:34:53 +0000122 $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
123 sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
Guido van Rossumfba715a1994-01-02 00:26:09 +0000124
Guido van Rossumb6775db1994-08-01 11:34:53 +0000125.PRECIOUS: ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +0000126
Guido van Rossumb6775db1994-08-01 11:34:53 +0000127glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs
128 python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c
Guido van Rossumfba715a1994-01-02 00:26:09 +0000129
Guido van Rossumb6775db1994-08-01 11:34:53 +0000130almodule.o: almodule.c
131arraymodule.o: arraymodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000132audioop.o: audioop.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000133cdmodule.o: cdmodule.c
134clmodule.o: clmodule.c
135dbmmodule.o: dbmmodule.c
136fcntlmodule.o: fcntlmodule.c
137flmodule.o: flmodule.c
138fmmodule.o: fmmodule.c
139glmodule.o: glmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000140imageop.o: imageop.c
141imgfile.o: imgfile.c
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000142main.o: main.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000143mathmodule.o: mathmodule.c
144md5c.o: md5c.c
145md5module.o: md5module.c
146mpzmodule.o: mpzmodule.c
147nismodule.o: nismodule.c
148parsermodule.o: parsermodule.c
149posixmodule.o: posixmodule.c
150pwdmodule.o: pwdmodule.c
151regexmodule.o: regexmodule.c
152regexpr.o: regexpr.c
153rgbimgmodule.o: rgbimgmodule.c
154rotormodule.o: rotormodule.c
155selectmodule.o: selectmodule.c
156sgimodule.o: sgimodule.c
157socketmodule.o: socketmodule.c
158stdwinmodule.o: stdwinmodule.c
159stropmodule.o: stropmodule.c
160structmodule.o: structmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000161sunaudiodev.o: sunaudiodev.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000162svmodule.o: svmodule.c
163threadmodule.o: threadmodule.c
164timemodule.o: timemodule.c
165timingmodule.o: timingmodule.c
166xxmodule.o: xxmodule.c
167yuvconvert.o: yuvconvert.c
168
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000169# Rules to build and install all shared modules
170sharedmods: $(SHAREDMODS)
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000171sharedinstall: $(DESTSHARED) $(SHAREDMODS)
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000172 -for i in X $(SHAREDMODS); do \
173 if test $$i != X; \
174 then $(INSTALL_DATA) $$i $(DESTSHARED)/$$i; \
175 fi; \
176 done
Guido van Rossumfba715a1994-01-02 00:26:09 +0000177
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000178$(DESTSHARED):
Guido van Rossumddcb36b1996-05-24 21:14:44 +0000179 mkdir $(DESTSHARED); chmod 755 $(DESTSHARED)
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000180
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000181# Stuff is appended here by makesetup and make depend