(apropos-documentation-property): New function.
[emacs.git] / Makefile.in
blob85f2425c81f7a2a3fb1aefa132b06aa0593e22a9
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.
5 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
6 # 2000, 2001, 2002 Free Software Foundation, Inc.
8 # This file is part of GNU Emacs.
10 # GNU Emacs is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2, or (at your option)
13 # any later version.
15 # GNU Emacs is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with GNU Emacs; see the file COPYING. If not, write to
22 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 # Boston, MA 02111-1307, USA.
25 # make all to compile and build Emacs.
26 # make install to install it.
27 # make TAGS to update tags tables.
29 # make clean or make mostlyclean
30 # Delete all files from the current directory that are normally
31 # created by building the program. Don't delete the files that
32 # record the configuration. Also preserve files that could be made
33 # by building, but normally aren't because the distribution comes
34 # with them.
36 # Delete `.dvi' files here if they are not part of the distribution.
38 # make distclean
39 # Delete all files from the current directory that are created by
40 # configuring or building the program. If you have unpacked the
41 # source and built the program without creating any other files,
42 # `make distclean' should leave only the files that were in the
43 # distribution.
45 # make maintainer-clean
46 # Delete everything from the current directory that can be
47 # reconstructed with this Makefile. This typically includes
48 # everything deleted by distclean, plus more: C source files
49 # produced by Bison, tags tables, info files, and so on.
51 # make extraclean
52 # Still more severe - delete backup and autosave files, too.
54 SHELL = /bin/sh
56 # If Make doesn't predefine MAKE, set it here.
57 @SET_MAKE@
59 # ==================== Things `configure' Might Edit ====================
61 CC=@CC@
62 CPP=@CPP@
63 C_SWITCH_SYSTEM=@c_switch_system@
64 ALLOCA=@ALLOCA@
65 LN_S=@LN_S@
66 CFLAGS=@CFLAGS@
67 LDFLAGS=@LDFLAGS@
68 CPPFLAGS=@CPPFLAGS@
69 C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
70 LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@
71 YACC=@YACC@
73 ### These help us choose version- and architecture-specific directories
74 ### to install files in.
76 ### This should be the number of the Emacs version we're building,
77 ### like `18.59' or `19.0'.
78 version=@version@
80 ### This should be the name of the configuration we're building Emacs
81 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
82 configuration=@configuration@
84 # ==================== Where To Install Things ====================
86 # The default location for installation. Everything is placed in
87 # subdirectories of this directory. The default values for many of
88 # the variables below are expressed in terms of this one, so you may
89 # not need to change them. This defaults to /usr/local.
90 prefix=@prefix@
92 # Like `prefix', but used for architecture-specific files.
93 exec_prefix=@exec_prefix@
95 # Where to install Emacs and other binaries that people will want to
96 # run directly (like etags).
97 bindir=@bindir@
99 # Where to install architecture-independent data files. ${lispdir}
100 # and ${etcdir} are subdirectories of this.
101 datadir=@datadir@
103 # Where to install and expect the files that Emacs modifies as it
104 # runs. These files are all architecture-independent.
105 # Right now, this is not used.
106 sharedstatedir=@sharedstatedir@
108 # Where to install and expect executable files to be run by Emacs
109 # rather than directly by users, and other architecture-dependent
110 # data. ${archlibdir} is a subdirectory of this.
111 libexecdir=@libexecdir@
113 # Where to install Emacs's man pages, and what extension they should have.
114 mandir=@mandir@
115 manext=.1
116 man1dir=$(mandir)/man1
118 # Where to install and expect the info files describing Emacs. In the
119 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
120 # since there are now many packages documented with the texinfo
121 # system, it is inappropriate to imply that it is part of Emacs.
122 infodir=@infodir@
124 # Directory for local state files for all programs.
125 localstatedir=@localstatedir@
127 # Where to look for bitmap files.
128 bitmapdir=@bitmapdir@
130 # Where to find the source code. The source code for Emacs's C kernel is
131 # expected to be in ${srcdir}/src, and the source code for Emacs's
132 # utility programs is expected to be in ${srcdir}/lib-src. This is
133 # set by the configure script's `--srcdir' option.
135 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
136 srcdir=@srcdir@
138 # Tell make where to find source files; this is needed for the makefiles.
139 VPATH=@srcdir@
141 # Where to find the application default.
142 x_default_search_path=@x_default_search_path@
144 # Location to install Emacs.app on Mac OS X
145 carbon_appdir=@carbon_appdir@
147 # ==================== Emacs-specific directories ====================
149 # These variables hold the values Emacs will actually use. They are
150 # based on the values of the standard Make variables above.
152 # Where to install the lisp files distributed with
153 # Emacs. This includes the Emacs version, so that the
154 # lisp files for different versions of Emacs will install
155 # themselves in separate directories.
156 lispdir=@lispdir@
158 # Directories Emacs should search for lisp files specific
159 # to this site (i.e. customizations), before consulting
160 # ${lispdir}. This should be a colon-separated list of
161 # directories.
162 locallisppath=@locallisppath@
164 # Where Emacs will search to find its lisp files. Before
165 # changing this, check to see if your purpose wouldn't
166 # better be served by changing locallisppath. This
167 # should be a colon-separated list of directories.
168 lisppath=@lisppath@
170 # Where Emacs will search for its lisp files while
171 # building. This is only used during the process of
172 # compiling Emacs, to help Emacs find its lisp files
173 # before they've been installed in their final location.
174 # It's usually identical to lisppath, except that
175 # it does not include locallisppath, and the
176 # entry for the directory containing the installed lisp
177 # files has been replaced with ../lisp. This should be a
178 # colon-separated list of directories.
179 buildlisppath=${srcdir}/lisp
181 # Where to install the other architecture-independent
182 # data files distributed with Emacs (like the tutorial,
183 # the cookie recipes and the Zippy database). This path
184 # usually contains the Emacs version number, so the data
185 # files for multiple versions of Emacs may be installed
186 # at once.
187 etcdir=@etcdir@
189 # Where to put executables to be run by Emacs rather than
190 # the user. This path usually includes the Emacs version
191 # and configuration name, so that multiple configurations
192 # for multiple versions of Emacs may be installed at
193 # once.
194 archlibdir=@archlibdir@
196 # Where to put the docstring file.
197 docdir=@docdir@
199 # Where to install Emacs game score files.
200 gamedir=@gamedir@
202 # ==================== Utility Programs for the Build ====================
204 # Allow the user to specify the install program.
205 INSTALL = @INSTALL@
206 INSTALL_PROGRAM = @INSTALL_PROGRAM@
207 INSTALL_DATA = @INSTALL_DATA@
208 INSTALL_INFO = @INSTALL_INFO@
209 # By default, we uphold the dignity of our programs.
210 INSTALL_STRIP =
212 # ============================= Targets ==============================
214 # Program name transformation.
215 TRANSFORM = @program_transform_name@
217 # What emacs should be called when installed.
218 EMACS = `echo emacs | sed '$(TRANSFORM)'`
219 EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`
221 # Subdirectories to make recursively. `lisp' is not included
222 # because the compiled lisp files are part of the distribution.
223 # leim is not included because it needs special handling.
224 SUBDIR = lib-src src
226 # The makefiles of the directories in $SUBDIR.
227 SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile lispref/Makefile lispintro/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile
229 # Subdirectories to install, and where they'll go.
230 # lib-src's makefile knows how to install it, so we don't do that here.
231 # leim's makefile also knows how to install it, so we don't do that here.
232 # When installing the info files, we need to do special things to
233 # avoid nuking an existing dir file, so we don't do that here;
234 # instead, we have written out explicit code in the `install' targets.
235 COPYDIR = ${srcdir}/etc ${srcdir}/lisp
236 COPYDESTS = ${etcdir} ${lispdir}
238 # Set to FRC to force running autoconf and autoheader
239 MAINT =
241 all: ${SUBDIR} leim
243 removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g'
245 # Generate epaths.h from epaths.in. This target is invoked by `configure'.
246 epaths-force: FRC
247 @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
248 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
249 x_default_search_path=`echo ${x_default_search_path}`; \
250 gamedir=`echo ${gamedir}`; \
251 sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \
252 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
253 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
254 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
255 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
256 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
257 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
258 -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
259 -e 's;\(#.*PATH_GAME\).*$$;\1 "${gamedir}";' \
260 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \
261 ${srcdir}/move-if-change epaths.h.$$$$ src/epaths.h
263 # For parallel make, src should be build before leim.
264 # "export PARALLEL=0" is for SGI's Make, to prevent it from
265 # running more than 1 process in the leim directory, especially for
266 # the $TIT files there.
267 leim: src ${SUBDIR_MAKEFILES} FRC
268 (export PARALLEL; PARALLEL=0; cd $@; $(MAKE) all $(MFLAGS) \
269 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
270 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}')
272 src: lib-src FRC
274 lib-src: FRC src/config.stamp
276 .RECURSIVE: ${SUBDIR} leim
278 ${SUBDIR}: maybe_bootstrap ${SUBDIR_MAKEFILES} FRC
279 cd $@; $(MAKE) all $(MFLAGS) \
280 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
281 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
283 blessmail: ${SUBDIR_MAKEFILES} src FRC
284 cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \
285 MAKE='${MAKE}' archlibdir='$(archlibdir)'
287 Makefile: $(srcdir)/Makefile.in config.status
288 ./config.status
290 config.status: ${srcdir}/configure
291 ./config.status --recheck
293 ${srcdir}/configure: $(MAINT)
294 cd ${srcdir} && autoconf
296 $(srcdir)/src/config.in: $(srcdir)/src/stamp-h.in
297 @true
298 $(srcdir)/src/stamp-h.in: $(MAINT)
299 cd ${srcdir} && autoheader
300 rm -f $(srcdir)/src/stamp-h.in
301 echo timestamp > $(srcdir)/src/stamp-h.in
303 src/Makefile: $(srcdir)/src/Makefile.in config.status
304 ./config.status
306 src/config.stamp: $(srcdir)/src/config.in config.status
307 ./config.status
308 touch src/config.stamp
310 lib-src/Makefile: $(srcdir)/lib-src/Makefile.in config.status
311 ./config.status
313 man/Makefile: $(srcdir)/man/Makefile.in config.status
314 ./config.status
316 lispref/Makefile: $(srcdir)/lispref/Makefile.in config.status
317 ./config.status
319 lispintro/Makefile: $(srcdir)/lispintro/Makefile.in config.status
320 ./config.status
322 oldXMenu/Makefile: $(srcdir)/oldXMenu/Makefile.in config.status
323 ./config.status
325 lwlib/Makefile: $(srcdir)/lwlib/Makefile.in config.status
326 ./config.status
328 leim/Makefile: $(srcdir)/leim/Makefile.in config.status
329 ./config.status
331 # ==================== Installation ====================
333 ## If we let lib-src do its own installation, that means we
334 ## don't have to duplicate the list of utilities to install in
335 ## this Makefile as well.
337 ## On AIX, use tar xBf.
338 ## On Xenix, use tar xpf.
340 .PHONY: install mkdir
342 ## We delete each directory in ${COPYDESTS} before we copy into it;
343 ## that way, we can reinstall over directories that have been put in
344 ## place with their files read-only (perhaps because they are checked
345 ## into RCS). In order to make this safe, we make sure that the
346 ## source exists and is distinct from the destination.
347 ### We do install-arch-indep first because
348 ### the executable needs the Lisp files and DOC file to work properly.
349 install: all install-arch-indep install-arch-dep install-leim blessmail
350 @true
352 ### Install the executables that were compiled specifically for this machine.
353 ### It would be nice to do something for a parallel make
354 ### to ensure that install-arch-indep finishes before this starts.
355 install-arch-dep: mkdir
356 (cd lib-src; \
357 $(MAKE) install $(MFLAGS) prefix=${prefix} \
358 exec_prefix=${exec_prefix} bindir=${bindir} \
359 libexecdir=${libexecdir} archlibdir=${archlibdir} \
360 INSTALL_STRIP=${INSTALL_STRIP})
361 ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs ${bindir}/$(EMACSFULL)
362 -chmod 1755 ${bindir}/$(EMACSFULL)
363 rm -f ${bindir}/$(EMACS)
364 -ln ${bindir}/$(EMACSFULL) ${bindir}/$(EMACS)
365 -unset CDPATH; \
366 for f in `cd lib-src && echo fns-*.el`; do \
367 if test -r lib-src/$$f ; then \
368 ${INSTALL_DATA} lib-src/$$f ${archlibdir}/$$f; \
369 else true; fi ; \
370 done
371 if test "${carbon_appdir}" != ""; then \
372 umask 022; mkdir -p ${carbon_appdir}/Emacs.app; \
373 (cd mac/Emacs.app; tar -chf - . ) | \
374 (cd ${carbon_appdir}/Emacs.app; umask 022; tar -xvf - \
375 && cat > /dev/null) || exit 1; \
378 ### Install the files that are machine-independent.
379 ### Most of them come straight from the distribution;
380 ### the exception is the DOC-* files, which are copied
381 ## from the build directory.
383 ## Note that we copy DOC* and then delete DOC
384 ## as a workaround for a bug in tar on Ultrix 4.2.
386 ## If people complain about the h flag in tar command, take that out.
387 ## That flag is also used in leim/Makefile.in
388 install-arch-indep: mkdir info
389 -set ${COPYDESTS} ; \
390 unset CDPATH; \
391 for dir in ${COPYDIR} ; do \
392 if [ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \
393 rm -rf $$1 ; \
394 fi ; \
395 shift ; \
396 done
397 -set ${COPYDESTS} ; \
398 mkdir ${COPYDESTS} ; \
399 chmod ugo+rx ${COPYDESTS} ; \
400 unset CDPATH; \
401 for dir in ${COPYDIR} ; do \
402 dest=$$1 ; shift ; \
403 [ -d $${dir} ] \
404 && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
405 && (echo "Copying $${dir} to $${dest}..." ; \
406 (cd $${dir}; tar -chf - . ) \
407 | (cd $${dest}; umask 022; \
408 tar -xvf - && cat > /dev/null) || exit 1; \
409 find $${dest} -exec chown $$LOGNAME {} ';' ;\
410 for subdir in `find $${dest} -type d ! -name RCS ! -name CVS -print` ; do \
411 chmod a+rx $${subdir} ; \
412 rm -rf $${subdir}/RCS ; \
413 rm -rf $${subdir}/CVS ; \
414 rm -f $${subdir}/.cvsignore ; \
415 rm -f $${subdir}/\#* ; \
416 rm -f $${subdir}/.\#* ; \
417 rm -f $${subdir}/*~ ; \
418 rm -f $${subdir}/*.orig ; \
419 rm -f $${subdir}/[mM]akefile* ; \
420 rm -f $${subdir}/ChangeLog* ; \
421 rm -f $${subdir}/dired.todo ; \
422 done) ; \
423 done
424 -rm -f ${lispdir}/subdirs.el
425 $(srcdir)/update-subdirs ${lispdir}
426 if [ -f ${datadir}/emacs/${version}/site-lisp/subdirs.el ]; \
427 then true; \
428 else \
429 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
430 echo " (normal-top-level-add-subdirs-to-load-path))") \
431 > ${datadir}/emacs/${version}/site-lisp/subdirs.el; \
433 chmod a+r ${datadir}/emacs/${version}/site-lisp/subdirs.el
434 -if [ -f ${datadir}/emacs/site-lisp/subdirs.el ]; \
435 then true; \
436 else \
437 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
438 echo " (normal-top-level-add-subdirs-to-load-path))") \
439 > ${datadir}/emacs/site-lisp/subdirs.el; \
441 -chmod a+r ${datadir}/emacs/site-lisp/subdirs.el
442 -unset CDPATH; \
443 if [ `(cd ./etc; /bin/pwd)` != `(cd ${docdir}; /bin/pwd)` ]; \
444 then \
445 echo "Copying etc/DOC-* to ${docdir} ..." ; \
446 (cd ./etc; tar -chf - DOC*) \
447 |(cd ${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
448 (cd $(docdir); chown $${LOGNAME} DOC*; chmod a+r DOC*; \
449 if test "`echo DOC-*`" != "DOC-*"; then rm DOC; fi); \
450 else true; fi
451 -unset CDPATH; \
452 if [ -r ./lisp ] \
453 && [ -r ./lisp/simple.el ] \
454 && [ x`(cd ./lisp; /bin/pwd)` != x`(cd ${lispdir}; /bin/pwd)` ] \
455 && [ x`(cd ${srcdir}/lisp; /bin/pwd)` != x`(cd ./lisp; /bin/pwd)` ]; \
456 then \
457 echo "Copying lisp/*.el and lisp/*.elc to ${lispdir} ..." ; \
458 (cd lisp; tar -chf - *.el *.elc) \
459 |(cd ${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
460 (cd ${lispdir}; find . -exec chown $${LOGNAME} {} ';') ; \
461 else true; fi
462 -unset CDPATH; \
463 thisdir=`/bin/pwd`; \
464 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
465 then \
466 (cd ${infodir}; \
467 if [ -f dir ]; then true; \
468 else \
469 (cd $${thisdir}; \
470 ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir; \
471 chmod a+r ${infodir}/dir); \
472 fi; \
473 cd ${srcdir}/info ; \
474 for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* eshell* eudc* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* reftex* sc* speedbar* tramp* vip* widget* woman*; do \
475 (cd $${thisdir}; \
476 ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
477 chmod a+r ${infodir}/$$f); \
478 done); \
479 else true; fi
480 -unset CDPATH; \
481 thisdir=`/bin/pwd`; \
482 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
483 then \
484 for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime eshell eudc forms gnus idlwave info message mh-e pcl-cvs reftex sc speedbar tramp vip viper widget woman; do \
485 (cd $${thisdir}; \
486 ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \
487 done; \
488 else true; fi
489 -chmod -R a+r ${datadir}/emacs ${COPYDESTS} ${infodir}
490 thisdir=`/bin/pwd`; \
491 cd ${srcdir}/etc; \
492 for page in emacs emacsclient etags ctags ; do \
493 (cd $${thisdir}; \
494 ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${man1dir}/$${page}${manext}; \
495 chmod a+r ${man1dir}/$${page}${manext}); \
496 done
498 ### Install LEIM files. Although they are machine-independent, we
499 ### have separate target here instead of including it in
500 ### `install-arch-indep'. People who extracted LEIM files after they
501 ### insalled Emacs itself can install only LEIM files by this target.
502 install-leim: leim/Makefile mkdir
503 cd leim; $(MAKE) install
505 ### Build Emacs and install it, stripping binaries while installing them.
506 install-strip:
507 $(MAKE) INSTALL_STRIP=-s install
509 ### Build all the directories we're going to install Emacs in. Since
510 ### we may be creating several layers of directories (for example,
511 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use mkinstalldirs
512 ### instead of mkdir. Not all systems' mkdir programs have the `-p' flag.
513 mkdir: FRC
514 if [ -d ${datadir} ]; then true; else \
515 $(srcdir)/mkinstalldirs ${datadir}; \
516 chmod a+r ${datadir};\
518 $(srcdir)/mkinstalldirs ${COPYDESTS} ${infodir} ${man1dir} \
519 ${bindir} ${docdir} ${libexecdir} \
520 ${datadir}/emacs/site-lisp \
521 ${datadir}/emacs/${version}/site-lisp \
522 `echo ${locallisppath} | sed 's/:/ /g'`
524 ### Delete all the installed files that the `install' target would
525 ### create (but not the noninstalled files such as `make all' would
526 ### create).
528 ### Don't delete the lisp and etc directories if they're in the source tree.
529 uninstall:
530 (cd lib-src; \
531 $(MAKE) $(MFLAGS) uninstall \
532 prefix=${prefix} exec_prefix=${exec_prefix} \
533 bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir})
534 -unset CDPATH; \
535 for dir in ${lispdir} ${etcdir} ; do \
536 if [ -d $${dir} ]; then \
537 case `(cd $${dir} ; /bin/pwd)` in \
538 `(cd ${srcdir} ; /bin/pwd)`* ) ;; \
539 * ) rm -rf $${dir} ;; \
540 esac ; \
541 case $${dir} in \
542 ${datadir}/emacs/${version}/* ) \
543 rm -rf ${datadir}/emacs/${version} \
544 ;; \
545 esac ; \
546 fi ; \
547 done
548 (cd ${archlibdir} && rm -f fns-*)
549 -rm -rf ${libexecdir}/emacs/${version}
550 (cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* vip*)
551 (cd ${man1dir} && rm -f emacs${manext} emacsclient${manext} etags${manext} ctags${manext})
552 (cd ${bindir} && rm -f $(EMACSFULL) $(EMACS))
555 FRC:
557 # ==================== Cleaning up and miscellanea ====================
559 .PHONY: mostlyclean clean distclean maintainer-clean extraclean
561 ### `mostlyclean'
562 ### Like `clean', but may refrain from deleting a few files that people
563 ### normally don't want to recompile. For example, the `mostlyclean'
564 ### target for GCC does not delete `libgcc.a', because recompiling it
565 ### is rarely necessary and takes a lot of time.
566 mostlyclean: FRC
567 (cd src; $(MAKE) $(MFLAGS) mostlyclean)
568 (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean)
569 (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
570 (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
571 -(cd man && $(MAKE) $(MFLAGS) mostlyclean)
572 -(cd lispref && $(MAKE) $(MFLAGS) mostlyclean)
573 -(cd lispintro && $(MAKE) $(MFLAGS) mostlyclean)
574 (cd leim; $(MAKE) $(MFLAGS) mostlyclean)
576 ### `clean'
577 ### Delete all files from the current directory that are normally
578 ### created by building the program. Don't delete the files that
579 ### record the configuration. Also preserve files that could be made
580 ### by building, but normally aren't because the distribution comes
581 ### with them.
582 ###
583 ### Delete `.dvi' files here if they are not part of the distribution.
584 clean: FRC
585 (cd src; $(MAKE) $(MFLAGS) clean)
586 (cd oldXMenu; $(MAKE) $(MFLAGS) clean)
587 (cd lwlib; $(MAKE) $(MFLAGS) clean)
588 (cd lib-src; $(MAKE) $(MFLAGS) clean)
589 -(cd man && $(MAKE) $(MFLAGS) clean)
590 -(cd lispref && $(MAKE) $(MFLAGS) clean)
591 -(cd lispintro && $(MAKE) $(MFLAGS) clean)
592 (cd leim; $(MAKE) $(MFLAGS) clean)
594 ### `distclean'
595 ### Delete all files from the current directory that are created by
596 ### configuring or building the program. If you have unpacked the
597 ### source and built the program without creating any other files,
598 ### `make distclean' should leave only the files that were in the
599 ### distribution.
600 top_distclean=\
601 rm -f config.status config.cache config.log ; \
602 rm -f Makefile ${SUBDIR_MAKEFILES} ; \
603 if [ -d lock ] ; then (cd lock && (rm -f * || true)); else true; fi
604 distclean: FRC
605 (cd src; $(MAKE) $(MFLAGS) distclean)
606 (cd oldXMenu; $(MAKE) $(MFLAGS) distclean)
607 (cd lwlib; $(MAKE) $(MFLAGS) distclean)
608 (cd lib-src; $(MAKE) $(MFLAGS) distclean)
609 (cd man && $(MAKE) $(MFLAGS) distclean)
610 (cd lispref && $(MAKE) $(MFLAGS) distclean)
611 (cd lispintro && $(MAKE) $(MFLAGS) distclean)
612 (cd leim; $(MAKE) $(MFLAGS) distclean)
613 (cd lisp; $(MAKE) $(MFLAGS) distclean)
614 ${top_distclean}
616 ### `maintainer-clean'
617 ### Delete everything from the current directory that can be
618 ### reconstructed with this Makefile. This typically includes
619 ### everything deleted by distclean, plus more: C source files
620 ### produced by Bison, tags tables, info files, and so on.
621 ###
622 ### One exception, however: `make maintainer-clean' should not delete
623 ### `configure' even if `configure' can be remade using a rule in the
624 ### Makefile. More generally, `make maintainer-clean' should not delete
625 ### anything that needs to exist in order to run `configure' and then
626 ### begin to build the program.
627 maintainer-clean: FRC
628 (cd src; $(MAKE) $(MFLAGS) maintainer-clean)
629 (cd oldXMenu; $(MAKE) $(MFLAGS) maintainer-clean)
630 (cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean)
631 (cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean)
632 -(cd man && $(MAKE) $(MFLAGS) maintainer-clean)
633 -(cd lispref && $(MAKE) $(MFLAGS) maintainer-clean)
634 -(cd lispintro && $(MAKE) $(MFLAGS) maintainer-clean)
635 (cd leim; $(MAKE) $(MFLAGS) maintainer-clean)
636 ${top_distclean}
638 ### This doesn't actually appear in the coding standards, but Karl
639 ### says GCC supports it, and that's where the configuration part of
640 ### the coding standards seem to come from. It's like distclean, but
641 ### it deletes backup and autosave files too.
642 extraclean:
643 for i in ${SUBDIR} leim; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done
644 ${top_distclean}
645 -rm -f config-tmp-*
646 -rm -f *~ \#*
648 ### Unlocking and relocking. The idea of these productions is to reduce
649 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
650 ### before unlocking the file to take the write locks off all sources so
651 ### that tar xvof will overwrite them without fuss. Then do `make relock'
652 ### afterward so that VC mode will know which files should be checked in
653 ### if you want to mung them.
655 ### Note: it's no disaster if these productions miss a file or two; tar
656 ### and VC will swiftly let you know if this happens, and it is easily
657 ### corrected.
658 SOURCES = ChangeLog FTP INSTALL Makefile.in \
659 README configure make-dist move-if-change
661 .PHONY: unlock relock
663 unlock:
664 chmod u+w $(SOURCES)
665 -(cd elisp; chmod u+w Makefile README *.texi)
666 (cd etc; $(MAKE) $(MFLAGS) unlock)
667 (cd lib-src; $(MAKE) $(MFLAGS) unlock)
668 (cd lisp; $(MAKE) $(MFLAGS) unlock)
669 (cd lisp/term; chmod u+w README *.el)
670 (cd man; chmod u+w *texi* ChangeLog split-man)
671 (cd lispref; chmod u+w *texi* ChangeLog)
672 (cd lispintro; chmod u+w *texi* ChangeLog)
673 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
674 (cd lwlib; chmod u+w *.[ch] Makefile README)
675 (cd src; $(MAKE) $(MFLAGS) unlock)
677 relock:
678 chmod u-w $(SOURCES)
679 -(cd elisp; chmod u-w Makefile README *.texi)
680 (cd etc; $(MAKE) $(MFLAGS) relock)
681 (cd lib-src; $(MAKE) $(MFLAGS) relock)
682 (cd lisp; $(MAKE) $(MFLAGS) relock)
683 (cd lisp/term; chmod u+w README *.el)
684 (cd man; chmod u+w *texi* ChangeLog split-man)
685 (cd lispref; chmod u+w *texi* ChangeLog)
686 (cd lispintro; chmod u+w *texi* ChangeLog)
687 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
688 (cd lwlib; chmod u+w *.[ch] Makefile README)
689 (cd src; $(MAKE) $(MFLAGS) relock)
691 # The src subdir knows how to do the right thing
692 # even when the build directory and source dir are different.
693 TAGS tags: lib-src src
694 cd src; $(MAKE) tags
696 check:
697 @echo "We don't have any tests for GNU Emacs yet."
699 dist:
700 cd ${srcdir}; ./make-dist
702 .PHONY: info dvi dist check html
703 force-info:
704 # Note that man/Makefile knows how to
705 # put the info files in $(srcdir),
706 # so we can do ok running make in the build dir.
707 info: force-info
708 (cd man; $(MAKE) $(MFLAGS) info)
709 (cd lispref; $(MAKE) $(MFLAGS) info)
710 (cd lispintro; $(MAKE) $(MFLAGS) info)
711 dvi:
712 (cd man; $(MAKE) $(MFLAGS) dvi)
713 (cd lispref; $(MAKE) $(MFLAGS) elisp.dvi)
714 (cd lispintro; $(MAKE) $(MFLAGS) emacs-lisp-intro.dvi)
716 #### Bootstrapping.
718 ### This is meant for Emacs maintainers only. It first cleans the
719 ### lisp subdirectory, removing all compiled Lisp files. Then a
720 ### special emacs executable is built from Lisp sources, which is then
721 ### used to compile Lisp files. The last step is a "normal" make.
723 .PHONY: bootstrap
724 .PHONY: maybe_bootstrap
726 maybe_bootstrap:
727 @bar="`echo $(srcdir)/lisp/*.elc`"; \
728 if [ \( "$$bar" = '$(srcdir)/lisp/*.elc' \) -o \( "$$bar" = '' \) ]; then \
729 echo "Your tree does not include the compiled Lisp files."; \
730 echo "You need to do \`make bootstrap' to build Emacs."; \
731 echo "Emacs now requires Texinfo version 4.2."; \
732 exit 1;\
735 bootstrap: bootstrap-clean-before info FRC
736 (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean)
737 (cd src; $(MAKE) $(MFLAGS) bootstrap)
738 (cd lisp; $(MAKE) $(MFLAGS) bootstrap EMACS=../src/bootstrap-emacs)
739 (cd src; $(MAKE) $(MFLAGS) mostlyclean)
740 $(MAKE) $(MFLAGS) all
742 ### Used for `bootstrap' to avoid deleting existing dumped Emacs executables.
743 bootstrap-clean-before: FRC
744 (cd src; $(MAKE) $(MFLAGS) mostlyclean)
745 (cd oldXMenu; $(MAKE) $(MFLAGS) clean)
746 (cd lwlib; $(MAKE) $(MFLAGS) clean)
747 (cd lib-src; $(MAKE) $(MFLAGS) clean)
748 -(cd man && $(MAKE) $(MFLAGS) clean)
749 -(cd lispref && $(MAKE) $(MFLAGS) clean)
750 -(cd lispintro && $(MAKE) $(MFLAGS) clean)
751 (cd leim; $(MAKE) $(MFLAGS) clean)