1 # 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.)
9 # === Variables set by makesetup ===
14 # === Variables set by configure ===
35 # Machine-dependent subdirectories
38 # Install prefix for architecture-independent files
41 # Install prefix for architecture-dependent files
42 exec_prefix= @exec_prefix@
44 # Expanded directories
45 BINDIR= $(exec_prefix)/bin
46 LIBDIR= $(exec_prefix)/lib
48 INCLUDEDIR= $(prefix)/include
49 SCRIPTDIR= $(prefix)/lib
51 # Detailed destination directories
52 BINLIBDEST= $(LIBDIR)/python$(VERSION)
53 LIBDEST= $(SCRIPTDIR)/python$(VERSION)
54 INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
55 LIBP= $(LIBDIR)/python$(VERSION)
57 # Symbols used for using shared libraries
61 LINKFORSHARED= @LINKFORSHARED@
62 DESTSHARED= $(BINLIBDEST)/lib-dynload
64 # Portable install script (configure doesn't always guess right)
65 INSTALL= @srcdir@/../install-sh -c
66 INSTALL_PROGRAM=${INSTALL} -m 755
67 INSTALL_DATA= ${INSTALL} -m 644
68 # Shared libraries must be installed with executable mode on some systems;
69 # rather than figuring out exactly which, we always give them executable mode.
70 # Also, making them read-only seems to be a good idea...
71 INSTALL_SHARED= ${INSTALL} -m 555
73 # === Variables that are customizable by hand or by inclusion in Setup ===
76 INCLDIR= $(srcdir)/../Include
78 CFLAGS= $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS)
83 MAKESETUP= $(srcdir)/makesetup
85 # (The makesetup script inserts all variable definitions
86 # found in the Setup file just below the following line.
87 # This means that the Setup file can override any of the definitions
88 # given before this point, but not any given below.
89 # The script insert the definitions in reverse order,
90 # for the benefits of independent extensions.)
91 # === Definitions added by makesetup ===
93 # === Fixed definitions ===
95 FIXOBJS= config.o getpath.o main.o getbuildinfo.o
96 OBJS= $(MODOBJS) $(FIXOBJS)
100 SYSLIBS= $(LIBM) $(LIBC)
102 LIBRARY= ../libpython$(VERSION).a
103 REALLIBRARY= ../@REALLIBRARY@
109 # This target is used by the master Makefile to add the objects to the library.
110 # To deal with the conflict between signalmodule.o and
111 # sigcheck.o+intrcheck.o, we remove the latter two if we have the former.
113 -for i in $(OBJS); do \
114 if test "$$i" = "signalmodule.o"; then \
115 $(AR) d $(LIBRARY) sigcheck.o intrcheck.o 2>/dev/null; \
119 $(AR) cr $(LIBRARY) $(OBJS)
122 # Use ``EXE=.exe'' for Unix emulations on DOS/Windows
125 # This target is used by the master Makefile to link the final binary.
127 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \
128 $(LIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
129 mv python$(EXE) ../python$(EXE)
132 -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej add2lib
135 -rm -f *.a tags TAGS config.c Makefile.pre
136 -rm -f *.so *.sl so_locations
138 getpath.o: getpath.c Makefile
139 $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
140 -DPREFIX='"$(prefix)"' \
141 -DEXEC_PREFIX='"$(exec_prefix)"' \
142 -DVERSION='"$(VERSION)"' \
143 -DVPATH='"$(VPATH)"' \
146 # When the configuration changes, we remove the library, so that it
147 # gets remade from scratch; this ensures to remove modules that are no
148 # longer pertinent (but that were in a previous configuration).
149 config.c Makefile: Makefile.pre config.c.in $(MAKESETUP)
150 config.c Makefile: Setup.thread Setup Setup.local
153 $(SHELL) $(MAKESETUP) Setup.thread Setup.local Setup
156 cp $(srcdir)/Setup.in Setup
159 echo "# Edit this file for local setup changes" >Setup.local
161 Makefile.pre: Makefile.pre.in ../config.status
162 (cd ..; CONFIG_FILES=Modules/Makefile.pre CONFIG_HEADERS= \
163 $(SHELL) config.status)
166 $(MKDEP) $(CFLAGS) `echo $(OBJS) | tr ' ' '\012' | \
167 sed 's|\(.*\)\.o|$(srcdir)/\1.c|'`
171 glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs
172 python $(srcdir)/cgen.py <$(srcdir)/cstubs >glmodule.c
174 almodule.o: almodule.c
175 arraymodule.o: arraymodule.c
177 cdmodule.o: cdmodule.c
178 cgensupport.o: cgensupport.c
179 clmodule.o: clmodule.c
180 dbmmodule.o: dbmmodule.c
181 errnomodule.o: errnomodule.c
182 fcntlmodule.o: fcntlmodule.c
183 flmodule.o: flmodule.c
184 fmmodule.o: fmmodule.c
185 glmodule.o: glmodule.c
189 mathmodule.o: mathmodule.c
191 md5module.o: md5module.c
192 mpzmodule.o: mpzmodule.c
193 nismodule.o: nismodule.c
194 operator.o: operator.c
195 parsermodule.o: parsermodule.c
196 posixmodule.o: posixmodule.c
197 pwdmodule.o: pwdmodule.c
198 regexmodule.o: regexmodule.c
200 resource.o: resource.c
201 rgbimgmodule.o: rgbimgmodule.c
202 rotormodule.o: rotormodule.c
203 selectmodule.o: selectmodule.c
204 sgimodule.o: sgimodule.c
205 socketmodule.o: socketmodule.c
206 stdwinmodule.o: stdwinmodule.c
207 stropmodule.o: stropmodule.c
208 structmodule.o: structmodule.c
209 sunaudiodev.o: sunaudiodev.c
210 svmodule.o: svmodule.c
211 threadmodule.o: threadmodule.c
212 timemodule.o: timemodule.c
213 timingmodule.o: timingmodule.c
214 xxmodule.o: xxmodule.c
215 yuvconvert.o: yuvconvert.c
217 # Rules to build and install all shared modules
218 sharedmods: $(SHAREDMODS)
219 sharedinstall: $(DESTSHARED) $(SHAREDMODS)
220 -for i in X $(SHAREDMODS); do \
222 then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \
226 DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
229 @for i in $(DESTDIRS); \
231 if test ! -d $$i; then \
232 echo "Creating directory $$i"; \
239 # Stuff is appended here by makesetup and make depend