This commit was manufactured by cvs2svn to create tag 'r13beta1'.
[python/dscho.git] / Makefile.in
blob2ec51424b225e59f2b3a06361dadeda351976728
1 ########################################################################
2 # Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
3 # The Netherlands.
5 # All Rights Reserved
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
28 srcdir= @srcdir@
29 VPATH= @srcdir@
30 INSTALL= @INSTALL@
31 INSTALL_PROGRAM=@INSTALL_PROGRAM@
32 INSTALL_DATA= @INSTALL_DATA@
33 RANLIB= @RANLIB@
35 # Machine-dependent subdirectories
36 MACHDEP= @MACHDEP@
38 # Install prefix for architecture-independent files
39 prefix= @prefix@
41 # Install prefix for architecture-dependent files
42 exec_prefix= @exec_prefix@
44 # Expanded directories
45 MANDIR=$(prefix)/man
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
52 SO= @SO@
53 LDSHARED= @LDSHARED@
54 CCSHARED= @CCSHARED@
55 LINKFORSHARED= @LINKFORSHARED@
56 DESTSHARED= $(SCRIPTDIR)/python/$(MACHDEP)
58 # Programs
59 SHELL= /bin/sh
61 # --with-PACKAGE options for configure script
62 # e.g. --with-readline --with-svr5 --with-solaris --with-thread
63 # (see README for an explanation)
64 WITH=
66 # Compiler options passed to subordinate makes
67 OPT= @OPT@
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)
81 # Default target
82 all: python
84 # Build the interpreter
85 python: Makefiles
86 for i in $(SUBDIRS); do \
87 (echo $$i; cd $$i; \
88 $(MAKE) OPT="$(OPT)" \
89 prefix="$(prefix)" \
90 exec_prefix="$(exec_prefix)" \
91 all); \
92 done
94 # Test the interpreter (twice, once without .pyc files, once with)
95 TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/test:./Modules
96 test: python
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
102 install: python
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
110 libinstall:
111 -if test ! -d $(LIBDEST); \
112 then mkdir $(LIBDEST); \
114 cp -r $(srcdir)/Lib/* $(LIBDEST)
115 PYTHONPATH=$(LIBDEST) \
116 ./python $(LIBDEST)/compileall.py $(LIBDEST)
117 $(MAKE) \
118 OPT="$(OPT)" \
119 SO="$(SO)" \
120 LDSHARED="$(LDSHARED)" \
121 CCSHARED="$(CCSHARED)" \
122 LINKFORSHARED="$(LINKFORSHARED)" \
123 DESTSHARED="$(DESTSHARED)" \
124 sharedinstall
126 # install the manual page
127 maninstall:
128 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
129 $(MANDIR)/man1/python.1
131 # install the include files
132 INCLUDEPY= $(INCLUDEDIR)/Py
133 inclinstall:
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
141 LIBPL= $(LIBP)/lib
142 libainstall: all
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; \
152 done
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
163 sharedinstall:
164 cd Modules; $(MAKE) \
165 OPT="$(OPT)" \
166 SO="$(SO)" \
167 LDSHARED="$(LDSHARED)" \
168 CCSHARED="$(CCSHARED)" \
169 LINKFORSHARED="$(LINKFORSHARED)" \
170 DESTSHARED="$(DESTSHARED)" \
171 sharedinstall
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); \
178 done
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
203 recheck:
204 $(SHELL) config.status --recheck
205 $(SHELL) config.status
207 # Rebuild the configure script from configure.in; also rebuild config.h.in
208 autoconf:
209 (cd $(srcdir); autoconf; autoheader)
211 # Create a tags file for vi
212 tags::
213 ctags -w -t Include/*.h
214 for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
215 sort tags -o tags
217 # Create a tags file for GNU Emacs
218 TAGS::
219 etags Include/*.h
220 for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
222 # Add dependencies to sub-Makefiles
223 depend:
224 for i in $(SUBDIRS); do \
225 (echo $$i; cd $$i; $(MAKE) depend); \
226 done
228 # Sanitation targets -- clean leaves libraries, executables and tags
229 # files, which clobber removes those as well
231 localclean:
232 -rm -f core *~ [@,#]* *.old *.orig *.rej
234 clean: localclean
235 -for i in $(SUBDIRS); do \
236 (echo $$i; cd $$i; \
237 if test -f Makefile; \
238 then $(MAKE) clean; \
239 else $(MAKE) -f Makefile.*in clean; \
240 fi); \
241 done
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 \
249 (echo $$i; cd $$i; \
250 if test -f Makefile; \
251 then $(MAKE) clobber; \
252 else $(MAKE) -f $(srcdir)/Makefile.in clobber; \
253 fi); \
254 done
256 # Make things extra clean, before making a distribution
257 distclean: clobber
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"; \
266 rm -f "$$i/$$f"; \
267 fi; \
268 done; \
269 done
271 # Find files with funny names
272 find:
273 find $(DISTDIRS) -type d \
274 -o -name '*.[chs]' \
275 -o -name '*.py' \
276 -o -name '*.doc' \
277 -o -name '*.sty' \
278 -o -name '*.bib' \
279 -o -name '*.dat' \
280 -o -name '*.el' \
281 -o -name '*.fd' \
282 -o -name '*.in' \
283 -o -name '*.tex' \
284 -o -name '*,[vpt]' \
285 -o -name 'Setup' \
286 -o -name 'Setup.*' \
287 -o -name README \
288 -o -name Makefile \
289 -o -name ChangeLog \
290 -o -name RCS \
291 -o -name Repository \
292 -o -name Entries \
293 -o -name Tag \
294 -o -name tags \
295 -o -name TAGS \
296 -o -name .cvsignore \
297 -o -name MANIFEST \
298 -o -print
300 # Build a distribution tar file (run make distclean first)
301 # (This leaves the RCS and CVS directories in :-( )
302 tar:
303 tar cf - $(DIST) | gzip --best >dist.tar.gz