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 install.sysv to install on system V. Note that on system V you
8 # must change mandir to /usr/local/man/man1.
9 # make install.xenix to install on Xenix.
10 # make install.aix to install on AIX.
11 # make TAGS to update tags tables.
13 # make clean or make mostlyclean
14 # Delete all files from the current directory that are normally
15 # created by building the program. Don't delete the files that
16 # record the configuration. Also preserve files that could be made
17 # by building, but normally aren't because the distribution comes
20 # Delete `.dvi' files here if they are not part of the distribution.
23 # Delete all files from the current directory that are created by
24 # configuring or building the program. If you have unpacked the
25 # source and built the program without creating any other files,
26 # `make distclean' should leave only the files that were in the
30 # Delete everything from the current directory that can be
31 # reconstructed with this Makefile. This typically includes
32 # everything deleted by distclean, plus more: C source files
33 # produced by Bison, tags tables, info files, and so on.
36 # Still more severe - delete backup and autosave files, too.
39 MAKE
= make
# BSD doesn't have it as a default.
41 # ==================== Things `configure' Might Edit ====================
45 C_SWITCH_SYSTEM
=@c_switch_system@
47 ### These help us choose version- and architecture-specific directories
48 ### to install files in.
50 ### This should be the number of the Emacs version we're building,
51 ### like `18.59' or `19.0'.
54 ### This should be the name of the configuration we're building Emacs
55 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
56 configuration
=@configuration@
58 ### Libraries which should be edited into lib-src/Makefile.
59 libsrc_libs
=@libsrc_libs@
61 # ==================== Where To Install Things ====================
63 # The default location for installation. Everything is placed in
64 # subdirectories of this directory. The default values for many of
65 # the variables below are expressed in terms of this one, so you may
66 # not need to change them.
69 # Like `prefix', but used for architecture-specific files.
72 # Where to install Emacs and other binaries that people will want to
73 # run directly (like etags).
74 bindir=${exec_prefix}/bin
76 # Where to install architecture-independent data files. ${lispdir}
77 # and ${etcdir} are subdirectories of this.
80 # Where to install and expect the files that Emacs modifies as it
81 # runs. These files are all architecture-independent. Right now, the
82 # only such data is the locking directory; ${lockdir} is a
83 # subdirectory of this.
84 statedir=${prefix}/lib
86 # Where to install and expect executable files to be run by Emacs
87 # rather than directly by users, and other architecture-dependent
88 # data. ${archlibdir} is a subdirectory of this.
89 libdir=${exec_prefix}/lib
91 # Where to install Emacs's man pages, and what extension they should have.
92 mandir=${prefix}/man
/man1
95 # Where to install and expect the info files describing Emacs. In the
96 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
97 # since there are now many packages documented with the texinfo
98 # system, it is inappropriate to imply that it is part of Emacs.
99 infodir=${prefix}/info
101 # Where to find the source code - setting this to anything but
102 # . doesn't work yet. The source code for Emacs's C kernel is
103 # expected to be in ${srcdir}/src, and the source code for Emacs's
104 # utility programs is expected to be in ${srcdir}/lib-src. This is
105 # set by the configure script's `--srcdir' option.
108 # ==================== Emacs-specific directories ====================
110 # These variables hold the values Emacs will actually use. They are
111 # based on the values of the standard Make variables above.
113 # Where to install the lisp files distributed with Emacs. This
114 # includes the Emacs version, so that the lisp files for different
115 # versions of Emacs will install themselves in separate directories.
116 lispdir
=${datadir}/emacs
/${version}/lisp
118 # Where to install the lisp files which are distributed with Emacs
119 # but not maintained by the FSF. This includes the Emacs version, so
120 # that the lisp files for different versions of Emacs will install
121 # themselves in separate directories.
122 externallispdir
=${datadir}/emacs
/${version}/external-lisp
124 # Directories Emacs should search for lisp files specific to this
125 # site (i.e. customizations), before consulting ${lispdir}. This
126 # should be a colon-separated list of directories.
127 locallisppath
=${datadir}/emacs
/site-lisp
129 # Where Emacs will search to find its lisp files. Before changing
130 # this, check to see if your purpose wouldn't better be served by
131 # changing locallisppath. This should be a colon-separated list of
133 lisppath
=${locallisppath}:${lispdir}
135 # Where Emacs will search for its lisp files while building. This is
136 # only used during the process of compiling Emacs, to help Emacs find
137 # its lisp files before they've been installed in their final
138 # location. It's usually identical to lisppath, except that the entry
139 # for the directory containing the installed lisp files has been
140 # replaced with ../lisp. This should be a colon-separated list of
142 buildlisppath
=..
/lisp
144 # Where to install the other architecture-independent data files
145 # distributed with Emacs (like the tutorial, the cookie recipes and
146 # the Zippy database). This path usually contains the Emacs version
147 # number, so the data files for multiple versions of Emacs may be
149 etcdir
=${datadir}/emacs
/${version}/etc
151 # Where to create and expect the locking directory, where the Emacs
152 # locking code keeps track of which files are currently being edited.
153 lockdir
=${statedir}/emacs
/lock
155 # Where to put executables to be run by Emacs rather than the user.
156 # This path usually includes the Emacs version and configuration name,
157 # so that multiple configurations for multiple versions of Emacs may
158 # be installed at once.
159 archlibdir
=${libdir}/emacs
/${version}/${configuration}
161 # ====================== Developer's configuration =======================
163 # The following assignments make sense if you're running Emacs on a single
164 # machine, one version at a time, and you want changes to the lisp and etc
165 # directories in the source tree to show up immediately in your working
166 # environment. It saves a great deal of disk space by not duplicating the
167 # lisp and etc directories.
169 # lispdir=${srcdir}/lisp
170 # externallispdir=${srcdir}/externallisp
171 # locallisppath=${srcdir}/site-lisp
172 # etcdir=${srcdir}/etc
173 # lockdir=${srcdir}/lock
174 # archlibdir=${srcdir}/bin
175 # infodir=${srcdir}/info
177 # ==================== Utility Programs for the Build ====================
179 # Allow the user to specify the install program.
182 INSTALL_PROGRAM
= ${INSTALL}
183 INSTALL_DATA
= ${INSTALL}
185 # ============================= Targets ==============================
187 # Flags passed down to subdirectory makefiles.
192 # Subdirectories to make recursively. `lisp' is not included
193 # because the compiled lisp files are part of the distribution
194 # and you cannot remake them without installing Emacs first.
197 # The makefiles of the directories in $SUBDIR.
198 SUBDIR_MAKEFILES
= lib-src
/Makefile src
/Makefile
200 # Subdirectories to install, and where they'll go.
201 # lib-src's makefile knows how to install it, so we don't do that here.
202 # When installing the info files, we need to do special things to
203 # avoid nuking an existing dir file, so we don't do that here;
204 # instead, we have written out explicit code in the `install' targets.
205 COPYDIR
= etc
${srcdir}/lisp
${srcdir}/external-lisp
206 COPYDESTS
= ${etcdir} ${lispdir} ${externallispdir}
208 all: src
/paths.h
${SUBDIR}
210 removenullpaths
=sed
-e
's/^://' -e
's/:$$//' -e
's/::/:/'
212 # We force the rebuilding of src/paths.h because the user might give
213 # make different values for the various directories. Since we use
214 # move-if-change, src/paths.h only actually changes if the user did
215 # something notable, so the only unnecessary work we do is in building
216 # src/paths.h.tmp, which isn't much.
217 # Note that sed is not in /bin on 386bsd.
218 src
/paths.h
: Makefile
${srcdir}/src
/paths.h.in FRC
219 @echo
"Producing \`src/paths.h' from \`src/paths.h.in'."
220 @
(lisppath
=`echo ${lisppath} | ${removenullpaths}` ; \
221 buildlisppath
=`echo ${buildlisppath} | ${removenullpaths}` ; \
222 sed
< ${srcdir}/src
/paths.h.in
> src
/paths.h.tmp \
223 -e
's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
224 -e
's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
225 -e
's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
226 -e
's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
227 -e
's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";')
228 @
${srcdir}/move-if-change src
/paths.h.tmp src
/paths.h
232 .RECURSIVE
: ${SUBDIR}
234 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
235 cd
$@
; $(MAKE
) all ${MFLAGS} \
236 CC
='${CC}' DEFS
='${DEFS}' \
237 srcdir='${srcdir}/$@' libdir='${libdir}'
239 ## We build the makefiles for the subdirectories here so that we can
240 ## edit the values for the path variables into them. This means that
241 ## when the user has built them from this makefile once, they will use
242 ## the right default values for the path variables.
243 lib-src
/Makefile
: ${srcdir}/lib-src
/Makefile.in Makefile
244 rm -f lib-src
/Makefile.tmp
245 @echo
"Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'."
246 @
(echo
"# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \
247 echo
"# If you are thinking about editing it, you should seriously consider" ; \
248 echo
"# running \`make lib-src/Makefile' at the top of the" ; \
249 echo
"# Emacs build tree instead, or editing" ; \
250 echo
"# \`${srcdir}/lib-src/Makefile.in' itself." ; \
251 /bin
/sed
< ${srcdir}/lib-src
/Makefile.in \
252 -e
's|^\(version *=\).*$$|\1'"${version}"'|' \
253 -e
's|^\(configname *=\).*$$|\1'"${configuration}"'|' \
254 -e
's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \
255 -e
's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \
256 -e
's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \
257 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
258 -e
's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \
259 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
260 -e
's|^DEFS *=.*$$|DEFS='"${DEFS}"'|' \
261 -e
's|^C_SWITCH_SYSTEM *=.*$$|C_SWITCH_SYSTEM='"${C_SWITCH_SYSTEM}"'|' \
262 -e
's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|' \
263 -e
'/^# DIST: /d') > lib-src
/Makefile.tmp
264 @
${srcdir}/move-if-change lib-src
/Makefile.tmp lib-src
/Makefile
265 chmod
-w lib-src
/Makefile
267 src
/Makefile
: ${srcdir}/src
/Makefile.in Makefile
268 rm -f src
/Makefile.tmp
269 @echo
"Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
270 @
(echo
"# This file is generated from \`${srcdir}/src/Makefile.in'." ; \
271 echo
"# If you are thinking about editing it, you should seriously consider" ; \
272 echo
"# running \`make src/Makefile' at the top of the" ; \
273 echo
"# Emacs build tree instead, or editing" ; \
274 echo
"# \`${srcdir}/src/Makefile.in' itself." ; \
275 /bin
/sed
< ${srcdir}/src
/Makefile.in \
276 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
277 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
278 -e
's|^DEFS *=.*$$|DEFS='"${DEFS}"'|' \
279 -e
'/^# DIST: /d') > src
/Makefile.tmp
280 @
${srcdir}/move-if-change src
/Makefile.tmp src
/Makefile
281 chmod
-w src
/Makefile
283 oldXMenu
/Makefile
: ${srcdir}/oldXMenu
/Makefile Makefile
284 echo
"Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
285 rm -f src
/Makefile.tmp
286 cp
"${srcdir}"/oldXMenu
/Makefile oldXMenu
/Makefile
292 # ==================== Installation ====================
294 ## If we let lib-src do its own installation, that means we
295 ## don't have to duplicate the list of utilities to install in
296 ## this Makefile as well.
298 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
299 -set
${COPYDESTS} ; \
300 for
dir in
${COPYDIR} ; do \
302 if
[ `(cd $${dir}; /bin/pwd)` != `(cd $${dest}; /bin/pwd)` ]; then \
303 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xf
- ) ; \
304 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
305 rm -rf
$${subdir}/RCS
; \
306 rm -rf
$${subdir}/CVS
; \
307 rm -f
$${subdir}/\
#* ; \
308 rm -f
$${subdir}/*~
; \
313 if
[ ! -f
${infodir}/dir ]; then \
314 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 .
/dir ${infodir}/dir ; \
316 if
[ "`echo *.info*`" != "*.info*" ]; then \
317 for f in
*.
info* ; do \
318 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 $$f ${infodir}/$$f ; \
321 for page in emacs etags ctags
; do \
322 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 etc
/$${page}.1 \
323 ${mandir}/$${page}${manext} ; \
325 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -m
1755 src
/emacs \
326 ${bindir}/emacs-
${version}
327 -rm -f
${bindir}/emacs
328 ln
${bindir}/emacs-
${version} ${bindir}/emacs
330 ## If we let lib-src do its own installation, that means we
331 ## don't have to duplicate the list of utilities to install in
332 ## this Makefile as well.
333 install.sysv
: all mkdir
334 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
335 -set
${COPYDESTS} ; \
336 for
dir in
${COPYDIR} ; do \
338 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
339 (cd
$${dir}; find .
-print | cpio
-pdum
$${dest} ) ; \
340 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
341 rm -rf
$${subdir}/RCS
; \
342 rm -rf
$${subdir}/CVS
; \
343 rm -f
$${subdir}/\
#* ; \
344 rm -f
$${subdir}/*~
; \
349 if
[ ! -f
${infodir}/dir ]; then \
350 cpset .
/dir ${infodir} 444 bin bin
; \
352 if
[ "`echo *.info*`" != "*.info*" ]; then \
353 for f in
*.
info* ; do \
354 cpset
$$f ${infodir} 444 bin bin
; \
357 -for page in emacs etags ctags
; do \
358 cpset etc
/$${page}.1 ${mandir}/$${page}${manext} 444 bin bin
; \
360 -/bin
/rm -f
${bindir}/emacs
361 -cpset src
/emacs
${bindir}/emacs-
${version} 1755 bin bin
362 -ln
${bindir}/emacs-
${version} ${bindir}/emacs
364 ## If we let lib-src do its own installation, that means we
365 ## don't have to duplicate the list of utilities to install in
366 ## this Makefile as well.
367 install.xenix
: all mkdir
368 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
369 -set
${COPYDESTS} ; \
370 for
dir in
${COPYDIR} ; do \
372 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
373 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xpf
- ) ; \
374 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
375 rm -rf
$${subdir}/RCS
; \
376 rm -rf
$${subdir}/CVS
; \
377 rm -f
$${subdir}/\
#* ; \
378 rm -f
$${subdir}/*~
; \
383 if
[ ! -f
${infodir}/dir ]; then \
384 cp .
/dir ${infodir} ; \
385 chmod
444 ${infodir}/dir ; \
387 if
[ "`echo *.info*`" != "*.info*" ]; then \
388 for f in
*.
info* ; do \
389 cp
$$f ${infodir} ; \
390 chmod
444 ${infodir}/$$f ; \
393 for page in emacs etags ctags
; do \
394 cp etc
/$${page}.1 ${mandir}/$${page}${manext} ; \
395 chmod
444 ${mandir}/$${page}${manext} ; \
397 -mv
-f
${bindir}/emacs
${bindir}/emacs.old
398 cp src
/emacs
${bindir}/emacs-
${version}
399 ln
${bindir}/emacs-
${version} ${bindir}/emacs
400 chmod
1755 ${bindir}/emacs
401 -rm -f
${bindir}/emacs.old
403 ## If we let lib-src do its own installation, that means we
404 ## don't have to duplicate the list of utilities to install in
405 ## this Makefile as well.
406 install.aix
: all mkdir
407 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
408 -set
${COPYDESTS} ; \
409 for
dir in
${COPYDIR} ; do \
411 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
412 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xBf
- ) ; \
413 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
414 rm -rf
$${subdir}/RCS
; \
415 rm -rf
$${subdir}/CVS
; \
416 rm -f
$${subdir}/\
#* ; \
417 rm -f
$${subdir}/*~
; \
422 if
[ ! -f
${infodir}/dir ]; then \
423 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${infodir} .
/dir ; \
425 if
[ "`echo *.info*`" != "*.info*" ]; then \
426 for f in
*.
info* ; do \
427 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${infodir} $$f ; \
430 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -M
1755 -f
${bindir} src
/emacs
431 mv
${bindir}/emacs
${bindir}/emacs-
${version}
432 for page in emacs etags ctags
; do \
433 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${mandir} etc
/$${page}.1 ;\
435 -rm -f
${bindir}/emacs
436 ln
${bindir}/emacs-
${version} ${bindir}/emacs
438 ### Build all the directories we're going to install Emacs in. Since
439 ### we may be creating several layers of directories (for example,
440 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
441 ### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
443 .
/lib-src
/make-path
${COPYDESTS} ${lockdir}
444 chmod
777 ${COPYDESTS} ${lockdir}
449 # ==================== Cleaning up and miscellanea ====================
452 ### Delete all files from the current directory that are normally
453 ### created by building the program. Don't delete the files that
454 ### record the configuration. Also preserve files that could be made
455 ### by building, but normally aren't because the distribution comes
458 ### Like `clean', but may refrain from deleting a few files that
459 ### people normally don't want to recompile. For example, the
460 ### `mostlyclean' target for GCC does not delete `libgcc.a', because
461 ### recompiling it is rarely necessary and takes a lot of time.
464 cd src
; $(MAKE
) clean
465 cd lib-src
; $(MAKE
) clean
466 cd oldXMenu
; $(MAKE
) clean
467 if
[ `(cd ${etcdir} ; /bin/pwd)` != `(cd etc; /bin/pwd)` ] ; then \
468 cd etc
; $(MAKE
) clean; \
473 ### Delete all files from the current directory that are created by
474 ### configuring or building the program. This should leave only the
475 ### files that would be in the distribution.
477 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} distclean); done
479 -rm config.status config-tmp-
*
482 ### Delete everything from the current directory that can be
483 ### reconstructed with this makefile. This typically includes
484 ### everything deleted by distclean, plus more: C source files
485 ### produced by Bison, tags tables, info files, and so on.
487 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} realclean); done
491 ### This doesn't actually appear in the coding standards, but Karl
492 ### says GCC supports it, and that's where the configuration part of
493 ### the coding standards seem to come from. It's like distclean, but
494 ### it deletes backup and autosave files too.
496 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} extraclean
); done
498 -rm config.status config-tmp-
*
501 ### Unlocking and relocking. The idea of these productions is to reduce
502 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
503 ### before unlocking the file to take the write locks off all sources so
504 ### that tar xvof will overwrite them without fuss. Then do `make relock'
505 ### afterward so that VC mode will know which files should be checked in
506 ### if you want to mung them.
508 ### Note: it's no disaster if these productions miss a file or two; tar
509 ### and VC will swiftly let you know if this happens, and it is easily
511 SOURCES
= ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
512 README build-install.in configure make-dist move-if-change
515 chmod u
+w
$(SOURCES
) cpp/*
516 -(cd elisp
; chmod u
+w Makefile README
*.texi
)
517 (cd etc
; make unlock
)
518 (cd lib-src
; make unlock
)
519 (cd lisp
; make unlock
)
520 (cd lisp
/term
; chmod u
+w README
*.el
)
521 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
522 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
523 (cd src
; make unlock
)
526 chmod u-w
$(SOURCES
) cpp/*
527 -(cd elisp
; chmod u-w Makefile README
*.texi
)
528 (cd etc
; make relock
)
529 (cd lib-src
; make relock
)
530 (cd lisp
; make relock
)
531 (cd lisp
/term
; chmod u
+w README
*.el
)
532 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
533 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
534 (cd src
; make relock
)
537 (cd
${srcdir} ; lib-src
/etags
--output
=.
/src
/TAGS \
538 src
/*.
[ch
] lisp
/*.el lisp
/term
/*.el
)
541 @echo
"We don't have any tests for GNU Emacs yet."
544 cd
${srcdir}; make-dist