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 ====================
46 ### These help us choose version- and architecture-specific directories
47 ### to install files in.
49 ### This should be the number of the Emacs version we're building,
50 ### like `18.59' or `19.0'.
51 version
=version-not-set
53 ### This should be the name of the configuration we're building Emacs
54 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
55 configname
=configuration-name-not-set
57 # ==================== Where To Install Things ====================
59 # The default location for installation. Everything is placed in
60 # subdirectories of this directory. The default values for many of
61 # the variables below are expressed in terms of this one, so you may
62 # not need to change them.
65 # Like `prefix', but used for architecture-specific files.
68 # Where to install Emacs and other binaries that people will want to
69 # run directly (like etags).
70 bindir=${exec_prefix}/bin
72 # Where to install architecture-independent data files. ${lispdir}
73 # and ${etcdir} are subdirectories of this.
76 # Where to install and expect the files that Emacs modifies as it
77 # runs. These files are all architecture-independent. Right now, the
78 # only such data is the locking directory; ${lockdir} is a
79 # subdirectory of this.
80 statedir=${prefix}/lib
82 # Where to install and expect executable files to be run by Emacs
83 # rather than directly by users, and other architecture-dependent
84 # data. ${archlibdir} is a subdirectory of this.
85 libdir=${exec_prefix}/lib
87 # Where to install Emacs's man pages, and what extension they should have.
88 mandir=${prefix}/man
/man1
91 # Where to install and expect the info files describing Emacs. In the
92 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
93 # since there are now many packages documented with the texinfo
94 # system, it is inappropriate to imply that it is part of Emacs.
95 infodir=${prefix}/info
97 # Where to find the source code - setting this to anything but
98 # . doesn't work yet. The source code for Emacs's C kernel is
99 # expected to be in ${srcdir}/src, and the source code for Emacs's
100 # utility programs is expected to be in ${srcdir}/lib-src. This is
101 # set by the configure script's `--srcdir' option.
104 # ==================== Emacs-specific directories ====================
106 # These variables hold the values Emacs will actually use. They are
107 # based on the values of the standard Make variables above.
109 # Where to install the lisp files distributed with Emacs. This
110 # includes the Emacs version, so that the lisp files for different
111 # versions of Emacs will install themselves in separate directories.
112 lispdir
=${datadir}/emacs
/${version}/lisp
114 # Where to install the lisp files which are distributed with Emacs
115 # but not maintained by the FSF. This includes the Emacs version, so
116 # that the lisp files for different versions of Emacs will install
117 # themselves in separate directories.
118 externallispdir
=${datadir}/emacs
/${version}/external-lisp
120 # Directories Emacs should search for lisp files specific to this
121 # site (i.e. customizations), before consulting ${lispdir}. This
122 # should be a colon-separated list of directories.
123 locallisppath
=${datadir}/emacs
/site-lisp
125 # Where Emacs will search to find its lisp files. Before changing
126 # this, check to see if your purpose wouldn't better be served by
127 # changing locallisppath. This should be a colon-separated list of
129 lisppath
=${locallisppath}:${lispdir}
131 # Where Emacs will search for its lisp files while building. This is
132 # only used during the process of compiling Emacs, to help Emacs find
133 # its lisp files before they've been installed in their final
134 # location. It's usually identical to lisppath, except that the entry
135 # for the directory containing the installed lisp files has been
136 # replaced with ../lisp. This should be a colon-separated list of
138 buildlisppath
=..
/lisp
140 # Where to install the other architecture-independent data files
141 # distributed with Emacs (like the tutorial, the cookie recipes and
142 # the Zippy database). This path usually contains the Emacs version
143 # number, so the data files for multiple versions of Emacs may be
145 etcdir
=${datadir}/emacs
/${version}/etc
147 # Where to create and expect the locking directory, where the Emacs
148 # locking code keeps track of which files are currently being edited.
149 lockdir
=${statedir}/emacs
/lock
151 # Where to put executables to be run by Emacs rather than the user.
152 # This path usually includes the Emacs version and configuration name,
153 # so that multiple configurations for multiple versions of Emacs may
154 # be installed at once.
155 archlibdir
=${libdir}/emacs
/${version}/${configname}
157 # ====================== Developer's configuration =======================
159 # The following assignments make sense if you're running Emacs on a single
160 # machine, one version at a time, and you want changes to the lisp and etc
161 # directories in the source tree to show up immediately in your working
162 # environment. It saves a great deal of disk space by not duplicating the
163 # lisp and etc directories.
165 # lispdir=${srcdir}/lisp
166 # externallispdir=${srcdir}/externallisp
167 # locallisppath=${srcdir}/site-lisp
168 # etcdir=${srcdir}/etc
169 # lockdir=${srcdir}/lock
170 # archlibdir=${srcdir}/bin
171 # infodir=${srcdir}/info
173 # ==================== Utility Programs for the Build ====================
175 # Allow the user to specify the install program.
178 INSTALL_PROGRAM
= ${INSTALL}
179 INSTALL_DATA
= ${INSTALL}
181 # ============================= Targets ==============================
183 # Flags passed down to subdirectory makefiles.
186 CFLAGS
=${CONFIG_CFLAGS}
188 # Subdirectories to make recursively. `lisp' is not included
189 # because the compiled lisp files are part of the distribution
190 # and you cannot remake them without installing Emacs first.
193 # The makefiles of the directories in $SUBDIR.
194 SUBDIR_MAKEFILES
= lib-src
/Makefile src
/Makefile
196 # Subdirectories to install, and where they'll go.
197 # lib-src's makefile knows how to install it, so we don't do that here.
198 # When installing the info files, we need to do special things to
199 # avoid nuking an existing dir file, so we don't do that here;
200 # instead, we have written out explicit code in the `install' targets.
201 COPYDIR
= etc
${srcdir}/lisp
${srcdir}/external-lisp
202 COPYDESTS
= ${etcdir} ${lispdir} ${externallispdir}
204 all: src
/paths.h
${SUBDIR}
206 removenullpaths
=sed
-e
's/^://' -e
's/:$$//' -e
's/::/:/'
208 # We force the rebuilding of src/paths.h because the user might give
209 # make different values for the various directories. Since we use
210 # move-if-change, src/paths.h only actually changes if the user did
211 # something notable, so the only unnecessary work we do is in building
212 # src/paths.h.tmp, which isn't much.
213 # Note that sed is not in /bin on 386bsd.
214 src
/paths.h
: Makefile
${srcdir}/src
/paths.h.in FRC
215 lisppath
=`echo ${lisppath} | ${removenullpaths}` ; \
216 buildlisppath
=`echo ${buildlisppath} | ${removenullpaths}` ; \
217 sed
< ${srcdir}/src
/paths.h.in
> src
/paths.h.tmp \
218 -e
's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
219 -e
's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
220 -e
's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
221 -e
's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
222 -e
's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";'
223 ${srcdir}/move-if-change src
/paths.h.tmp src
/paths.h
227 .RECURSIVE
: ${SUBDIR}
229 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
230 cd
$@
; $(MAKE
) all ${MFLAGS} \
231 CC
='${CC}' CONFIG_CFLAGS
='${CONFIG_CFLAGS}' \
232 srcdir='${srcdir}/$@' libdir='${libdir}'
234 ## We build the makefiles for the subdirectories here so that we can
235 ## edit the values for the path variables into them. This means that
236 ## when the user has built them from this makefile once, they will use
237 ## the right default values for the path variables.
238 lib-src
/Makefile
: ${srcdir}/lib-src
/Makefile.in Makefile
239 echo
"Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'."
240 rm -f lib-src
/Makefile.tmp
241 (echo
"# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \
242 echo
"# If you are thinking about editing it, you should seriously consider" ; \
243 echo
"# running \`make lib-src/Makefile' at the top of the" ; \
244 echo
"# Emacs build tree instead, or editing" ; \
245 echo
"# \`${srcdir}/lib-src/Makefile.in' itself." ; \
246 /bin
/sed
< ${srcdir}/lib-src
/Makefile.in \
247 -e
's|^\(version *=\).*$$|\1'"${version}"'|' \
248 -e
's|^\(configname *=\).*$$|\1'"${configname}"'|' \
249 -e
's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \
250 -e
's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \
251 -e
's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \
252 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
253 -e
's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \
254 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
255 -e
's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
256 -e
's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|' \
257 -e
'/^# DIST: /d') > lib-src
/Makefile.tmp
258 ${srcdir}/move-if-change lib-src
/Makefile.tmp lib-src
/Makefile
259 chmod
-w lib-src
/Makefile
261 src
/Makefile
: ${srcdir}/src
/Makefile.in Makefile
262 echo
"Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
263 rm -f src
/Makefile.tmp
264 (echo
"# This file is generated from \`${srcdir}/src/Makefile.in'." ; \
265 echo
"# If you are thinking about editing it, you should seriously consider" ; \
266 echo
"# running \`make src/Makefile' at the top of the" ; \
267 echo
"# Emacs build tree instead, or editing" ; \
268 echo
"# \`${srcdir}/src/Makefile.in' itself." ; \
269 /bin
/sed
< ${srcdir}/src
/Makefile.in \
270 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
271 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
272 -e
's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
273 -e
'/^# DIST: /d') > src
/Makefile.tmp
274 ${srcdir}/move-if-change src
/Makefile.tmp src
/Makefile
275 chmod
-w src
/Makefile
277 oldXMenu
/Makefile
: ${srcdir}/oldXMenu
/Makefile Makefile
278 echo
"Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
279 rm -f src
/Makefile.tmp
280 cp
"${srcdir}"/oldXMenu
/Makefile oldXMenu
/Makefile
286 # ==================== Installation ====================
288 ## If we let lib-src do its own installation, that means we
289 ## don't have to duplicate the list of utilities to install in
290 ## this Makefile as well.
292 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
293 -set
${COPYDESTS} ; \
294 for
dir in
${COPYDIR} ; do \
296 if
[ `(cd $${dir}; /bin/pwd)` != `(cd $${dest}; /bin/pwd)` ]; then \
297 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xf
- ) ; \
298 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
299 rm -rf
$${subdir}/RCS
; \
300 rm -rf
$${subdir}/CVS
; \
301 rm -f
$${subdir}/\
#* ; \
302 rm -f
$${subdir}/*~
; \
307 if
[ ! -f
${infodir}/dir ]; then \
308 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 .
/dir ${infodir}/dir ; \
310 if
[ "`echo *.info*`" != "*.info*" ]; then \
311 for f in
*.
info* ; do \
312 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 $$f ${infodir}/$$f ; \
315 for page in emacs etags ctags
; do \
316 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 etc
/$${page}.1 \
317 ${mandir}/$${page}${manext} ; \
319 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -m
1755 src
/emacs \
320 ${bindir}/emacs-
${version}
321 -rm -f
${bindir}/emacs
322 ln
${bindir}/emacs-
${version} ${bindir}/emacs
324 ## If we let lib-src do its own installation, that means we
325 ## don't have to duplicate the list of utilities to install in
326 ## this Makefile as well.
327 install.sysv
: all mkdir
328 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
329 -set
${COPYDESTS} ; \
330 for
dir in
${COPYDIR} ; do \
332 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
333 (cd
$${dir}; find .
-print | cpio
-pdum
$${dest} ) ; \
334 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
335 rm -rf
$${subdir}/RCS
; \
336 rm -rf
$${subdir}/CVS
; \
337 rm -f
$${subdir}/\
#* ; \
338 rm -f
$${subdir}/*~
; \
343 if
[ ! -f
${infodir}/dir ]; then \
344 cpset .
/dir ${infodir} 444 bin bin
; \
346 if
[ "`echo *.info*`" != "*.info*" ]; then \
347 for f in
*.
info* ; do \
348 cpset
$$f ${infodir} 444 bin bin
; \
351 -for page in emacs etags ctags
; do \
352 cpset etc
/$${page}.1 ${mandir}/$${page}${manext} 444 bin bin
; \
354 -/bin
/rm -f
${bindir}/emacs
355 -cpset src
/emacs
${bindir}/emacs-
${version} 1755 bin bin
356 -ln
${bindir}/emacs-
${version} ${bindir}/emacs
358 ## If we let lib-src do its own installation, that means we
359 ## don't have to duplicate the list of utilities to install in
360 ## this Makefile as well.
361 install.xenix
: all mkdir
362 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
363 -set
${COPYDESTS} ; \
364 for
dir in
${COPYDIR} ; do \
366 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
367 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xpf
- ) ; \
368 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
369 rm -rf
$${subdir}/RCS
; \
370 rm -rf
$${subdir}/CVS
; \
371 rm -f
$${subdir}/\
#* ; \
372 rm -f
$${subdir}/*~
; \
377 if
[ ! -f
${infodir}/dir ]; then \
378 cp .
/dir ${infodir} ; \
379 chmod
444 ${infodir}/dir ; \
381 if
[ "`echo *.info*`" != "*.info*" ]; then \
382 for f in
*.
info* ; do \
383 cp
$$f ${infodir} ; \
384 chmod
444 ${infodir}/$$f ; \
387 for page in emacs etags ctags
; do \
388 cp etc
/$${page}.1 ${mandir}/$${page}${manext} ; \
389 chmod
444 ${mandir}/$${page}${manext} ; \
391 -mv
-f
${bindir}/emacs
${bindir}/emacs.old
392 cp src
/emacs
${bindir}/emacs-
${version}
393 ln
${bindir}/emacs-
${version} ${bindir}/emacs
394 chmod
1755 ${bindir}/emacs
395 -rm -f
${bindir}/emacs.old
397 ## If we let lib-src do its own installation, that means we
398 ## don't have to duplicate the list of utilities to install in
399 ## this Makefile as well.
400 install.aix
: all mkdir
401 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
402 -set
${COPYDESTS} ; \
403 for
dir in
${COPYDIR} ; do \
405 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
406 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xBf
- ) ; \
407 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
408 rm -rf
$${subdir}/RCS
; \
409 rm -rf
$${subdir}/CVS
; \
410 rm -f
$${subdir}/\
#* ; \
411 rm -f
$${subdir}/*~
; \
416 if
[ ! -f
${infodir}/dir ]; then \
417 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${infodir} .
/dir ; \
419 if
[ "`echo *.info*`" != "*.info*" ]; then \
420 for f in
*.
info* ; do \
421 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${infodir} $$f ; \
424 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -M
1755 -f
${bindir} src
/emacs
425 mv
${bindir}/emacs
${bindir}/emacs-
${version}
426 for page in emacs etags ctags
; do \
427 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${mandir} etc
/$${page}.1 ;\
429 -rm -f
${bindir}/emacs
430 ln
${bindir}/emacs-
${version} ${bindir}/emacs
432 ### Build all the directories we're going to install Emacs in. Since
433 ### we may be creating several layers of directories (for example,
434 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
435 ### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
437 .
/lib-src
/make-path
${COPYDESTS} ${lockdir}
438 chmod
777 ${COPYDESTS} ${lockdir}
443 # ==================== Cleaning up and miscellanea ====================
446 ### Delete all files from the current directory that are normally
447 ### created by building the program. Don't delete the files that
448 ### record the configuration. Also preserve files that could be made
449 ### by building, but normally aren't because the distribution comes
452 ### Like `clean', but may refrain from deleting a few files that
453 ### people normally don't want to recompile. For example, the
454 ### `mostlyclean' target for GCC does not delete `libgcc.a', because
455 ### recompiling it is rarely necessary and takes a lot of time.
458 cd src
; $(MAKE
) clean
459 cd lib-src
; $(MAKE
) clean
460 cd oldXMenu
; $(MAKE
) clean
461 if
[ `(cd ${etcdir} ; /bin/pwd` != `(cd etc; /bin/pwd)` ] ; then \
462 cd etc
; $(MAKE
) clean; \
467 ### Delete all files from the current directory that are created by
468 ### configuring or building the program. This should leave only the
469 ### files that would be in the distribution.
471 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} distclean); done
473 -rm config.status config-tmp-
*
476 ### Delete everything from the current directory that can be
477 ### reconstructed with this makefile. This typically includes
478 ### everything deleted by distclean, plus more: C source files
479 ### produced by Bison, tags tables, info files, and so on.
481 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} realclean); done
485 ### This doesn't actually appear in the coding standards, but Karl
486 ### says GCC supports it, and that's where the configuration part of
487 ### the coding standards seem to come from. It's like distclean, but
488 ### it deletes backup and autosave files too.
490 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} extraclean
); done
492 -rm config.status config-tmp-
*
495 ### Unlocking and relocking. The idea of these productions is to reduce
496 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
497 ### before unlocking the file to take the write locks off all sources so
498 ### that tar xvof will overwrite them without fuss. Then do `make relock'
499 ### afterward so that VC mode will know which files should be checked in
500 ### if you want to mung them.
502 ### Note: it's no disaster if these productions miss a file or two; tar
503 ### and VC will swiftly let you know if this happens, and it is easily
505 SOURCES
= ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
506 README build-install.in configure make-dist move-if-change
509 chmod u
+w
$(SOURCES
) cpp/*
510 -(cd elisp
; chmod u
+w Makefile README
*.texi
)
511 (cd etc
; make unlock
)
512 (cd lib-src
; make unlock
)
513 (cd lisp
; make 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 src
; make unlock
)
520 chmod u-w
$(SOURCES
) cpp/*
521 -(cd elisp
; chmod u-w Makefile README
*.texi
)
522 (cd etc
; make relock
)
523 (cd lib-src
; make relock
)
524 (cd lisp
; make relock
)
525 (cd lisp
/term
; chmod u
+w README
*.el
)
526 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
527 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
528 (cd src
; make relock
)
531 (cd
${srcdir} ; lib-src
/etags
--output
=.
/src
/TAGS \
532 src
/*.
[ch
] lisp
/*.el lisp
/term
/*.el
)
535 @echo
"We don't have any tests for GNU Emacs yet."
538 cd
${srcdir}; make-dist