(calculate_scrolling): Add explicit casts, to avoid compiler warnings.
[emacs.git] / Makefile.in
blobc5c0024dbd6672283d093d550bb0a63adc84b4bf
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 # make all to compile and build Emacs.
6 # make install to install it.
7 # make TAGS to update tags tables.
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.
16 # Delete `.dvi' files here if they are not part of the distribution.
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.
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.
31 # make extraclean
32 # Still more severe - delete backup and autosave files, too.
34 SHELL = /bin/sh
36 # If Make doesn't predefine MAKE, set it here.
37 @SET_MAKE@
39 # ==================== Things `configure' Might Edit ====================
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@
51 ### These help us choose version- and architecture-specific directories
52 ### to install files in.
54 ### This should be the number of the Emacs version we're building,
55 ### like `18.59' or `19.0'.
56 version=@version@
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@
62 ### Libraries which should be edited into lib-src/Makefile.
63 libsrc_libs=@libsrc_libs@
65 # ==================== Where To Install Things ====================
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@
73 # Like `prefix', but used for architecture-specific files.
74 exec_prefix=@exec_prefix@
76 # Where to install Emacs and other binaries that people will want to
77 # run directly (like etags).
78 bindir=@bindir@
80 # Where to install architecture-independent data files. ${lispdir}
81 # and ${etcdir} are subdirectories of this.
82 datadir=@datadir@
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@
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@
95 # Where to install Emacs's man pages, and what extension they should have.
96 mandir=@mandir@
97 manext=.1
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@
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@
111 # Tell make where to find source files; this is needed for the makefiles.
112 VPATH=@srcdir@
114 # ==================== Emacs-specific directories ====================
116 # These variables hold the values Emacs will actually use. They are
117 # based on the values of the standard Make variables above.
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@
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@
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@
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
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@
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@
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@
167 # Where to put the docstring file.
168 docdir=@docdir@
170 # ==================== Utility Programs for the Build ====================
172 # Allow the user to specify the install program.
173 INSTALL = @INSTALL@
174 INSTALL_PROGRAM = @INSTALL_PROGRAM@
175 INSTALL_DATA = @INSTALL_DATA@
177 # ============================= Targets ==============================
179 # Subdirectories to make recursively. `lisp' is not included
180 # because the compiled lisp files are part of the distribution
181 # and you cannot remake them without installing Emacs first.
182 SUBDIR = lib-src src
184 # The makefiles of the directories in $SUBDIR.
185 SUBDIR_MAKEFILES = lib-src/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile
187 # Subdirectories to install, and where they'll go.
188 # lib-src's makefile knows how to install it, so we don't do that here.
189 # When installing the info files, we need to do special things to
190 # avoid nuking an existing dir file, so we don't do that here;
191 # instead, we have written out explicit code in the `install' targets.
192 COPYDIR = ${srcdir}/etc ${srcdir}/lisp
193 COPYDESTS = ${etcdir} ${lispdir}
195 all: src/paths.h ${SUBDIR}
197 removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/'
199 # We force the rebuilding of src/paths.h because the user might give
200 # make different values for the various directories. Since we use
201 # move-if-change, src/paths.h only actually changes if the user did
202 # something notable, so the only unnecessary work we do is in building
203 # src/paths.h.tmp, which isn't much.
204 # Note that sed is not in /bin on 386bsd.
205 src/paths.h: Makefile ${srcdir}/src/paths.h.in FRC.src.paths.h
206 @echo "Producing \`src/paths.h' from \`src/paths.h.in'."
207 @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
208 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
209 sed < ${srcdir}/src/paths.h.in > src/paths.h.tmp \
210 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
211 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
212 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
213 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
214 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
215 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \
216 -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";')
217 @${srcdir}/move-if-change src/paths.h.tmp src/paths.h
219 src: lib-src FRC.src
220 lib-src: FRC.lib-src
222 .RECURSIVE: ${SUBDIR}
224 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
225 cd $@; $(MAKE) all $(MFLAGS) \
226 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
227 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
229 Makefile: Makefile.in config.status
230 ./config.status
232 src/Makefile: src/Makefile.in.in config.status
233 ./config.status
235 lib-src/Makefile: lib-src/Makefile.in config.status
236 ./config.status
238 oldXMenu/Makefile: oldXMenu/Makefile.in config.status
239 ./config.status
241 lwlib/Makefile: lwlib/Makefile.in config.status
242 ./config.status
244 # ==================== Installation ====================
246 ## If we let lib-src do its own installation, that means we
247 ## don't have to duplicate the list of utilities to install in
248 ## this Makefile as well.
250 ## On AIX, use tar xBf.
251 ## On Xenix, use tar xpf.
253 .PHONY: install do-install mkdir
255 ## We delete each directory in ${COPYDESTS} before we copy into it;
256 ## that way, we can reinstall over directories that have been put in
257 ## place with their files read-only (perhaps because they are checked
258 ## into RCS). In order to make this safe, we make sure that the
259 ## source exists and is distinct from the destination.
260 ## We don't depend on `all', but rather on ${SUBDIR}, so that we won't
261 ## ever modify src/paths.h.
262 install: ${SUBDIR} do-install install-arch-dep install-arch-indep;
264 ### Note that we copy the DOC-* files from the build etc directory
265 ### as well as lots of things from ${srcdir}/etc.
266 install-arch-dep: mkdir
267 (cd lib-src; \
268 $(MAKE) install $(MFLAGS) prefix=${prefix} \
269 exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
270 archlibdir=${archlibdir})
271 ${INSTALL_PROGRAM} src/emacs ${bindir}/emacs-${version}
272 -chmod 1755 ${bindir}/emacs-${version}
273 rm -f ${bindir}/emacs
274 -ln ${bindir}/emacs-${version} ${bindir}/emacs
276 ### Note that we copy the DOC-* files from the build etc directory
277 ### as well as lots of things from ${srcdir}/etc.
278 install-arch-indep: mkdir
279 -set ${COPYDESTS} ; \
280 for dir in ${COPYDIR} ; do \
281 if [ `(cd $$1 && pwd)` != `(cd $${dir} && pwd)` ] ; then \
282 rm -rf $$1 ; \
283 fi ; \
284 shift ; \
285 done
286 -set ${COPYDESTS} ; \
287 mkdir ${COPYDESTS} ; \
288 for dir in ${COPYDIR} ; do \
289 dest=$$1 ; shift ; \
290 [ -d $${dir} ] \
291 && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
292 && (echo "Copying $${dir}..." ; \
293 (cd $${dir}; tar -cf - . )|(cd $${dest};umask 022; tar -xvf - ); \
294 for subdir in `find $${dest} -type d ! -name RCS -print` ; do \
295 rm -rf $${subdir}/RCS ; \
296 rm -rf $${subdir}/CVS ; \
297 rm -f $${subdir}/\#* ; \
298 rm -f $${subdir}/*~ ; \
299 done) ; \
300 done
301 if [ `(cd ./etc; /bin/pwd)` != `(cd ${docdir}; /bin/pwd)` ]; \
302 then \
303 echo "Copying etc/DOC* ..." ; \
304 (cd etc; tar -cf - DOC*)|(cd ${docdir}; umask 0; tar -xvf - ); \
305 else true; fi
306 thisdir=`pwd`; \
307 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
308 then \
309 (cd ${srcdir}/info ; \
310 if [ ! -f ${infodir}/dir ] && [ -f dir ]; then \
311 (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir); \
312 fi ; \
313 for f in cl* emacs* dired-x* forms* gnus* info* sc* vip* ; do \
314 (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f); \
315 done); \
316 else true; fi
317 thisdir=`pwd`; cd ${srcdir}/etc; for page in emacs etags ctags ; do \
318 (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${mandir}/$${page}${manext}); \
319 done
321 ### Build all the directories we're going to install Emacs in. Since
322 ### we may be creating several layers of directories (for example,
323 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
324 ### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
325 mkdir: FRC.mkdir
326 ./lib-src/make-path ${COPYDESTS} ${lockdir} ${infodir} ${mandir} \
327 ${bindir} ${datadir} ${libdir} \
328 `echo ${locallisppath} | sed 's/:/ /'`
329 -chmod 777 ${lockdir}
331 ### Delete all the installed files that the `install' target would
332 ### create (but not the noninstalled files such as `make all' would
333 ### create).
335 ### Don't delete the lisp and etc directories if they're in the source tree.
336 uninstall:
337 (cd lib-src; \
338 $(MAKE) $(MFLAGS) uninstall \
339 prefix=${prefix} exec_prefix=${exec_prefix} \
340 bindir=${bindir} libdir=${libdir} archlibdir=${archlibdir})
341 for dir in ${lispdir} ${etcdir} ; do \
342 case `(cd $${dir} ; pwd)` in \
343 `(cd ${srcdir} ; pwd)`* ) ;; \
344 * ) rm -rf $${dir} ;; \
345 esac ; \
346 case $${dir} in \
347 ${datadir}/emacs/${version}/* ) \
348 rm -rf ${datadir}/emacs/${version} \
349 ;; \
350 esac ; \
351 done
352 (cd ${infodir}; rm -f cl* emacs* forms* info* vip*)
353 (cd ${mandir}; rm -f emacs.1 etags.1 ctags.1)
354 (cd ${bindir}; rm -f emacs-${version} emacs)
357 ### Some makes seem to remember that they've built something called FRC,
358 ### so you can only use a given FRC once per makefile.
359 FRC FRC.src.paths.h FRC.src FRC.lib-src FRC.mkdir:
360 FRC.mostlyclean FRC.clean FRC.distclean FRC.realclean:
362 # ==================== Cleaning up and miscellanea ====================
364 .PHONY: mostlyclean clean distclean realclean extraclean
366 ### `mostlyclean'
367 ### Like `clean', but may refrain from deleting a few files that people
368 ### normally don't want to recompile. For example, the `mostlyclean'
369 ### target for GCC does not delete `libgcc.a', because recompiling it
370 ### is rarely necessary and takes a lot of time.
371 mostlyclean: FRC.mostlyclean
372 (cd src; $(MAKE) $(MFLAGS) mostlyclean)
373 (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean)
374 (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
375 (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
376 -(cd man; $(MAKE) $(MFLAGS) mostlyclean)
378 ### `clean'
379 ### Delete all files from the current directory that are normally
380 ### created by building the program. Don't delete the files that
381 ### record the configuration. Also preserve files that could be made
382 ### by building, but normally aren't because the distribution comes
383 ### with them.
384 ###
385 ### Delete `.dvi' files here if they are not part of the distribution.
386 clean: FRC.clean
387 (cd src; $(MAKE) $(MFLAGS) clean)
388 (cd oldXMenu; $(MAKE) $(MFLAGS) clean)
389 (cd lwlib; $(MAKE) $(MFLAGS) clean)
390 (cd lib-src; $(MAKE) $(MFLAGS) clean)
391 -(cd man; $(MAKE) $(MFLAGS) clean)
393 ### `distclean'
394 ### Delete all files from the current directory that are created by
395 ### configuring or building the program. If you have unpacked the
396 ### source and built the program without creating any other files,
397 ### `make distclean' should leave only the files that were in the
398 ### distribution.
399 top_distclean=\
400 rm -f config.status build-install ; \
401 rm -f Makefile ${SUBDIR_MAKEFILES} ; \
402 (cd lock ; rm -f *)
403 distclean: FRC.distclean
404 (cd src; $(MAKE) $(MFLAGS) distclean)
405 (cd oldXMenu; $(MAKE) $(MFLAGS) distclean)
406 (cd lwlib; $(MAKE) $(MFLAGS) distclean)
407 (cd lib-src; $(MAKE) $(MFLAGS) distclean)
408 (cd man; $(MAKE) $(MFLAGS) distclean)
409 ${top_distclean}
412 ### `realclean'
413 ### Delete everything from the current directory that can be
414 ### reconstructed with this Makefile. This typically includes
415 ### everything deleted by distclean, plus more: C source files
416 ### produced by Bison, tags tables, info files, and so on.
417 ###
418 ### One exception, however: `make realclean' should not delete
419 ### `configure' even if `configure' can be remade using a rule in the
420 ### Makefile. More generally, `make realclean' should not delete
421 ### anything that needs to exist in order to run `configure' and then
422 ### begin to build the program.
423 realclean: FRC.realclean
424 (cd src; $(MAKE) $(MFLAGS) realclean)
425 (cd oldXMenu; $(MAKE) $(MFLAGS) realclean)
426 (cd lwlib; $(MAKE) $(MFLAGS) realclean)
427 (cd lib-src; $(MAKE) $(MFLAGS) realclean)
428 -(cd man; $(MAKE) $(MFLAGS) realclean)
429 ${top_distclean}
431 ### This doesn't actually appear in the coding standards, but Karl
432 ### says GCC supports it, and that's where the configuration part of
433 ### the coding standards seem to come from. It's like distclean, but
434 ### it deletes backup and autosave files too.
435 extraclean:
436 for i in ${SUBDIR}; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done
437 -(cd lock; rm *)
438 -rm config.status config-tmp-*
439 -rm -f *~ \#*
441 ### Unlocking and relocking. The idea of these productions is to reduce
442 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
443 ### before unlocking the file to take the write locks off all sources so
444 ### that tar xvof will overwrite them without fuss. Then do `make relock'
445 ### afterward so that VC mode will know which files should be checked in
446 ### if you want to mung them.
448 ### Note: it's no disaster if these productions miss a file or two; tar
449 ### and VC will swiftly let you know if this happens, and it is easily
450 ### corrected.
451 SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
452 README build-install.in configure make-dist move-if-change
454 .PHONY: unlock relock
456 unlock:
457 chmod u+w $(SOURCES) cpp/*
458 -(cd elisp; chmod u+w Makefile README *.texi)
459 (cd etc; $(MAKE) $(MFLAGS) unlock)
460 (cd lib-src; $(MAKE) $(MFLAGS) unlock)
461 (cd lisp; $(MAKE) $(MFLAGS) unlock)
462 (cd lisp/term; chmod u+w README *.el)
463 (cd man; chmod u+w *texi* ChangeLog split-man)
464 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
465 (cd lwlib; chmod u+w *.[ch] Makefile README)
466 (cd src; $(MAKE) $(MFLAGS) unlock)
468 relock:
469 chmod u-w $(SOURCES) cpp/*
470 -(cd elisp; chmod u-w Makefile README *.texi)
471 (cd etc; $(MAKE) $(MFLAGS) relock)
472 (cd lib-src; $(MAKE) $(MFLAGS) relock)
473 (cd lisp; $(MAKE) $(MFLAGS) relock)
474 (cd lisp/term; chmod u+w README *.el)
475 (cd man; chmod u+w *texi* ChangeLog split-man)
476 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
477 (cd lwlib; chmod u+w *.[ch] Makefile README)
478 (cd src; $(MAKE) $(MFLAGS) relock)
480 TAGS tags: lib-src
481 (cd ${srcdir}/src; \
482 ../lib-src/etags *.[ch] ../lisp/*.el ../lisp/term/*.el)
484 check:
485 @echo "We don't have any tests for GNU Emacs yet."
487 dist:
488 cd ${srcdir}; make-dist
490 .PHONY: info dvi dist check
491 force-info:
492 info: force-info
493 (cd ${srcdir}/man; $(MAKE) $(MFLAGS) info)
494 dvi:
495 (cd ${srcdir}/man; $(MAKE) $(MFLAGS) dvi)