blob: 099fbeb662c90366c9062b9dff99bcbfb1d4d9fd [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 Rossum275fbe21995-09-30 17:01:49 +000046# === Variables that are customizable by hand or by inclusion in Setup ===
Guido van Rossumfba715a1994-01-02 00:26:09 +000047
Guido van Rossumf4449de1995-04-10 11:37:18 +000048LINKCC= $(CC)
Guido van Rossumb6775db1994-08-01 11:34:53 +000049INCLDIR= $(srcdir)/../Include
Guido van Rossumb6775db1994-08-01 11:34:53 +000050CFLAGS= $(OPT) -I$(INCLDIR) -I.. $(DEFS)
Guido van Rossumfba715a1994-01-02 00:26:09 +000051
Guido van Rossumfba715a1994-01-02 00:26:09 +000052MKDEP= mkdep
53SHELL= /bin/sh
54
Guido van Rossumb6775db1994-08-01 11:34:53 +000055MAKESETUP= $(srcdir)/makesetup
Guido van Rossumfba715a1994-01-02 00:26:09 +000056
Guido van Rossum275fbe21995-09-30 17:01:49 +000057# (The makesetup script inserts all variable definitions found
58# found in the Setup file just below the following line.
59# This means that the Setup file can override any of the definitions
60# given before this point, but not any given below.
61# The script insert the definitions in reverse order,
62# for the benefits of independent extensions.)
63# === Definitions added by makesetup ===
64
Guido van Rossumfba715a1994-01-02 00:26:09 +000065# === Fixed definitions ===
66
67OBJS= $(MODOBJS)
68
Guido van Rossum37ba0bc1995-08-04 04:20:45 +000069ADDOBJS= main.o config.o getpath.o
70
Guido van Rossumfba715a1994-01-02 00:26:09 +000071LIB= libModules.a
72
73MYLIBS= $(LIB) \
74 ../Python/libPython.a \
75 ../Objects/libObjects.a \
76 ../Parser/libParser.a
77
Guido van Rossumb6775db1994-08-01 11:34:53 +000078SYSLIBS= $(LIBM) $(LIBC)
Guido van Rossumfba715a1994-01-02 00:26:09 +000079
80
81# === Rules ===
82
Guido van Rossum2ce15a51994-10-20 21:59:38 +000083all: $(LIB) ../python sharedmods
Guido van Rossumfba715a1994-01-02 00:26:09 +000084
Guido van Rossum087579e1995-01-17 16:11:29 +000085$(LIB): $& $(OBJS) Makefile
Guido van Rossum794b93e1994-08-23 13:51:25 +000086 -rm -f $(LIB)
Guido van Rossumfba715a1994-01-02 00:26:09 +000087 $(AR) cr $(LIB) $(OBJS)
88 $(RANLIB) $(LIB)
89
Guido van Rossum37ba0bc1995-08-04 04:20:45 +000090../python: $(MYLIBS) $(ADDOBJS) Makefile
91 $(LINKCC) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
Guido van Rossum72824ba1994-08-19 12:03:04 +000092 $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python
Guido van Rossumb6775db1994-08-01 11:34:53 +000093 mv python ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +000094
Guido van Rossumfba715a1994-01-02 00:26:09 +000095clean:
96 -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej
97
98clobber: clean
Guido van Rossumb6775db1994-08-01 11:34:53 +000099 -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
Guido van Rossumf5e0ea81994-09-12 15:35:36 +0000100 -rm -f *.so so_locations
Guido van Rossumfba715a1994-01-02 00:26:09 +0000101
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000102getpath.o: getpath.c Makefile
103 $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
104 $(srcdir)/getpath.c
105
Guido van Rossumb6775db1994-08-01 11:34:53 +0000106config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup
107 $(SHELL) $(MAKESETUP) Setup
Guido van Rossumfba715a1994-01-02 00:26:09 +0000108
Guido van Rossumb6775db1994-08-01 11:34:53 +0000109Setup:
110 cp $(srcdir)/Setup.in Setup
111
112Makefile.pre: Makefile.pre.in ../config.status
113 (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \
114 $(SHELL) config.status)
Guido van Rossumfba715a1994-01-02 00:26:09 +0000115
116depend:
Guido van Rossumb6775db1994-08-01 11:34:53 +0000117 $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
118 sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
Guido van Rossumfba715a1994-01-02 00:26:09 +0000119
Guido van Rossumb6775db1994-08-01 11:34:53 +0000120.PRECIOUS: ../python
Guido van Rossumfba715a1994-01-02 00:26:09 +0000121
Guido van Rossumb6775db1994-08-01 11:34:53 +0000122glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs
123 python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c
Guido van Rossumfba715a1994-01-02 00:26:09 +0000124
Guido van Rossumb6775db1994-08-01 11:34:53 +0000125almodule.o: almodule.c
126arraymodule.o: arraymodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000127audioop.o: audioop.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000128cdmodule.o: cdmodule.c
129clmodule.o: clmodule.c
130dbmmodule.o: dbmmodule.c
131fcntlmodule.o: fcntlmodule.c
132flmodule.o: flmodule.c
133fmmodule.o: fmmodule.c
134glmodule.o: glmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000135imageop.o: imageop.c
136imgfile.o: imgfile.c
Guido van Rossum37ba0bc1995-08-04 04:20:45 +0000137main.o: main.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000138mathmodule.o: mathmodule.c
139md5c.o: md5c.c
140md5module.o: md5module.c
141mpzmodule.o: mpzmodule.c
142nismodule.o: nismodule.c
143parsermodule.o: parsermodule.c
144posixmodule.o: posixmodule.c
145pwdmodule.o: pwdmodule.c
146regexmodule.o: regexmodule.c
147regexpr.o: regexpr.c
148rgbimgmodule.o: rgbimgmodule.c
149rotormodule.o: rotormodule.c
150selectmodule.o: selectmodule.c
151sgimodule.o: sgimodule.c
152socketmodule.o: socketmodule.c
153stdwinmodule.o: stdwinmodule.c
154stropmodule.o: stropmodule.c
155structmodule.o: structmodule.c
Guido van Rossumc65a5251994-08-05 13:44:50 +0000156sunaudiodev.o: sunaudiodev.c
Guido van Rossumb6775db1994-08-01 11:34:53 +0000157svmodule.o: svmodule.c
158threadmodule.o: threadmodule.c
159timemodule.o: timemodule.c
160timingmodule.o: timingmodule.c
161xxmodule.o: xxmodule.c
162yuvconvert.o: yuvconvert.c
163
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000164# Rules to build and install all shared modules
165sharedmods: $(SHAREDMODS)
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000166sharedinstall: $(DESTSHARED) $(SHAREDMODS)
Guido van Rossum6b13ba21995-02-17 15:12:13 +0000167 -for i in dummy $(SHAREDMODS); do \
Guido van Rossum3bbc62e1995-01-02 19:30:30 +0000168 if test -f $$i; then mv $$i $(DESTSHARED)/$$i; fi; done
Guido van Rossumfba715a1994-01-02 00:26:09 +0000169
Guido van Rossum811fbbc1995-01-22 00:47:59 +0000170$(DESTSHARED):
171 mkdir $(DESTSHARED)
172
Guido van Rossum7cc5abd1994-09-12 10:42:20 +0000173# Stuff is appended here by makesetup and make depend