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