This commit was manufactured by cvs2svn to create tag 'cnrisync'.
[python/dscho.git] / Makefile.in
blob8b0edf04ab2620e339252277e1905ce069b419b1
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
161 $(INSTALL_DATA) Modules/main.o $(LIBPL)/main.o
163 # install the dynamically loadable modules
164 sharedinstall:
165 cd Modules; $(MAKE) \
166 OPT="$(OPT)" \
167 SO="$(SO)" \
168 LDSHARED="$(LDSHARED)" \
169 CCSHARED="$(CCSHARED)" \
170 LINKFORSHARED="$(LINKFORSHARED)" \
171 DESTSHARED="$(DESTSHARED)" \
172 sharedinstall
174 # Build the sub-Makefiles
175 Makefiles: config.status Modules/Makefile.pre
176 (cd Modules; $(MAKE) -f Makefile.pre Makefile)
177 for i in . $(SUBDIRS); do \
178 (echo $$i; cd $$i; $(MAKE) Makefile); \
179 done
181 # Build the intermediate Makefile in Modules
182 Modules/Makefile.pre: config.status
183 $(SHELL) config.status
185 # Build the toplevel Makefile
186 Makefile: Makefile.in config.status
187 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status
189 # Run the configure script. If config.status already exists,
190 # call it with the --recheck argument, which reruns configure with the
191 # same options as it was run last time; otherwise run the configure
192 # script with options taken from the $(WITH) variable
193 config.status: $(srcdir)/configure
194 if test -f config.status; \
195 then $(SHELL) config.status --recheck; \
196 $(SHELL) config.status; \
197 else $(SHELL) $(srcdir)/configure $(WITH); \
200 .PRECIOUS: config.status python
202 # Rerun configure with the same options as it was run last time,
203 # provided the config.status script exists
204 recheck:
205 $(SHELL) config.status --recheck
206 $(SHELL) config.status
208 # Rebuild the configure script from configure.in; also rebuild config.h.in
209 autoconf:
210 (cd $(srcdir); autoconf; autoheader)
212 # Create a tags file for vi
213 tags::
214 ctags -w -t Include/*.h
215 for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
216 sort tags -o tags
218 # Create a tags file for GNU Emacs
219 TAGS::
220 etags Include/*.h
221 for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
223 # Add dependencies to sub-Makefiles
224 depend:
225 for i in $(SUBDIRS); do \
226 (echo $$i; cd $$i; $(MAKE) depend); \
227 done
229 # Sanitation targets -- clean leaves libraries, executables and tags
230 # files, which clobber removes those as well
232 localclean:
233 -rm -f core *~ [@,#]* *.old *.orig *.rej
235 clean: localclean
236 -for i in $(SUBDIRS); do \
237 (echo $$i; cd $$i; \
238 if test -f Makefile; \
239 then $(MAKE) clean; \
240 else $(MAKE) -f Makefile.*in clean; \
241 fi); \
242 done
244 localclobber: localclean
245 -rm -f tags TAGS python
246 -rm -f config.log config.cache config.h Makefile
248 clobber: localclobber
249 -for i in $(SUBDIRS); do \
250 (echo $$i; cd $$i; \
251 if test -f Makefile; \
252 then $(MAKE) clobber; \
253 else $(MAKE) -f $(srcdir)/Makefile.in clobber; \
254 fi); \
255 done
257 # Make things extra clean, before making a distribution
258 distclean: clobber
259 -$(MAKE) -f $(srcdir)/Makefile.in \
260 SUBDIRS="$(SUBDIRSTOO)" clobber
261 -rm -f config.status config.log config.cache config.h Makefile
262 -rm -f Modules/Makefile
263 -for i in $(SUBDIRS) $(SUBDIRSTOO); do \
264 for f in $$i/*.in; do \
265 f=`basename "$$f" .in`; \
266 if test "$$f" != "*"; then \
267 echo rm -f "$$i/$$f"; \
268 rm -f "$$i/$$f"; \
269 fi; \
270 done; \
271 done
273 # Find files with funny names
274 find:
275 find $(DISTDIRS) -type d \
276 -o -name '*.[chs]' \
277 -o -name '*.py' \
278 -o -name '*.doc' \
279 -o -name '*.sty' \
280 -o -name '*.bib' \
281 -o -name '*.dat' \
282 -o -name '*.el' \
283 -o -name '*.fd' \
284 -o -name '*.in' \
285 -o -name '*.tex' \
286 -o -name '*,[vpt]' \
287 -o -name 'Setup' \
288 -o -name 'Setup.*' \
289 -o -name README \
290 -o -name Makefile \
291 -o -name ChangeLog \
292 -o -name RCS \
293 -o -name Repository \
294 -o -name Entries \
295 -o -name Tag \
296 -o -name tags \
297 -o -name TAGS \
298 -o -name .cvsignore \
299 -o -name MANIFEST \
300 -o -print
302 # Build a distribution tar file (run make distclean first)
303 # (This leaves the RCS and CVS directories in :-( )
304 tar:
305 tar cf - $(DIST) | gzip --best >dist.tar.gz