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