Delete X10 code.
[bpt/emacs.git] / Makefile.in
1 # DIST: This is the distribution Makefile for Emacs. configure can
2 # DIST: make most of the changes to this file you might want, so try
3 # DIST: that first.
4
5 # make all to compile and build Emacs.
6 # make install to install it.
7 # make TAGS to update tags tables.
8 #
9 # make clean or make mostlyclean
10 # Delete all files from the current directory that are normally
11 # created by building the program. Don't delete the files that
12 # record the configuration. Also preserve files that could be made
13 # by building, but normally aren't because the distribution comes
14 # with them.
15 #
16 # Delete `.dvi' files here if they are not part of the distribution.
17 #
18 # make distclean
19 # Delete all files from the current directory that are created by
20 # configuring or building the program. If you have unpacked the
21 # source and built the program without creating any other files,
22 # `make distclean' should leave only the files that were in the
23 # distribution.
24 #
25 # make realclean
26 # Delete everything from the current directory that can be
27 # reconstructed with this Makefile. This typically includes
28 # everything deleted by distclean, plus more: C source files
29 # produced by Bison, tags tables, info files, and so on.
30 #
31 # make extraclean
32 # Still more severe - delete backup and autosave files, too.
33
34 SHELL = /bin/sh
35
36 # If Make doesn't predefine MAKE, set it here.
37 @SET_MAKE@
38
39 # ==================== Things `configure' Might Edit ====================
40
41 CC=@CC@
42 CPP=@CPP@
43 C_SWITCH_SYSTEM=@c_switch_system@
44 ALLOCA=@ALLOCA@
45 LN_S=@LN_S@
46 CFLAGS=@CFLAGS@
47 C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
48 LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@
49 YACC=@YACC@
50
51 ### These help us choose version- and architecture-specific directories
52 ### to install files in.
53
54 ### This should be the number of the Emacs version we're building,
55 ### like `18.59' or `19.0'.
56 version=@version@
57
58 ### This should be the name of the configuration we're building Emacs
59 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
60 configuration=@configuration@
61
62 # ==================== Where To Install Things ====================
63
64 # The default location for installation. Everything is placed in
65 # subdirectories of this directory. The default values for many of
66 # the variables below are expressed in terms of this one, so you may
67 # not need to change them. This defaults to /usr/local.
68 prefix=@prefix@
69
70 # Like `prefix', but used for architecture-specific files.
71 exec_prefix=@exec_prefix@
72
73 # Where to install Emacs and other binaries that people will want to
74 # run directly (like etags).
75 bindir=@bindir@
76
77 # Where to install architecture-independent data files. ${lispdir}
78 # and ${etcdir} are subdirectories of this.
79 datadir=@datadir@
80
81 # Where to install and expect the files that Emacs modifies as it
82 # runs. These files are all architecture-independent. Right now, the
83 # only such data is the locking directory; ${lockdir} is a
84 # subdirectory of this.
85 sharedstatedir=@sharedstatedir@
86
87 # Where to install and expect executable files to be run by Emacs
88 # rather than directly by users, and other architecture-dependent
89 # data. ${archlibdir} is a subdirectory of this.
90 libexecdir=@libexecdir@
91
92 # Where to install Emacs's man pages, and what extension they should have.
93 mandir=@mandir@
94 manext=.1
95
96 # Where to install and expect the info files describing Emacs. In the
97 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
98 # since there are now many packages documented with the texinfo
99 # system, it is inappropriate to imply that it is part of Emacs.
100 infodir=@infodir@
101
102 # Where to look for bitmap files.
103 bitmapdir=@bitmapdir@
104
105 # Where to find the source code. The source code for Emacs's C kernel is
106 # expected to be in ${srcdir}/src, and the source code for Emacs's
107 # utility programs is expected to be in ${srcdir}/lib-src. This is
108 # set by the configure script's `--srcdir' option.
109 srcdir=@srcdir@
110
111 # Tell make where to find source files; this is needed for the makefiles.
112 VPATH=@srcdir@
113
114 # ==================== Emacs-specific directories ====================
115
116 # These variables hold the values Emacs will actually use. They are
117 # based on the values of the standard Make variables above.
118
119 # Where to install the lisp files distributed with
120 # Emacs. This includes the Emacs version, so that the
121 # lisp files for different versions of Emacs will install
122 # themselves in separate directories.
123 lispdir=@lispdir@
124
125 # Directories Emacs should search for lisp files specific
126 # to this site (i.e. customizations), before consulting
127 # ${lispdir}. This should be a colon-separated list of
128 # directories.
129 locallisppath=@locallisppath@
130
131 # Where Emacs will search to find its lisp files. Before
132 # changing this, check to see if your purpose wouldn't
133 # better be served by changing locallisppath. This
134 # should be a colon-separated list of directories.
135 lisppath=@lisppath@
136
137 # Where Emacs will search for its lisp files while
138 # building. This is only used during the process of
139 # compiling Emacs, to help Emacs find its lisp files
140 # before they've been installed in their final location.
141 # It's usually identical to lisppath, except that
142 # it does not include locallisppath, and the
143 # entry for the directory containing the installed lisp
144 # files has been replaced with ../lisp. This should be a
145 # colon-separated list of directories.
146 buildlisppath=${srcdir}/lisp
147
148 # Where to install the other architecture-independent
149 # data files distributed with Emacs (like the tutorial,
150 # the cookie recipes and the Zippy database). This path
151 # usually contains the Emacs version number, so the data
152 # files for multiple versions of Emacs may be installed
153 # at once.
154 etcdir=@etcdir@
155
156 # Where to create and expect the locking directory, where
157 # the Emacs locking code keeps track of which files are
158 # currently being edited.
159 lockdir=@lockdir@
160
161 # Where to put executables to be run by Emacs rather than
162 # the user. This path usually includes the Emacs version
163 # and configuration name, so that multiple configurations
164 # for multiple versions of Emacs may be installed at
165 # once.
166 archlibdir=@archlibdir@
167
168 # Where to put the docstring file.
169 docdir=@docdir@
170
171 # ==================== Utility Programs for the Build ====================
172
173 # Allow the user to specify the install program.
174 INSTALL = @INSTALL@
175 INSTALL_PROGRAM = @INSTALL_PROGRAM@
176 INSTALL_DATA = @INSTALL_DATA@
177
178 # ============================= Targets ==============================
179
180 # What emacs should be called when installed.
181 EMACS = emacs
182
183 # Subdirectories to make recursively. `lisp' is not included
184 # because the compiled lisp files are part of the distribution
185 # and you cannot remake them without installing Emacs first.
186 SUBDIR = lib-src src
187
188 # The makefiles of the directories in $SUBDIR.
189 SUBDIR_MAKEFILES = lib-src/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile
190
191 # Subdirectories to install, and where they'll go.
192 # lib-src's makefile knows how to install it, so we don't do that here.
193 # When installing the info files, we need to do special things to
194 # avoid nuking an existing dir file, so we don't do that here;
195 # instead, we have written out explicit code in the `install' targets.
196 COPYDIR = ${srcdir}/etc ${srcdir}/lisp
197 COPYDESTS = ${etcdir} ${lispdir}
198
199 all: paths-force ${SUBDIR}
200
201 removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g'
202
203 # Note that sed is not in /bin on 386bsd.
204 src/paths.h: Makefile ${srcdir}/src/paths.h.in
205 @echo "Producing \`src/paths.h' from \`src/paths.h.in'."
206 @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
207 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
208 sed < ${srcdir}/src/paths.h.in > paths.h.tmp$$$$ \
209 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
210 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
211 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
212 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
213 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
214 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
215 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \
216 -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";') && \
217 ${srcdir}/move-if-change paths.h.tmp$$$$ src/paths.h
218
219 # For `make all',
220 # we force the rebuilding of src/paths.h because the user might give
221 # make different values for the various directories. Since we use
222 # move-if-change, src/paths.h only actually changes if the user did
223 # something notable, so the only unnecessary work we do is in building
224 # paths.h.tmp$$$$, which isn't much.
225 # Note that sed is not in /bin on 386bsd.
226 # We depend on src/paths.h here to prevent simultaneous execution of
227 # that rule and this one, in a parallel make.
228 # It is possible for paths.h to be updated twice--but that would happen anyway.
229 paths-force: FRC src/paths.h
230 @echo "Producing \`src/paths.h' from \`src/paths.h.in'."
231 @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
232 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
233 sed < ${srcdir}/src/paths.h.in > paths.h.tmp$$$$ \
234 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
235 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
236 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
237 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
238 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
239 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
240 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \
241 -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";') && \
242 ${srcdir}/move-if-change paths.h.tmp$$$$ src/paths.h
243
244 src: lib-src FRC src/paths.h
245
246 # This ought to depend on src/paths.h, so that in parallel make
247 # src/paths.h will be available for the compilations in lib-src.
248 # But that causes trouble in `make install' if a different prefix
249 # is specified at that time.
250 lib-src: FRC src/paths.h
251
252 .RECURSIVE: ${SUBDIR}
253
254 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
255 cd $@; $(MAKE) all $(MFLAGS) \
256 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
257 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
258
259 blessmail: ${SUBDIR_MAKEFILES} src FRC
260 cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) MAKE='${MAKE}'
261
262 Makefile: Makefile.in config.status
263 ./config.status
264
265 src/Makefile: src/Makefile.in.in config.status
266 ./config.status
267
268 lib-src/Makefile: lib-src/Makefile.in config.status
269 ./config.status
270
271 oldXMenu/Makefile: oldXMenu/Makefile.in config.status
272 ./config.status
273
274 lwlib/Makefile: lwlib/Makefile.in config.status
275 ./config.status
276
277 # ==================== Installation ====================
278
279 ## If we let lib-src do its own installation, that means we
280 ## don't have to duplicate the list of utilities to install in
281 ## this Makefile as well.
282
283 ## On AIX, use tar xBf.
284 ## On Xenix, use tar xpf.
285
286 .PHONY: install mkdir
287
288 ## We delete each directory in ${COPYDESTS} before we copy into it;
289 ## that way, we can reinstall over directories that have been put in
290 ## place with their files read-only (perhaps because they are checked
291 ## into RCS). In order to make this safe, we make sure that the
292 ## source exists and is distinct from the destination.
293 ## We don't depend on `all', but rather on ${SUBDIR}, so that we won't
294 ## ever modify src/paths.h.
295 install: ${SUBDIR} install-arch-dep install-arch-indep blessmail;
296
297 ### Note that we copy the DOC-* files from the build etc directory
298 ### as well as lots of things from ${srcdir}/etc.
299 install-arch-dep: mkdir
300 (cd lib-src; \
301 $(MAKE) install $(MFLAGS) prefix=${prefix} \
302 exec_prefix=${exec_prefix} bindir=${bindir} \
303 libexecdir=${libexecdir} archlibdir=${archlibdir})
304 ${INSTALL_PROGRAM} src/emacs ${bindir}/emacs-${version}
305 -chmod 1755 ${bindir}/emacs-${version}
306 rm -f ${bindir}/$(EMACS)
307 -ln ${bindir}/emacs-${version} ${bindir}/$(EMACS)
308
309 ### Note that we copy the DOC-* files from the build etc directory
310 ### as well as lots of things from ${srcdir}/etc.
311
312 # These lines appeared after the second -set, but should be unnecessary.
313 # mkdir ${COPYDESTS} ; \
314 # chmod ugo+rx ${COPYDESTS} ; \
315 install-arch-indep: mkdir
316 -set ${COPYDESTS} ; \
317 for dir in ${COPYDIR} ; do \
318 if [ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \
319 rm -rf $$1 ; \
320 fi ; \
321 shift ; \
322 done
323 -set ${COPYDESTS} ; \
324 for dir in ${COPYDIR} ; do \
325 dest=$$1 ; shift ; \
326 [ -d $${dir} ] \
327 && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
328 && (echo "Copying $${dir}..." ; \
329 (cd $${dir}; tar -cf - . )|(cd $${dest};umask 022; tar -xvf - ); \
330 for subdir in `find $${dest} -type d ! -name RCS -print` ; do \
331 rm -rf $${subdir}/RCS ; \
332 rm -rf $${subdir}/CVS ; \
333 rm -f $${subdir}/\#* ; \
334 rm -f $${subdir}/*~ ; \
335 done) ; \
336 done
337 -rm -f ${lispdir}/subdirs.el
338 ./update-subdirs ${lispdir}
339 if [ `(cd ./etc; /bin/pwd)` != `(cd ${docdir}; /bin/pwd)` ]; \
340 then \
341 echo "Copying etc/DOC-* ..." ; \
342 (cd etc; tar -cf - DOC-*)|(cd ${docdir}; umask 0; tar -xvf - ); \
343 else true; fi
344 thisdir=`/bin/pwd`; \
345 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
346 then \
347 (cd ${srcdir}/info ; \
348 if [ ! -f ${infodir}/dir ] && [ -f dir ]; then \
349 (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir); \
350 fi ; \
351 for f in cl* dired-x* emacs* forms* gnus* info* sc* vip* ; do \
352 (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f); \
353 done); \
354 else true; fi
355 thisdir=`/bin/pwd`; cd ${srcdir}/etc; for page in emacs etags ctags ; do \
356 (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${mandir}/$${page}${manext}); \
357 done
358
359 ### Build all the directories we're going to install Emacs in. Since
360 ### we may be creating several layers of directories (for example,
361 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use mkinstalldirs
362 ### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
363 mkdir: FRC
364 $(srcdir)/mkinstalldirs ${COPYDESTS} ${lockdir} ${infodir} ${mandir} \
365 ${bindir} ${datadir} ${docdir} ${libexecdir} \
366 `echo ${locallisppath} | sed 's/:/ /g'`
367 -chmod 777 ${lockdir}
368
369 ### Delete all the installed files that the `install' target would
370 ### create (but not the noninstalled files such as `make all' would
371 ### create).
372 ###
373 ### Don't delete the lisp and etc directories if they're in the source tree.
374 uninstall:
375 (cd lib-src; \
376 $(MAKE) $(MFLAGS) uninstall \
377 prefix=${prefix} exec_prefix=${exec_prefix} \
378 bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir})
379 for dir in ${lispdir} ${etcdir} ; do \
380 if [ -d $${dir} ]; then \
381 case `(cd $${dir} ; /bin/pwd)` in \
382 `(cd ${srcdir} ; /bin/pwd)`* ) ;; \
383 * ) rm -rf $${dir} ;; \
384 esac ; \
385 case $${dir} in \
386 ${datadir}/emacs/${version}/* ) \
387 rm -rf ${datadir}/emacs/${version} \
388 ;; \
389 esac ; \
390 fi ; \
391 done
392 (cd ${infodir}; rm -f cl* emacs* forms* info* vip*)
393 (cd ${mandir}; rm -f emacs.1 etags.1 ctags.1)
394 (cd ${bindir}; rm -f emacs-${version} $(EMACS))
395
396
397 FRC:
398
399 # ==================== Cleaning up and miscellanea ====================
400
401 .PHONY: mostlyclean clean distclean realclean extraclean
402
403 ### `mostlyclean'
404 ### Like `clean', but may refrain from deleting a few files that people
405 ### normally don't want to recompile. For example, the `mostlyclean'
406 ### target for GCC does not delete `libgcc.a', because recompiling it
407 ### is rarely necessary and takes a lot of time.
408 mostlyclean: FRC
409 (cd src; $(MAKE) $(MFLAGS) mostlyclean)
410 (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean)
411 (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
412 (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
413 -(cd man && $(MAKE) $(MFLAGS) mostlyclean)
414
415 ### `clean'
416 ### Delete all files from the current directory that are normally
417 ### created by building the program. Don't delete the files that
418 ### record the configuration. Also preserve files that could be made
419 ### by building, but normally aren't because the distribution comes
420 ### with them.
421 ###
422 ### Delete `.dvi' files here if they are not part of the distribution.
423 clean: FRC
424 (cd src; $(MAKE) $(MFLAGS) clean)
425 (cd oldXMenu; $(MAKE) $(MFLAGS) clean)
426 (cd lwlib; $(MAKE) $(MFLAGS) clean)
427 (cd lib-src; $(MAKE) $(MFLAGS) clean)
428 -(cd man && $(MAKE) $(MFLAGS) clean)
429
430 ### `distclean'
431 ### Delete all files from the current directory that are created by
432 ### configuring or building the program. If you have unpacked the
433 ### source and built the program without creating any other files,
434 ### `make distclean' should leave only the files that were in the
435 ### distribution.
436 top_distclean=\
437 rm -f config.status ; \
438 rm -f Makefile ${SUBDIR_MAKEFILES} ; \
439 (cd lock ; rm -f *)
440 distclean: FRC
441 (cd src; $(MAKE) $(MFLAGS) distclean)
442 (cd oldXMenu; $(MAKE) $(MFLAGS) distclean)
443 (cd lwlib; $(MAKE) $(MFLAGS) distclean)
444 (cd lib-src; $(MAKE) $(MFLAGS) distclean)
445 (cd man && $(MAKE) $(MFLAGS) distclean)
446 ${top_distclean}
447
448
449 ### `realclean'
450 ### Delete everything from the current directory that can be
451 ### reconstructed with this Makefile. This typically includes
452 ### everything deleted by distclean, plus more: C source files
453 ### produced by Bison, tags tables, info files, and so on.
454 ###
455 ### One exception, however: `make realclean' should not delete
456 ### `configure' even if `configure' can be remade using a rule in the
457 ### Makefile. More generally, `make realclean' should not delete
458 ### anything that needs to exist in order to run `configure' and then
459 ### begin to build the program.
460 realclean: FRC
461 (cd src; $(MAKE) $(MFLAGS) realclean)
462 (cd oldXMenu; $(MAKE) $(MFLAGS) realclean)
463 (cd lwlib; $(MAKE) $(MFLAGS) realclean)
464 (cd lib-src; $(MAKE) $(MFLAGS) realclean)
465 -(cd man && $(MAKE) $(MFLAGS) realclean)
466 ${top_distclean}
467
468 ### This doesn't actually appear in the coding standards, but Karl
469 ### says GCC supports it, and that's where the configuration part of
470 ### the coding standards seem to come from. It's like distclean, but
471 ### it deletes backup and autosave files too.
472 extraclean:
473 for i in ${SUBDIR}; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done
474 -(cd lock; rm *)
475 -rm config.status config-tmp-*
476 -rm -f *~ \#*
477
478 ### Unlocking and relocking. The idea of these productions is to reduce
479 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
480 ### before unlocking the file to take the write locks off all sources so
481 ### that tar xvof will overwrite them without fuss. Then do `make relock'
482 ### afterward so that VC mode will know which files should be checked in
483 ### if you want to mung them.
484 ###
485 ### Note: it's no disaster if these productions miss a file or two; tar
486 ### and VC will swiftly let you know if this happens, and it is easily
487 ### corrected.
488 SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
489 README configure make-dist move-if-change
490
491 .PHONY: unlock relock
492
493 unlock:
494 chmod u+w $(SOURCES) cpp/*
495 -(cd elisp; chmod u+w Makefile README *.texi)
496 (cd etc; $(MAKE) $(MFLAGS) unlock)
497 (cd lib-src; $(MAKE) $(MFLAGS) unlock)
498 (cd lisp; $(MAKE) $(MFLAGS) unlock)
499 (cd lisp/term; chmod u+w README *.el)
500 (cd man; chmod u+w *texi* ChangeLog split-man)
501 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
502 (cd lwlib; chmod u+w *.[ch] Makefile README)
503 (cd src; $(MAKE) $(MFLAGS) unlock)
504
505 relock:
506 chmod u-w $(SOURCES) cpp/*
507 -(cd elisp; chmod u-w Makefile README *.texi)
508 (cd etc; $(MAKE) $(MFLAGS) relock)
509 (cd lib-src; $(MAKE) $(MFLAGS) relock)
510 (cd lisp; $(MAKE) $(MFLAGS) relock)
511 (cd lisp/term; chmod u+w README *.el)
512 (cd man; chmod u+w *texi* ChangeLog split-man)
513 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
514 (cd lwlib; chmod u+w *.[ch] Makefile README)
515 (cd src; $(MAKE) $(MFLAGS) relock)
516
517 TAGS tags: lib-src
518 cd ${srcdir}/src; $(MAKE) tags
519
520 check:
521 @echo "We don't have any tests for GNU Emacs yet."
522
523 dist:
524 ./update-subdirs ${srcdir}/lisp
525 cd ${srcdir}; make-dist
526
527 .PHONY: info dvi dist check
528 force-info:
529 info: force-info
530 (cd ${srcdir}/man; $(MAKE) $(MFLAGS) info)
531 dvi:
532 (cd ${srcdir}/man; $(MAKE) $(MFLAGS) dvi)