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