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