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
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
16 # Delete `.dvi' files here if they are not part of the distribution.
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
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.
32 # Still more severe - delete backup and autosave files, too.
36 # If Make doesn't predefine MAKE, set it here.
39 # ==================== Things `configure' Might Edit ====================
43 C_SWITCH_SYSTEM
=@c_switch_system@
49 C_SWITCH_X_SITE
=@C_SWITCH_X_SITE@
50 LD_SWITCH_X_SITE
=@LD_SWITCH_X_SITE@
53 ### These help us choose version- and architecture-specific directories
54 ### to install files in.
56 ### This should be the number of the Emacs version we're building,
57 ### like `18.59' or `19.0'.
60 ### This should be the name of the configuration we're building Emacs
61 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
62 configuration
=@configuration@
64 # ==================== Where To Install Things ====================
66 # The default location for installation. Everything is placed in
67 # subdirectories of this directory. The default values for many of
68 # the variables below are expressed in terms of this one, so you may
69 # not need to change them. This defaults to /usr/local.
72 # Like `prefix', but used for architecture-specific files.
73 exec_prefix=@
exec_prefix@
75 # Where to install Emacs and other binaries that people will want to
76 # run directly (like etags).
79 # Where to install architecture-independent data files. ${lispdir}
80 # and ${etcdir} are subdirectories of this.
83 # Where to install and expect the files that Emacs modifies as it
84 # runs. These files are all architecture-independent.
85 # Right now, this is not used.
86 sharedstatedir
=@sharedstatedir@
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 libexecdir
=@libexecdir@
93 # Where to install Emacs's man pages, and what extension they should have.
96 man1dir=$(mandir)/man1
98 # Where to install and expect the info files describing Emacs. In the
99 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
100 # since there are now many packages documented with the texinfo
101 # system, it is inappropriate to imply that it is part of Emacs.
104 # Where to look for bitmap files.
105 bitmapdir
=@bitmapdir@
107 # Where to find the source code. The source code for Emacs's C kernel is
108 # expected to be in ${srcdir}/src, and the source code for Emacs's
109 # utility programs is expected to be in ${srcdir}/lib-src. This is
110 # set by the configure script's `--srcdir' option.
113 # Tell make where to find source files; this is needed for the makefiles.
116 # Where to find the application default.
117 x_default_search_path
=@x_default_search_path@
119 # ==================== Emacs-specific directories ====================
121 # These variables hold the values Emacs will actually use. They are
122 # based on the values of the standard Make variables above.
124 # Where to install the lisp files distributed with
125 # Emacs. This includes the Emacs version, so that the
126 # lisp files for different versions of Emacs will install
127 # themselves in separate directories.
130 # Directories Emacs should search for lisp files specific
131 # to this site (i.e. customizations), before consulting
132 # ${lispdir}. This should be a colon-separated list of
134 locallisppath
=@locallisppath@
136 # Where Emacs will search to find its lisp files. Before
137 # changing this, check to see if your purpose wouldn't
138 # better be served by changing locallisppath. This
139 # should be a colon-separated list of directories.
142 # Where Emacs will search for its lisp files while
143 # building. This is only used during the process of
144 # compiling Emacs, to help Emacs find its lisp files
145 # before they've been installed in their final location.
146 # It's usually identical to lisppath, except that
147 # it does not include locallisppath, and the
148 # entry for the directory containing the installed lisp
149 # files has been replaced with ../lisp. This should be a
150 # colon-separated list of directories.
151 buildlisppath
=${srcdir}/lisp
153 # Where to install the other architecture-independent
154 # data files distributed with Emacs (like the tutorial,
155 # the cookie recipes and the Zippy database). This path
156 # usually contains the Emacs version number, so the data
157 # files for multiple versions of Emacs may be installed
161 # Where to put executables to be run by Emacs rather than
162 # the user. This path usually includes the Emacs version
163 # and configuration name, so that multiple configurations
164 # for multiple versions of Emacs may be installed at
166 archlibdir
=@archlibdir@
168 # Where to put the docstring file.
171 # ==================== Utility Programs for the Build ====================
173 # Allow the user to specify the install program.
175 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
176 INSTALL_DATA
= @INSTALL_DATA@
177 # By default, we uphold the dignity of our programs.
180 # ============================= Targets ==============================
182 # What emacs should be called when installed.
185 # Subdirectories to make recursively. `lisp' is not included
186 # because the compiled lisp files are part of the distribution
187 # and you cannot remake them without installing Emacs first.
188 SUBDIR
= lib-src src leim
190 # The makefiles of the directories in $SUBDIR.
191 SUBDIR_MAKEFILES
= lib-src
/Makefile man
/Makefile src
/Makefile oldXMenu
/Makefile lwlib
/Makefile leim
/Makefile
193 # Subdirectories to install, and where they'll go.
194 # lib-src's makefile knows how to install it, so we don't do that here.
195 # leim's makefile also knows how to install it, so we don't do that here.
196 # When installing the info files, we need to do special things to
197 # avoid nuking an existing dir file, so we don't do that here;
198 # instead, we have written out explicit code in the `install' targets.
199 COPYDIR
= ${srcdir}/etc
${srcdir}/lisp
200 COPYDESTS
= ${etcdir} ${lispdir}
204 removenullpaths
=sed
-e
's/^://g' -e
's/:$$//g' -e
's/::/:/g'
206 # Generate paths.h from paths.in. This target is invoked by `configure'.
208 @
(lisppath
=`echo ${lisppath} | ${removenullpaths}` ; \
209 buildlisppath
=`echo ${buildlisppath} | ${removenullpaths}` ; \
210 x_default_search_path
=`echo ${x_default_search_path}`; \
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_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
219 -e
's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \
220 ${srcdir}/move-if-change paths.h.
$$$$ src
/paths.h
222 # For parallel make, src should be build before leim.
227 lib-src
: FRC src
/config.stamp
229 .RECURSIVE
: ${SUBDIR}
231 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
232 cd
$@
; $(MAKE
) all $(MFLAGS
) \
233 CC
='${CC}' CFLAGS
='${CFLAGS}' CPPFLAGS
='${CPPFLAGS}' \
234 LDFLAGS
='${LDFLAGS}' MAKE
='${MAKE}'
236 blessmail
: ${SUBDIR_MAKEFILES} src FRC
237 cd lib-src
; $(MAKE
) maybe-blessmail
$(MFLAGS
) \
238 MAKE
='${MAKE}' archlibdir
='$(archlibdir)'
240 Makefile
: Makefile.in config.status
243 src
/Makefile
: src
/Makefile.in config.status
246 src
/config.stamp
: src
/config.in config.status
248 touch src
/config.stamp
250 lib-src
/Makefile
: lib-src
/Makefile.in config.status
253 man
/Makefile
: man
/Makefile.in config.status
256 oldXMenu
/Makefile
: oldXMenu
/Makefile.in config.status
259 lwlib
/Makefile
: lwlib
/Makefile.in config.status
262 leim
/Makefile
: leim
/Makefile.in config.status
265 # ==================== Installation ====================
267 ## If we let lib-src do its own installation, that means we
268 ## don't have to duplicate the list of utilities to install in
269 ## this Makefile as well.
271 ## On AIX, use tar xBf.
272 ## On Xenix, use tar xpf.
274 .PHONY
: install mkdir
276 ## We delete each directory in ${COPYDESTS} before we copy into it;
277 ## that way, we can reinstall over directories that have been put in
278 ## place with their files read-only (perhaps because they are checked
279 ## into RCS). In order to make this safe, we make sure that the
280 ## source exists and is distinct from the destination.
281 ### We do install-arch-indep first because
282 ### the executable needs the Lisp files and DOC file to work properly.
283 install: all install-arch-indep install-arch-dep install-leim blessmail
286 ### Install the executables that were compiled specifically for this machine.
287 ### It would be nice to do something for a parallel make
288 ### to ensure that install-arch-indep finishes before this starts.
289 install-arch-dep
: mkdir
291 $(MAKE
) install $(MFLAGS
) prefix=${prefix} \
292 exec_prefix=${exec_prefix} bindir=${bindir} \
293 libexecdir
=${libexecdir} archlibdir
=${archlibdir} \
294 INSTALL_STRIP
=${INSTALL_STRIP})
295 ${INSTALL_PROGRAM} $(INSTALL_STRIP
) src
/emacs
${bindir}/emacs-
${version}
296 -chmod
1755 ${bindir}/emacs-
${version}
297 rm -f
${bindir}/$(EMACS
)
298 -ln
${bindir}/emacs-
${version} ${bindir}/$(EMACS
)
300 ### Install the files that are machine-independent.
301 ### Most of them come straight from the distribution;
302 ### the exception is the DOC-* files, which are copied
303 ## from the build directory.
305 ## Note that we copy DOC* and then delete DOC
306 ## as a workaround for a bug in tar on Ultrix 4.2.
307 install-arch-indep
: mkdir
308 -set
${COPYDESTS} ; \
309 for
dir in
${COPYDIR} ; do \
310 if
[ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \
315 -set
${COPYDESTS} ; \
316 mkdir
${COPYDESTS} ; \
317 chmod ugo
+rx
${COPYDESTS} ; \
318 for
dir in
${COPYDIR} ; do \
321 && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
322 && (echo
"Copying $${dir} to $${dest}..." ; \
323 (cd
$${dir}; tar -cf
- .
) \
324 |
(cd
$${dest};umask
022; tar -xvf
- && cat
> /dev
/null
); \
325 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
326 rm -rf
$${subdir}/RCS
; \
327 rm -rf
$${subdir}/CVS
; \
328 rm -f
$${subdir}/\
#* ; \
329 rm -f
$${subdir}/.\
#* ; \
330 rm -f
$${subdir}/*~
; \
331 rm -f
$${subdir}/*.orig
; \
332 rm -f
$${subdir}/[mM
]akefile
* ; \
333 rm -f
$${subdir}/ChangeLog
* ; \
334 rm -f
$${subdir}/dired.todo
; \
337 -rm -f
${lispdir}/subdirs.el
338 $(srcdir)/update-subdirs
${lispdir}
339 -chmod
-R a
+r
${COPYDESTS}
340 if
[ `(cd ./etc; /bin/pwd)` != `(cd ${docdir}; /bin/pwd)` ]; \
342 echo
"Copying etc/DOC-* to ${docdir} ..." ; \
343 (cd .
/etc
; tar -cf
- DOC
*) \
344 |
(cd
${docdir}; umask
0; tar -xvf
- && cat
> /dev
/null
); \
345 (cd
$(docdir
); chmod a
+r DOC
*; rm DOC
) \
348 && [ -r .
/lisp
/simple.el
] \
349 && [ x
`(cd ./lisp; /bin/pwd)` != x
`(cd ${lispdir}; /bin/pwd)` ] \
350 && [ x
`(cd ${srcdir}/lisp; /bin/pwd)` != x
`(cd ./lisp; /bin/pwd)` ]; \
352 echo
"Copying lisp/*.el and lisp/*.elc to ${lispdir} ..." ; \
353 (cd lisp
; tar -cf
- *.el
*.elc
) \
354 |
(cd
${lispdir}; umask
0; tar -xvf
- && cat
> /dev
/null
); \
356 thisdir
=`/bin/pwd`; \
357 if
[ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
360 if
[ -f
dir ]; then \
361 if
[ ! -f
dir.old
]; then mv
-f
dir dir.old
; \
362 else mv
-f
dir dir.bak
; fi
; \
364 cd
${srcdir}/info ; \
365 (cd
$${thisdir}; ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir); \
366 (cd
$${thisdir}; chmod a
+r
${infodir}/dir); \
367 for f in ccmode
* cl
* dired-x
* ediff
* emacs
* forms
* gnus
* info* message
* mh-e
* sc
* vip
* widget
*; do \
369 ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
370 chmod a
+r
${infodir}/$$f); \
373 thisdir
=`/bin/pwd`; \
375 for page in emacs etags ctags
; do \
377 ${INSTALL_DATA} ${srcdir}/etc
/$${page}.1 ${man1dir}/$${page}${manext}; \
378 chmod a
+r
${man1dir}/$${page}${manext}); \
381 ### Install LEIM files. Although they are machine-independent, we
382 ### have separate target here instead of including it in
383 ### `install-arch-indep'. People who extracted LEIM files after they
384 ### insalled Emacs itself can install only LEIM files by this target.
385 install-leim
: leim
/Makefile mkdir
386 cd leim
; $(MAKE
) install
388 ### Build Emacs and install it, stripping binaries while installing them.
390 $(MAKE
) INSTALL_STRIP
=-s
392 ### Build all the directories we're going to install Emacs in. Since
393 ### we may be creating several layers of directories (for example,
394 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use mkinstalldirs
395 ### instead of mkdir. Not all systems' mkdir programs have the `-p' flag.
397 $(srcdir)/mkinstalldirs
${COPYDESTS} ${infodir} ${man1dir} \
398 ${bindir} ${datadir} ${docdir} ${libexecdir} \
399 `echo ${locallisppath} | sed 's/:/ /g'`
401 ### Delete all the installed files that the `install' target would
402 ### create (but not the noninstalled files such as `make all' would
405 ### Don't delete the lisp and etc directories if they're in the source tree.
408 $(MAKE
) $(MFLAGS
) uninstall \
409 prefix=${prefix} exec_prefix=${exec_prefix} \
410 bindir=${bindir} libexecdir
=${libexecdir} archlibdir
=${archlibdir})
411 for
dir in
${lispdir} ${etcdir} ; do \
412 if
[ -d
$${dir} ]; then \
413 case
`(cd $${dir} ; /bin/pwd)` in \
414 `(cd ${srcdir} ; /bin/pwd)`* ) ;; \
415 * ) rm -rf
$${dir} ;; \
418 ${datadir}/emacs
/${version}/* ) \
419 rm -rf
${datadir}/emacs
/${version} \
424 (cd
${infodir} && rm -f cl
* dired-x
* ediff
* emacs
* forms
* gnus
* info* mh-e
* sc
* vip
*)
425 (cd
${man1dir} && rm -f emacs
.1 etags
.1 ctags
.1)
426 (cd
${bindir} && rm -f emacs-
${version} $(EMACS
))
431 # ==================== Cleaning up and miscellanea ====================
433 .PHONY
: mostlyclean clean distclean maintainer-clean extraclean
436 ### Like `clean', but may refrain from deleting a few files that people
437 ### normally don't want to recompile. For example, the `mostlyclean'
438 ### target for GCC does not delete `libgcc.a', because recompiling it
439 ### is rarely necessary and takes a lot of time.
441 (cd src
; $(MAKE
) $(MFLAGS
) mostlyclean)
442 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) mostlyclean)
443 (cd lwlib
; $(MAKE
) $(MFLAGS
) mostlyclean)
444 (cd lib-src
; $(MAKE
) $(MFLAGS
) mostlyclean)
445 -(cd man
&& $(MAKE
) $(MFLAGS
) mostlyclean)
446 (cd leim
; $(MAKE
) $(MFLAGS
) mostlyclean)
449 ### Delete all files from the current directory that are normally
450 ### created by building the program. Don't delete the files that
451 ### record the configuration. Also preserve files that could be made
452 ### by building, but normally aren't because the distribution comes
455 ### Delete `.dvi' files here if they are not part of the distribution.
457 (cd src
; $(MAKE
) $(MFLAGS
) clean)
458 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) clean)
459 (cd lwlib
; $(MAKE
) $(MFLAGS
) clean)
460 (cd lib-src
; $(MAKE
) $(MFLAGS
) clean)
461 -(cd man
&& $(MAKE
) $(MFLAGS
) clean)
462 (cd leim
; $(MAKE
) $(MFLAGS
) clean)
465 ### Delete all files from the current directory that are created by
466 ### configuring or building the program. If you have unpacked the
467 ### source and built the program without creating any other files,
468 ### `make distclean' should leave only the files that were in the
471 rm -f config.status config.cache config.log
; \
472 rm -f Makefile
${SUBDIR_MAKEFILES} ; \
473 (cd lock
&& (rm -f
* || true
))
475 (cd src
; $(MAKE
) $(MFLAGS
) distclean)
476 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) distclean)
477 (cd lwlib
; $(MAKE
) $(MFLAGS
) distclean)
478 (cd lib-src
; $(MAKE
) $(MFLAGS
) distclean)
479 (cd man
&& $(MAKE
) $(MFLAGS
) distclean)
480 (cd leim
; $(MAKE
) $(MFLAGS
) distclean)
483 ### `maintainer-clean'
484 ### Delete everything from the current directory that can be
485 ### reconstructed with this Makefile. This typically includes
486 ### everything deleted by distclean, plus more: C source files
487 ### produced by Bison, tags tables, info files, and so on.
489 ### One exception, however: `make maintainer-clean' should not delete
490 ### `configure' even if `configure' can be remade using a rule in the
491 ### Makefile. More generally, `make maintainer-clean' should not delete
492 ### anything that needs to exist in order to run `configure' and then
493 ### begin to build the program.
494 maintainer-clean
: FRC
495 (cd src
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
496 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
497 (cd lwlib
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
498 (cd lib-src
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
499 -(cd man
&& $(MAKE
) $(MFLAGS
) maintainer-clean
)
500 (cd leim
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
503 ### This doesn't actually appear in the coding standards, but Karl
504 ### says GCC supports it, and that's where the configuration part of
505 ### the coding standards seem to come from. It's like distclean, but
506 ### it deletes backup and autosave files too.
508 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) $(MFLAGS
) extraclean
); done
513 ### Unlocking and relocking. The idea of these productions is to reduce
514 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
515 ### before unlocking the file to take the write locks off all sources so
516 ### that tar xvof will overwrite them without fuss. Then do `make relock'
517 ### afterward so that VC mode will know which files should be checked in
518 ### if you want to mung them.
520 ### Note: it's no disaster if these productions miss a file or two; tar
521 ### and VC will swiftly let you know if this happens, and it is easily
523 SOURCES
= ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
524 README configure make-dist move-if-change
526 .PHONY
: unlock relock
529 chmod u
+w
$(SOURCES
) cpp/*
530 -(cd elisp
; chmod u
+w Makefile README
*.texi
)
531 (cd etc
; $(MAKE
) $(MFLAGS
) unlock
)
532 (cd lib-src
; $(MAKE
) $(MFLAGS
) unlock
)
533 (cd lisp
; $(MAKE
) $(MFLAGS
) unlock
)
534 (cd lisp
/term
; chmod u
+w README
*.el
)
535 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
536 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
537 (cd lwlib
; chmod u
+w
*.
[ch
] Makefile README
)
538 (cd src
; $(MAKE
) $(MFLAGS
) unlock
)
541 chmod u-w
$(SOURCES
) cpp/*
542 -(cd elisp
; chmod u-w Makefile README
*.texi
)
543 (cd etc
; $(MAKE
) $(MFLAGS
) relock
)
544 (cd lib-src
; $(MAKE
) $(MFLAGS
) relock
)
545 (cd lisp
; $(MAKE
) $(MFLAGS
) relock
)
546 (cd lisp
/term
; chmod u
+w README
*.el
)
547 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
548 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
549 (cd lwlib
; chmod u
+w
*.
[ch
] Makefile README
)
550 (cd src
; $(MAKE
) $(MFLAGS
) relock
)
552 TAGS
tags: lib-src src
553 # The src subdir knows how to do the right thing
554 # even when the build directory and source dir are different.
558 @echo
"We don't have any tests for GNU Emacs yet."
561 cd
${srcdir}; make-dist
563 .PHONY
: info dvi dist check
566 (cd
${srcdir}/man
; $(MAKE
) $(MFLAGS
) info)
568 (cd man
; $(MAKE
) $(MFLAGS
) dvi)