This commit was manufactured by cvs2svn to create tag 'release101'.
[python/dscho.git] / Makefile.in
blob24d3c0eb182f1c5b24da1e3156041aef50ddd45c
1 ########################################################################
2 # Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
3 # Amsterdam, The Netherlands.
4 #
5 # All Rights Reserved
6 #
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@
32 # Install prefixes are treated specially by the configure script:
33 # it only changes these lines if it has received a --prefix=... or
34 # --exec-prefix-... command line option, or if it has figured out
35 # a value by searching for python in $PATH. Note that $(prefix) is
36 # also used when compiling config.c in Modules to set the default
37 # module search path, so if you change it later be sure to change it
38 # there too and rebuild.
40 # Install prefix for architecture-independent files
41 prefix= /usr/local
43 # Install prefix for architecture-dependent files
44 exec_prefix= $(prefix)
46 # Programs
47 SHELL= /bin/sh
49 # --with-PACKAGE options for configure script
50 # e.g. --with-readline --with-svr5 --with-solaris --with-thread
51 # (see README for an explanation)
52 WITH=
54 # Compiler options passed to subordinate makes
55 OPT= -O
57 # Subdirectories where to run make recursively
58 SUBDIRS= Parser Objects Python Modules
60 # Other subdirectories
61 SUBDIRSTOO= Include Lib Doc Misc Demo readline Grammar
63 # Files and directories to be distributed
64 CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.in
65 DISTFILES= README ChangeLog $(CONFIGFILES)
66 DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
67 DIST= $(DISTFILES) $(DISTDIRS)
69 # Default target
70 all: python
72 # Build the interpreter
73 python: Makefiles
74 for i in $(SUBDIRS); do \
75 (echo $$i; cd $$i; $(MAKE) OPT="$(OPT)" all); \
76 done
78 # Test the interpreter (twice, once without .pyc files, once with)
79 TESTPATH= $(srcdir)/Lib:$(srcdir)/Lib/test
80 test: python
81 -rm -f $(srcdir)/Lib/test/*.pyc
82 PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
83 PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
85 # Install the interpreter
86 install: python
87 $(INSTALL) python $(exec_prefix)/bin/python
88 @echo If this is your first time, consider make libinstall...
90 # Install the library.
91 # If your system does not support "cp -r", try "copy -r" or perhaps
92 # something like find Lib -print | cpio -pacvdmu $(DESTDIR)/lib/python
93 libinstall:
94 -if test ! -d $(prefix)/lib/python; \
95 then mkdir $(prefix)/lib/python; \
97 cp -r $(srcdir)/Lib/* $(prefix)/lib/python
98 @echo Ideally, run something to compile all modules now...
100 # install the manual page
101 maninstall:
102 $(INSTALL) $(srcdir)/Misc/python.man \
103 $(prefix)/man/man1/python.1
105 # install the include files
106 inclinstall:
107 -if test ! -d $(prefix)/include/Py; \
108 then mkdir $(prefix)/include/Py; \
110 cp $(srcdir)/Include/*.h $(prefix)/include/Py
112 # install the lib*.a files and miscellaneous stuff needed by extensions
113 LIBP= $(exec_prefix)/lib/python
114 LIBPL= $(LIBP)/lib
115 libainstall: all
116 -if test ! -d $(LIBP); \
117 then mkdir $(LIBP); \
119 -if test ! -d $(LIBPL); \
120 then mkdir $(LIBPL); \
122 for i in $(SUBDIRS); do \
123 echo $$i; $(INSTALL) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \
124 done
125 $(INSTALL) Modules/config.c $(LIBPL)/config.c
126 $(INSTALL) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
127 $(INSTALL) Modules/Makefile $(LIBPL)/Makefile
128 $(INSTALL) Modules/Setup $(LIBPL)/Setup
129 $(INSTALL) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
130 $(INSTALL) config.h $(LIBPL)/config.h
132 # Build the sub-Makefiles
133 Makefiles: config.status
134 (cd Modules; $(MAKE) -f Makefile.pre Makefile)
135 for i in . $(SUBDIRS); do \
136 (echo $$i; cd $$i; $(MAKE) Makefile); \
137 done
139 # Build the toplevel Makefile
140 Makefile: Makefile.in
141 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status
143 # Run the configure script. If config.status already exists,
144 # call it with the --recheck argument, which reruns configure with the
145 # same options as it was run last time; otherwise run the configure
146 # script with options taken from the $(WITH) variable
147 config.status: $(srcdir)/configure
148 if test -f config.status; \
149 then $(SHELL) config.status --recheck; \
150 else $(SHELL) $(srcdir)/configure $(WITH); \
153 .PRECIOUS: config.status python
155 # Rerun configure with the same options as it was run last time,
156 # provided the config.status script exists
157 recheck:
158 $(SHELL) config.status --recheck
160 # Rebuild the configure script from configure.in; also rebuild config.h.in
161 autoconf:
162 (cd $(srcdir); autoconf; autoheader)
164 # Create a tags file for vi
165 tags::
166 ctags -w -t Include/*.h
167 for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
168 sort tags -o tags
170 # Create a tags file for GNU Emacs
171 TAGS::
172 etags -t Include/*.h
173 for i in $(SUBDIRS); do etags -t -a $$i/*.[ch]; done
175 # Add dependencies to sub-Makefiles
176 depend:
177 for i in $(SUBDIRS); do \
178 (echo $$i; cd $$i; $(MAKE) depend); \
179 done
181 # Sanitation targets -- clean leaves libraries, executables and tags
182 # files, which clobber removes those as well
184 localclean:
185 -rm -f core *~ [@,#]* *.old *.orig *.rej
187 clean: localclean
188 -for i in $(SUBDIRS); do \
189 (echo $$i; cd $$i; \
190 if test -f Makefile; \
191 then $(MAKE) clean; \
192 else $(MAKE) -f Makefile.*in clean; \
193 fi); \
194 done
196 localclobber: localclean
197 -rm -f tags TAGS config.status
199 clobber: localclobber
200 -for i in $(SUBDIRS); do \
201 (echo $$i; cd $$i; \
202 if test -f Makefile; \
203 then $(MAKE) clobber; \
204 else $(MAKE) -f Makefile.in clobber; \
205 fi); \
206 done
208 # Make things extra clean, before making a distribution
209 distclean: clobber
210 -$(MAKE) SUBDIRS="$(SUBDIRSTOO)" clobber
211 -rm -f config.h Makefile
212 -for i in $(SUBDIRS) $(SUBDIRSTOO); do \
213 for f in $$i/*.in; do \
214 f=`basename "$$f" .in`; \
215 if test "$$f" != "*"; then \
216 echo rm -f "$$i/$$f"; \
217 rm -f "$$i/$$f"; \
218 fi; \
219 done; \
220 done
222 # Find files with funny names
223 find:
224 find $(DISTDIRS) -type d \
225 -o -name '*.[chs]' \
226 -o -name '*.py' \
227 -o -name '*.doc' \
228 -o -name '*.sty' \
229 -o -name '*.bib' \
230 -o -name '*.dat' \
231 -o -name '*.el' \
232 -o -name '*.fd' \
233 -o -name '*.in' \
234 -o -name '*.tex' \
235 -o -name '*,[vpt]' \
236 -o -name 'Setup' \
237 -o -name 'Setup.*' \
238 -o -name README \
239 -o -name Makefile \
240 -o -name ChangeLog \
241 -o -name RCS \
242 -o -name Repository \
243 -o -name Entries \
244 -o -name Tag \
245 -o -name tags \
246 -o -name TAGS \
247 -o -name .cvsignore \
248 -o -name MANIFEST \
249 -o -print
251 # Build a distribution tar file (run make distclean first)
252 # (This leaves the RCS and CVS directories in :-( )
253 tar:
254 tar cf - $(DIST) | compress >dist.tar.Z