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 ====================
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'.
52 version
=version-not-set
54 ### This should be the name of the configuration we're building Emacs
55 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
56 configname
=configuration-name-not-set
58 # ==================== Where To Install Things ====================
60 # The default location for installation. Everything is placed in
61 # subdirectories of this directory. The default values for many of
62 # the variables below are expressed in terms of this one, so you may
63 # not need to change them.
66 # Like `prefix', but used for architecture-specific files.
69 # Where to install Emacs and other binaries that people will want to
70 # run directly (like etags).
71 bindir=${exec_prefix}/bin
73 # Where to install architecture-independent data files. ${lispdir}
74 # and ${etcdir} are subdirectories of this.
77 # Where to install and expect the files that Emacs modifies as it
78 # runs. These files are all architecture-independent. Right now, the
79 # only such data is the locking directory; ${lockdir} is a
80 # subdirectory of this.
81 statedir=${prefix}/lib
83 # Where to install and expect executable files to be run by Emacs
84 # rather than directly by users, and other architecture-dependent
85 # data. ${archlibdir} is a subdirectory of this.
86 libdir=${exec_prefix}/lib
88 # Where to install Emacs's man pages, and what extension they should have.
89 mandir=${prefix}/man
/man1
92 # Where to install and expect the info files describing Emacs. In the
93 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
94 # since there are now many packages documented with the texinfo
95 # system, it is inappropriate to imply that it is part of Emacs.
96 infodir=${prefix}/info
98 # Where to find the source code - setting this to anything but
99 # . doesn't work yet. The source code for Emacs's C kernel is
100 # expected to be in ${srcdir}/src, and the source code for Emacs's
101 # utility programs is expected to be in ${srcdir}/lib-src. This is
102 # set by the configure script's `--srcdir' option.
105 # ==================== Emacs-specific directories ====================
107 # These variables hold the values Emacs will actually use. They are
108 # based on the values of the standard Make variables above.
110 # Where to install the lisp files distributed with Emacs. This
111 # includes the Emacs version, so that the lisp files for different
112 # versions of Emacs will install themselves in separate directories.
113 lispdir
=${datadir}/emacs
/${version}/lisp
115 # Where to install the lisp files which are distributed with Emacs
116 # but not maintained by the FSF. This includes the Emacs version, so
117 # that the lisp files for different versions of Emacs will install
118 # themselves in separate directories.
119 externallispdir
=${datadir}/emacs
/${version}/external-lisp
121 # Directories Emacs should search for lisp files specific to this
122 # site (i.e. customizations), before consulting ${lispdir}. This
123 # should be a colon-separated list of directories.
124 locallisppath
=${datadir}/emacs
/site-lisp
126 # Where Emacs will search to find its lisp files. Before changing
127 # this, check to see if your purpose wouldn't better be served by
128 # changing locallisppath. This should be a colon-separated list of
130 lisppath
=${locallisppath}:${lispdir}
132 # Where Emacs will search for its lisp files while building. This is
133 # only used during the process of compiling Emacs, to help Emacs find
134 # its lisp files before they've been installed in their final
135 # location. It's usually identical to lisppath, except that the entry
136 # for the directory containing the installed lisp files has been
137 # replaced with ../lisp. This should be a colon-separated list of
139 buildlisppath
=..
/lisp
141 # Where to install the other architecture-independent data files
142 # distributed with Emacs (like the tutorial, the cookie recipes and
143 # the Zippy database). This path usually contains the Emacs version
144 # number, so the data files for multiple versions of Emacs may be
146 etcdir
=${datadir}/emacs
/${version}/etc
148 # Where to create and expect the locking directory, where the Emacs
149 # locking code keeps track of which files are currently being edited.
150 lockdir
=${statedir}/emacs
/lock
152 # Where to put executables to be run by Emacs rather than the user.
153 # This path usually includes the Emacs version and configuration name,
154 # so that multiple configurations for multiple versions of Emacs may
155 # be installed at once.
156 archlibdir
=${libdir}/emacs
/${version}/${configname}
158 # ====================== Developer's configuration =======================
160 # The following assignments make sense if you're running Emacs on a single
161 # machine, one version at a time, and you want changes to the lisp and etc
162 # directories in the source tree to show up immediately in your working
163 # environment. It saves a great deal of disk space by not duplicating the
164 # lisp and etc directories.
166 # lispdir=${srcdir}/lisp
167 # externallispdir=${srcdir}/externallisp
168 # locallisppath=${srcdir}/site-lisp
169 # etcdir=${srcdir}/etc
170 # lockdir=${srcdir}/lock
171 # archlibdir=${srcdir}/bin
172 # infodir=${srcdir}/info
174 # ==================== Utility Programs for the Build ====================
176 # Allow the user to specify the install program.
179 INSTALL_PROGRAM
= ${INSTALL}
180 INSTALL_DATA
= ${INSTALL}
182 # ============================= Targets ==============================
184 # Flags passed down to subdirectory makefiles.
187 CFLAGS
=${CONFIG_CFLAGS}
189 # Subdirectories to make recursively. `lisp' is not included
190 # because the compiled lisp files are part of the distribution
191 # and you cannot remake them without installing Emacs first.
194 # The makefiles of the directories in $SUBDIR.
195 SUBDIR_MAKEFILES
= lib-src
/Makefile src
/Makefile
197 # Subdirectories to install, and where they'll go.
198 # lib-src's makefile knows how to install it, so we don't do that here.
199 # When installing the info files, we need to do special things to
200 # avoid nuking an existing dir file, so we don't do that here;
201 # instead, we have written out explicit code in the `install' targets.
202 COPYDIR
= etc
${srcdir}/lisp
${srcdir}/external-lisp
203 COPYDESTS
= ${etcdir} ${lispdir} ${externallispdir}
205 all: src
/paths.h
${SUBDIR}
207 removenullpaths
=sed
-e
's/^://' -e
's/:$$//' -e
's/::/:/'
209 # We force the rebuilding of src/paths.h because the user might give
210 # make different values for the various directories. Since we use
211 # move-if-change, src/paths.h only actually changes if the user did
212 # something notable, so the only unnecessary work we do is in building
213 # src/paths.h.tmp, which isn't much.
214 # Note that sed is not in /bin on 386bsd.
215 src
/paths.h
: Makefile
${srcdir}/src
/paths.h.in FRC
216 lisppath
=`echo ${lisppath} | ${removenullpaths}` ; \
217 buildlisppath
=`echo ${buildlisppath} | ${removenullpaths}` ; \
218 sed
< ${srcdir}/src
/paths.h.in
> src
/paths.h.tmp \
219 -e
's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
220 -e
's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
221 -e
's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
222 -e
's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
223 -e
's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";'
224 ${srcdir}/move-if-change src
/paths.h.tmp src
/paths.h
228 .RECURSIVE
: ${SUBDIR}
230 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
231 cd
$@
; $(MAKE
) all ${MFLAGS} \
232 CC
='${CC}' CONFIG_CFLAGS
='${CONFIG_CFLAGS}' \
233 srcdir='${srcdir}/$@' libdir='${libdir}'
235 ## We build the makefiles for the subdirectories here so that we can
236 ## edit the values for the path variables into them. This means that
237 ## when the user has built them from this makefile once, they will use
238 ## the right default values for the path variables.
239 lib-src
/Makefile
: ${srcdir}/lib-src
/Makefile.in Makefile
240 echo
"Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'."
241 rm -f lib-src
/Makefile.tmp
242 (echo
"# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \
243 echo
"# If you are thinking about editing it, you should seriously consider" ; \
244 echo
"# running \`make lib-src/Makefile' at the top of the" ; \
245 echo
"# Emacs build tree instead, or editing" ; \
246 echo
"# \`${srcdir}/lib-src/Makefile.in' itself." ; \
247 /bin
/sed
< ${srcdir}/lib-src
/Makefile.in \
248 -e
's|^\(version *=\).*$$|\1'"${version}"'|' \
249 -e
's|^\(configname *=\).*$$|\1'"${configname}"'|' \
250 -e
's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \
251 -e
's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \
252 -e
's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \
253 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
254 -e
's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \
255 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
256 -e
's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
257 -e
's|^C_SWITCH_SYSTEM *=.*$$|C_SWITCH_SYSTEM='"${C_SWITCH_SYSTEM}"'|' \
258 -e
's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|' \
259 -e
'/^# DIST: /d') > lib-src
/Makefile.tmp
260 ${srcdir}/move-if-change lib-src
/Makefile.tmp lib-src
/Makefile
261 chmod
-w lib-src
/Makefile
263 src
/Makefile
: ${srcdir}/src
/Makefile.in Makefile
264 echo
"Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
265 rm -f src
/Makefile.tmp
266 (echo
"# This file is generated from \`${srcdir}/src/Makefile.in'." ; \
267 echo
"# If you are thinking about editing it, you should seriously consider" ; \
268 echo
"# running \`make src/Makefile' at the top of the" ; \
269 echo
"# Emacs build tree instead, or editing" ; \
270 echo
"# \`${srcdir}/src/Makefile.in' itself." ; \
271 /bin
/sed
< ${srcdir}/src
/Makefile.in \
272 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
273 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
274 -e
's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
275 -e
'/^# DIST: /d') > src
/Makefile.tmp
276 ${srcdir}/move-if-change src
/Makefile.tmp src
/Makefile
277 chmod
-w src
/Makefile
279 oldXMenu
/Makefile
: ${srcdir}/oldXMenu
/Makefile Makefile
280 echo
"Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
281 rm -f src
/Makefile.tmp
282 cp
"${srcdir}"/oldXMenu
/Makefile oldXMenu
/Makefile
288 # ==================== Installation ====================
290 ## If we let lib-src do its own installation, that means we
291 ## don't have to duplicate the list of utilities to install in
292 ## this Makefile as well.
294 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
295 -set
${COPYDESTS} ; \
296 for
dir in
${COPYDIR} ; do \
298 if
[ `(cd $${dir}; /bin/pwd)` != `(cd $${dest}; /bin/pwd)` ]; then \
299 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xf
- ) ; \
300 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
301 rm -rf
$${subdir}/RCS
; \
302 rm -rf
$${subdir}/CVS
; \
303 rm -f
$${subdir}/\
#* ; \
304 rm -f
$${subdir}/*~
; \
309 if
[ ! -f
${infodir}/dir ]; then \
310 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 .
/dir ${infodir}/dir ; \
312 if
[ "`echo *.info*`" != "*.info*" ]; then \
313 for f in
*.
info* ; do \
314 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 $$f ${infodir}/$$f ; \
317 for page in emacs etags ctags
; do \
318 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 etc
/$${page}.1 \
319 ${mandir}/$${page}${manext} ; \
321 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -m
1755 src
/emacs \
322 ${bindir}/emacs-
${version}
323 -rm -f
${bindir}/emacs
324 ln
${bindir}/emacs-
${version} ${bindir}/emacs
326 ## If we let lib-src do its own installation, that means we
327 ## don't have to duplicate the list of utilities to install in
328 ## this Makefile as well.
329 install.sysv
: all mkdir
330 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
331 -set
${COPYDESTS} ; \
332 for
dir in
${COPYDIR} ; do \
334 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
335 (cd
$${dir}; find .
-print | cpio
-pdum
$${dest} ) ; \
336 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
337 rm -rf
$${subdir}/RCS
; \
338 rm -rf
$${subdir}/CVS
; \
339 rm -f
$${subdir}/\
#* ; \
340 rm -f
$${subdir}/*~
; \
345 if
[ ! -f
${infodir}/dir ]; then \
346 cpset .
/dir ${infodir} 444 bin bin
; \
348 if
[ "`echo *.info*`" != "*.info*" ]; then \
349 for f in
*.
info* ; do \
350 cpset
$$f ${infodir} 444 bin bin
; \
353 -for page in emacs etags ctags
; do \
354 cpset etc
/$${page}.1 ${mandir}/$${page}${manext} 444 bin bin
; \
356 -/bin
/rm -f
${bindir}/emacs
357 -cpset src
/emacs
${bindir}/emacs-
${version} 1755 bin bin
358 -ln
${bindir}/emacs-
${version} ${bindir}/emacs
360 ## If we let lib-src do its own installation, that means we
361 ## don't have to duplicate the list of utilities to install in
362 ## this Makefile as well.
363 install.xenix
: all mkdir
364 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
365 -set
${COPYDESTS} ; \
366 for
dir in
${COPYDIR} ; do \
368 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
369 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xpf
- ) ; \
370 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
371 rm -rf
$${subdir}/RCS
; \
372 rm -rf
$${subdir}/CVS
; \
373 rm -f
$${subdir}/\
#* ; \
374 rm -f
$${subdir}/*~
; \
379 if
[ ! -f
${infodir}/dir ]; then \
380 cp .
/dir ${infodir} ; \
381 chmod
444 ${infodir}/dir ; \
383 if
[ "`echo *.info*`" != "*.info*" ]; then \
384 for f in
*.
info* ; do \
385 cp
$$f ${infodir} ; \
386 chmod
444 ${infodir}/$$f ; \
389 for page in emacs etags ctags
; do \
390 cp etc
/$${page}.1 ${mandir}/$${page}${manext} ; \
391 chmod
444 ${mandir}/$${page}${manext} ; \
393 -mv
-f
${bindir}/emacs
${bindir}/emacs.old
394 cp src
/emacs
${bindir}/emacs-
${version}
395 ln
${bindir}/emacs-
${version} ${bindir}/emacs
396 chmod
1755 ${bindir}/emacs
397 -rm -f
${bindir}/emacs.old
399 ## If we let lib-src do its own installation, that means we
400 ## don't have to duplicate the list of utilities to install in
401 ## this Makefile as well.
402 install.aix
: all mkdir
403 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
404 -set
${COPYDESTS} ; \
405 for
dir in
${COPYDIR} ; do \
407 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
408 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xBf
- ) ; \
409 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
410 rm -rf
$${subdir}/RCS
; \
411 rm -rf
$${subdir}/CVS
; \
412 rm -f
$${subdir}/\
#* ; \
413 rm -f
$${subdir}/*~
; \
418 if
[ ! -f
${infodir}/dir ]; then \
419 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${infodir} .
/dir ; \
421 if
[ "`echo *.info*`" != "*.info*" ]; then \
422 for f in
*.
info* ; do \
423 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${infodir} $$f ; \
426 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -M
1755 -f
${bindir} src
/emacs
427 mv
${bindir}/emacs
${bindir}/emacs-
${version}
428 for page in emacs etags ctags
; do \
429 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${mandir} etc
/$${page}.1 ;\
431 -rm -f
${bindir}/emacs
432 ln
${bindir}/emacs-
${version} ${bindir}/emacs
434 ### Build all the directories we're going to install Emacs in. Since
435 ### we may be creating several layers of directories (for example,
436 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
437 ### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
439 .
/lib-src
/make-path
${COPYDESTS} ${lockdir}
440 chmod
777 ${COPYDESTS} ${lockdir}
445 # ==================== Cleaning up and miscellanea ====================
448 ### Delete all files from the current directory that are normally
449 ### created by building the program. Don't delete the files that
450 ### record the configuration. Also preserve files that could be made
451 ### by building, but normally aren't because the distribution comes
454 ### Like `clean', but may refrain from deleting a few files that
455 ### people normally don't want to recompile. For example, the
456 ### `mostlyclean' target for GCC does not delete `libgcc.a', because
457 ### recompiling it is rarely necessary and takes a lot of time.
460 cd src
; $(MAKE
) clean
461 cd lib-src
; $(MAKE
) clean
462 cd oldXMenu
; $(MAKE
) clean
463 if
[ `(cd ${etcdir} ; /bin/pwd` != `(cd etc; /bin/pwd)` ] ; then \
464 cd etc
; $(MAKE
) clean; \
469 ### Delete all files from the current directory that are created by
470 ### configuring or building the program. This should leave only the
471 ### files that would be in the distribution.
473 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} distclean); done
475 -rm config.status config-tmp-
*
478 ### Delete everything from the current directory that can be
479 ### reconstructed with this makefile. This typically includes
480 ### everything deleted by distclean, plus more: C source files
481 ### produced by Bison, tags tables, info files, and so on.
483 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} realclean); done
487 ### This doesn't actually appear in the coding standards, but Karl
488 ### says GCC supports it, and that's where the configuration part of
489 ### the coding standards seem to come from. It's like distclean, but
490 ### it deletes backup and autosave files too.
492 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} extraclean
); done
494 -rm config.status config-tmp-
*
497 ### Unlocking and relocking. The idea of these productions is to reduce
498 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
499 ### before unlocking the file to take the write locks off all sources so
500 ### that tar xvof will overwrite them without fuss. Then do `make relock'
501 ### afterward so that VC mode will know which files should be checked in
502 ### if you want to mung them.
504 ### Note: it's no disaster if these productions miss a file or two; tar
505 ### and VC will swiftly let you know if this happens, and it is easily
507 SOURCES
= ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
508 README build-install.in configure make-dist move-if-change
511 chmod u
+w
$(SOURCES
) cpp/*
512 -(cd elisp
; chmod u
+w Makefile README
*.texi
)
513 (cd etc
; make unlock
)
514 (cd lib-src
; make unlock
)
515 (cd lisp
; make unlock
)
516 (cd lisp
/term
; chmod u
+w README
*.el
)
517 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
518 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
519 (cd src
; make unlock
)
522 chmod u-w
$(SOURCES
) cpp/*
523 -(cd elisp
; chmod u-w Makefile README
*.texi
)
524 (cd etc
; make relock
)
525 (cd lib-src
; make relock
)
526 (cd lisp
; make relock
)
527 (cd lisp
/term
; chmod u
+w README
*.el
)
528 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
529 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
530 (cd src
; make relock
)
533 (cd
${srcdir} ; lib-src
/etags
--output
=.
/src
/TAGS \
534 src
/*.
[ch
] lisp
/*.el lisp
/term
/*.el
)
537 @echo
"We don't have any tests for GNU Emacs yet."
540 cd
${srcdir}; make-dist