1 ########################################################################
2 # Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
7 # Permission to use, copy, modify, and distribute this software and its
8 # documentation for any purpose and without fee is hereby granted,
9 # provided that the above copyright notice appear in all copies and that
10 # both that copyright notice and this permission notice appear in
11 # supporting documentation, and that the names of Stichting Mathematisch
12 # Centrum or CWI not be used in advertising or publicity pertaining to
13 # distribution of the software without specific, written prior permission.
15 # STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16 # THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 # FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18 # FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21 # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 ########################################################################
24 # Toplevel Makefile for Python
25 # Note -- if recursive makes fail, try adding MAKE=make
27 # Substitutions by configure
31 INSTALL_PROGRAM
=@INSTALL_PROGRAM@
32 INSTALL_DATA
= @INSTALL_DATA@
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
46 BINDIR
=$(exec_prefix)/bin
47 LIBDIR
=$(exec_prefix)/lib
48 INCLUDEDIR
=$(prefix)/include
49 SCRIPTDIR
=$(prefix)/lib
51 # Symbols used for using shared libraries
55 LINKFORSHARED
= @LINKFORSHARED@
56 DESTSHARED
= $(SCRIPTDIR
)/python
/$(MACHDEP
)
61 # --with-PACKAGE options for configure script
62 # e.g. --with-readline --with-svr5 --with-solaris --with-thread
63 # (see README for an explanation)
66 # Compiler options passed to subordinate makes
69 # Subdirectories where to run make recursively
70 SUBDIRS
= Parser Objects Python Modules
72 # Other subdirectories
73 SUBDIRSTOO
= Include Lib Doc Misc Demo readline Grammar
75 # Files and directories to be distributed
76 CONFIGFILES
= configure configure.in acconfig.h config.h.in Makefile.in
77 DISTFILES
= README ChangeLog
$(CONFIGFILES
)
78 DISTDIRS
= $(SUBDIRS
) $(SUBDIRSTOO
) Ext-dummy
79 DIST
= $(DISTFILES
) $(DISTDIRS
)
84 # Build the interpreter
86 for i in
$(SUBDIRS
); do \
88 $(MAKE
) OPT
="$(OPT)" \
90 exec_prefix="$(exec_prefix)" \
94 # Test the interpreter (twice, once without .pyc files, once with)
95 TESTPATH
= $(srcdir)/Lib
:$(srcdir)/Lib
/test:.
/Modules
97 -rm -f
$(srcdir)/Lib
/test/*.pyc
98 PYTHONPATH
=$(TESTPATH
) .
/python
-c
'import autotest'
99 PYTHONPATH
=$(TESTPATH
) .
/python
-c
'import autotest'
101 # Install the interpreter
103 $(INSTALL_PROGRAM
) python
$(BINDIR
)/python
104 @echo If this is your first time
, consider make libinstall...
106 # Install the library.
107 # If your system does not support "cp -r", try "copy -r" or perhaps
108 # something like find Lib -print | cpio -pacvdmu $(LIBDEST)
109 LIBDEST
= $(SCRIPTDIR
)/python
111 -if
test ! -d
$(LIBDEST
); \
112 then mkdir
$(LIBDEST
); \
114 cp
-r
$(srcdir)/Lib
/* $(LIBDEST
)
115 PYTHONPATH
=$(LIBDEST
) \
116 .
/python
$(LIBDEST
)/compileall.py
$(LIBDEST
)
120 LDSHARED
="$(LDSHARED)" \
121 CCSHARED
="$(CCSHARED)" \
122 LINKFORSHARED
="$(LINKFORSHARED)" \
123 DESTSHARED
="$(DESTSHARED)" \
126 # install the manual page
128 $(INSTALL_DATA
) $(srcdir)/Misc
/python.man \
129 $(MANDIR
)/man1
/python
.1
131 # install the include files
132 INCLUDEPY
= $(INCLUDEDIR
)/Py
134 -if
test ! -d
$(INCLUDEPY
); \
135 then mkdir
$(INCLUDEPY
); \
137 $(INSTALL_DATA
) $(srcdir)/Include
/*.h
$(INCLUDEPY
)
139 # install the lib*.a files and miscellaneous stuff needed by extensions
140 LIBP
= $(LIBDIR
)/python
143 -if
test ! -d
$(LIBP
); \
144 then mkdir
$(LIBP
); \
146 -if
test ! -d
$(LIBPL
); \
147 then mkdir
$(LIBPL
); \
149 for i in
$(SUBDIRS
); do \
150 echo
$$i; $(INSTALL_DATA
) $$i/lib
$$i.a
$(LIBPL
)/lib
$$i.a
; \
151 $(RANLIB
) $(LIBPL
)/lib
$$i.a
; \
153 $(INSTALL_DATA
) Modules
/config.c
$(LIBPL
)/config.c
154 $(INSTALL_DATA
) $(srcdir)/Modules
/getpath.c
$(LIBPL
)/getpath.c
155 $(INSTALL_DATA
) $(srcdir)/Modules
/config.c.in
$(LIBPL
)/config.c.in
156 $(INSTALL_DATA
) Modules
/Makefile
$(LIBPL
)/Makefile
157 $(INSTALL_DATA
) Modules
/Setup
$(LIBPL
)/Setup
158 $(INSTALL_DATA
) $(srcdir)/Modules
/makesetup
$(LIBPL
)/makesetup
159 $(INSTALL_DATA
) config.h
$(LIBPL
)/config.h
160 $(INSTALL_DATA
) $(srcdir)/Python
/frozenmain.c
$(LIBPL
)/frozenmain.c
162 # install the dynamically loadable modules
164 cd Modules
; $(MAKE
) \
167 LDSHARED
="$(LDSHARED)" \
168 CCSHARED
="$(CCSHARED)" \
169 LINKFORSHARED
="$(LINKFORSHARED)" \
170 DESTSHARED
="$(DESTSHARED)" \
173 # Build the sub-Makefiles
174 Makefiles
: config.status Modules
/Makefile.pre
175 (cd Modules
; $(MAKE
) -f Makefile.pre Makefile
)
176 for i in .
$(SUBDIRS
); do \
177 (echo
$$i; cd
$$i; $(MAKE
) Makefile
); \
180 # Build the intermediate Makefile in Modules
181 Modules
/Makefile.pre
: config.status
182 $(SHELL
) config.status
184 # Build the toplevel Makefile
185 Makefile
: Makefile.in config.status
186 CONFIG_FILES
=Makefile CONFIG_HEADERS
= $(SHELL
) config.status
188 # Run the configure script. If config.status already exists,
189 # call it with the --recheck argument, which reruns configure with the
190 # same options as it was run last time; otherwise run the configure
191 # script with options taken from the $(WITH) variable
192 config.status
: $(srcdir)/configure
193 if
test -f config.status
; \
194 then
$(SHELL
) config.status
--recheck
; \
195 $(SHELL
) config.status
; \
196 else $(SHELL
) $(srcdir)/configure
$(WITH
); \
199 .PRECIOUS
: config.status python
201 # Rerun configure with the same options as it was run last time,
202 # provided the config.status script exists
204 $(SHELL
) config.status
--recheck
205 $(SHELL
) config.status
207 # Rebuild the configure script from configure.in; also rebuild config.h.in
209 (cd
$(srcdir); autoconf
; autoheader
)
211 # Create a tags file for vi
213 ctags
-w
-t Include
/*.h
214 for i in
$(SUBDIRS
); do ctags
-w
-t
-a
$$i/*.
[ch
]; done
217 # Create a tags file for GNU Emacs
220 for i in
$(SUBDIRS
); do etags
-a
$$i/*.
[ch
]; done
222 # Add dependencies to sub-Makefiles
224 for i in
$(SUBDIRS
); do \
225 (echo
$$i; cd
$$i; $(MAKE
) depend
); \
228 # Sanitation targets -- clean leaves libraries, executables and tags
229 # files, which clobber removes those as well
232 -rm -f core
*~
[@
,#]* *.old *.orig *.rej
235 -for i in
$(SUBDIRS
); do \
237 if
test -f Makefile
; \
238 then
$(MAKE
) clean; \
239 else $(MAKE
) -f Makefile.
*in
clean; \
243 localclobber
: localclean
244 -rm -f
tags TAGS python
245 -rm -f config.log config.cache config.h Makefile
247 clobber: localclobber
248 -for i in
$(SUBDIRS
); do \
250 if
test -f Makefile
; \
251 then
$(MAKE
) clobber; \
252 else $(MAKE
) -f
$(srcdir)/Makefile.in
clobber; \
256 # Make things extra clean, before making a distribution
258 -$(MAKE
) -f
$(srcdir)/Makefile.in \
259 SUBDIRS
="$(SUBDIRSTOO)" clobber
260 -rm -f config.status config.log config.cache config.h Makefile
261 -for i in
$(SUBDIRS
) $(SUBDIRSTOO
); do \
262 for f in
$$i/*.in
; do \
263 f
=`basename "$$f" .in`; \
264 if
test "$$f" != "*"; then \
265 echo
rm -f
"$$i/$$f"; \
271 # Find files with funny names
273 find
$(DISTDIRS
) -type d \
291 -o
-name Repository \
296 -o
-name .cvsignore \
300 # Build a distribution tar file (run make distclean first)
301 # (This leaves the RCS and CVS directories in :-( )
303 tar cf
- $(DIST
) | gzip
--best
>dist.
tar.gz