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 elisp 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 # Directories Emacs should search for elisp files specific to this
115 # site (i.e. customizations), before consulting ${lispdir}. This
116 # should be a colon-separated list of directories.
117 locallisppath
=${datadir}/emacs
/local-lisp
119 # Where Emacs will search to find its elisp files. Before changing
120 # this, check to see if your purpose wouldn't better be served by
121 # changing locallisppath. This should be a colon-separated list of
123 lisppath
=${locallisppath}:${lispdir}
125 # Where Emacs will search for its elisp files while building. This is
126 # only used during the process of compiling Emacs, to help Emacs find
127 # its lisp files before they've been installed in their final
128 # location. It's usually identical to lisppath, except that the entry
129 # for the directory containing the installed lisp files has been
130 # replaced with ../lisp. This should be a colon-separated list of
132 buildlisppath
=..
/lisp
134 # Where to install the other architecture-independent data files
135 # distributed with Emacs (like the tutorial, the cookie recipes and
136 # the Zippy database). This path usually contains the Emacs version
137 # number, so the data files for multiple versions of Emacs may be
139 etcdir
=${datadir}/emacs
/${version}/etc
141 # Where to create and expect the locking directory, where the Emacs
142 # locking code keeps track of which files are currently being edited.
143 lockdir
=${statedir}/emacs
/lock
145 # Where to put executables to be run by Emacs rather than the user.
146 # This path usually includes the Emacs version and configuration name,
147 # so that multiple configurations for multiple versions of Emacs may
148 # be installed at once.
149 archlibdir
=${libdir}/emacs
/${version}/${configname}
151 # ==================== Utility Programs for the Build ====================
153 # Allow the user to specify the install program.
156 INSTALL_PROGRAM
= ${INSTALL}
157 INSTALL_DATA
= ${INSTALL}
159 # ============================= Targets ==============================
161 # Flags passed down to subdirectory makefiles.
164 CFLAGS
=${CONFIG_CFLAGS}
166 # Subdirectories to make recursively. `lisp' is not included
167 # because the compiled lisp files are part of the distribution
168 # and you cannot remake them without installing Emacs first.
171 # The makefiles of the directories in $SUBDIR.
172 SUBDIR_MAKEFILES
= lib-src
/Makefile src
/Makefile
174 # Subdirectories to install, and where they'll go. lib-src's makefile
175 # knows how to install it, so we don't do that here.
176 COPYDIR
= etc
${srcdir}/info ${srcdir}/lisp
177 COPYDESTS
= ${etcdir} ${infodir} ${lispdir}
179 all: src
/paths.h
${SUBDIR}
181 removenullpaths
=sed
-e
's/^://' -e
's/:$$//' -e
's/::/:/'
183 # We force the rebuilding of src/paths.h because the user might give
184 # make different values for the various directories. Since we use
185 # move-if-change, src/paths.h only actually changes if the user did
186 # something notable, so the only unnecessary work we do is in building
187 # src/paths.h.tmp, which isn't much.
188 # Note that sed is not in /bin on 386bsd.
189 src
/paths.h
: Makefile
${srcdir}/src
/paths.h.in FRC
190 lisppath
=`echo ${lisppath} | ${removenullpaths}` ; \
191 buildlisppath
=`echo ${buildlisppath} | ${removenullpaths}` ; \
192 sed
< ${srcdir}/src
/paths.h.in
> src
/paths.h.tmp \
193 -e
's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
194 -e
's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
195 -e
's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
196 -e
's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
197 -e
's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";'
198 ${srcdir}/move-if-change src
/paths.h.tmp src
/paths.h
202 .RECURSIVE
: ${SUBDIR}
204 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
205 cd
$@
; $(MAKE
) all ${MFLAGS} \
206 CC
='${CC}' CFLAGS
='${CFLAGS}' \
207 srcdir='${srcdir}/$@' libdir='${libdir}'
209 ## We build the makefiles for the subdirectories here so that we can
210 ## edit the values for the path variables into them. This means that
211 ## when the user has built them from this makefile once, they will use
212 ## the right default values for the path variables.
213 lib-src
/Makefile
: ${srcdir}/lib-src
/Makefile.in Makefile
214 echo
"Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'."
215 rm -f lib-src
/Makefile.tmp
216 (echo
"# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \
217 echo
"# If you are thinking about editing it, you should seriously consider" ; \
218 echo
"# running \`make lib-src/Makefile' at the top of the" ; \
219 echo
"# Emacs build tree instead, or editing" ; \
220 echo
"# \`${srcdir}/lib-src/Makefile.in' itself." ; \
221 /bin
/sed
< ${srcdir}/lib-src
/Makefile.in \
222 -e
's|^\(version *=\).*$$|\1'"${version}"'|' \
223 -e
's|^\(configname *=\).*$$|\1'"${configname}"'|' \
224 -e
's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \
225 -e
's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \
226 -e
's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \
227 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
228 -e
's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \
229 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
230 -e
's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
231 -e
's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|' \
232 -e
'/^# DIST: /d') > lib-src
/Makefile.tmp
233 ${srcdir}/move-if-change lib-src
/Makefile.tmp lib-src
/Makefile
234 # Remind people not to edit this.
235 chmod
-w lib-src
/Makefile
237 src
/Makefile
: ${srcdir}/src
/Makefile.in Makefile
238 echo
"Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
239 rm -f src
/Makefile.tmp
240 (echo
"# This file is generated from \`${srcdir}/src/Makefile.in'." ; \
241 echo
"# If you are thinking about editing it, you should seriously consider" ; \
242 echo
"# running \`make src/Makefile' at the top of the" ; \
243 echo
"# Emacs build tree instead, or editing" ; \
244 echo
"# \`${srcdir}/src/Makefile.in' itself." ; \
245 /bin
/sed
< ${srcdir}/src
/Makefile.in \
246 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
247 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
248 -e
's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
249 -e
'/^# DIST: /d') > src
/Makefile.tmp
250 ${srcdir}/move-if-change src
/Makefile.tmp src
/Makefile
251 # Remind people not to edit this.
252 chmod
-w src
/Makefile
254 oldXMenu
/Makefile
: ${srcdir}/oldXMenu
/Makefile Makefile
255 echo
"Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
256 rm -f src
/Makefile.tmp
257 cp
"${srcdir}"/oldXMenu
/Makefile oldXMenu
/Makefile
263 # ==================== Installation ====================
266 ## If we let lib-src do its own installation, that means we
267 ## don't have to duplicate the list of utilities to install in
268 ## this Makefile as well.
269 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
270 -set
${COPYDESTS} ; \
271 for
dir in
${COPYDIR} ; do \
273 if
[ `(cd $${dir}; /bin/pwd)` != `(cd $${dest}; /bin/pwd)` ]; then \
274 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xf
- ) ; \
275 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
276 rm -rf
$${subdir}/RCS
; \
277 rm -f
$${subdir}/\
#* ; \
278 rm -f
$${subdir}/*~
; \
283 if
[ ! -f
${infodir}/dir ]; then \
284 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 .
/dir ${infodir}/dir ; \
286 if
[ "`echo *.info*`" != "*.info*" ]; then \
287 for f in
*.
info* ; do \
288 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 $$f ${infodir}/$$f ; \
291 for page in emacs etags ctags
; do \
292 ${INSTALL_DATA} ${INSTALLFLAGS} -m
444 etc
/$${page}.1 \
293 ${mandir}/$${page}${manext} ; \
295 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -m
1755 src
/emacs \
296 ${bindir}/emacs-
${version}
297 -rm -f
${bindir}/emacs
298 ln
${bindir}/emacs-
${version} ${bindir}/emacs
300 install.sysv
: all mkdir
301 ## If we let lib-src do its own installation, that means we
302 ## don't have to duplicate the list of utilities to install in
303 ## this Makefile as well.
304 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
305 -set
${COPYDESTS} ; \
306 for
dir in
${COPYDIR} ; do \
308 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
309 (cd
$${dir}; find .
-print | cpio
-pdum
${dest} ) ; \
310 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
311 rm -rf
$${subdir}/RCS
; \
312 rm -f
$${subdir}/\
#* ; \
313 rm -f
$${subdir}/*~
; \
318 if
[ ! -f
${infodir}/dir ]; then \
319 cpset .
/dir ${infodir} 444 bin bin
; \
321 if
[ "`echo *.info*`" != "*.info*" ]; then \
322 for f in
*.
info* ; do \
323 cpset
$$f ${infodir} 444 bin bin
; \
326 -for page in emacs etags ctags
; do \
327 cpset etc
/$${page}.1 ${mandir}/$${page}${manext} 444 bin bin
; \
329 -/bin
/rm -f
${bindir}/emacs
330 -cpset src
/emacs
${bindir}/emacs-
${version} 1755 bin bin
331 -ln
${bindir}/emacs-
${version} ${bindir}/emacs
333 install.xenix
: all mkdir
334 ## If we let lib-src do its own installation, that means we
335 ## don't have to duplicate the list of utilities to install in
336 ## this Makefile as well.
337 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
338 -set
${COPYDESTS} ; \
339 for
dir in
${COPYDIR} ; do \
341 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
342 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xpf
- ) ; \
343 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
344 rm -rf
$${subdir}/RCS
; \
345 rm -f
$${subdir}/\
#* ; \
346 rm -f
$${subdir}/*~
; \
351 if
[ ! -f
${infodir}/dir ]; then \
352 cp .
/dir ${infodir} ; \
353 chmod
444 ${infodir}/dir ; \
355 if
[ "`echo *.info*`" != "*.info*" ]; then \
356 for f in
*.
info* ; do \
357 cp
$$f ${infodir} ; \
358 chmod
444 ${infodir}/$$f ; \
361 for page in emacs etags ctags
; do \
362 cp etc
/$${page}.1 ${mandir}/$${page}${manext} ; \
363 chmod
444 ${mandir}/$${page}${manext} ; \
365 -mv
-f
${bindir}/emacs
${bindir}/emacs.old
366 cp src
/emacs
${bindir}/emacs-
${version}
367 ln
${bindir}/emacs-
${version} ${bindir}/emacs
368 chmod
1755 ${bindir}/emacs
369 -rm -f
${bindir}/emacs.old
371 install.aix
: all mkdir
372 ## If we let lib-src do its own installation, that means we
373 ## don't have to duplicate the list of utilities to install in
374 ## this Makefile as well.
375 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
376 -set
${COPYDESTS} ; \
377 for
dir in
${COPYDIR} ; do \
379 if
[ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
380 (cd
$${dir}; tar cf
- .
) |
(cd
$${dest}; umask
0; tar xBf
- ) ; \
381 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
382 rm -rf
$${subdir}/RCS
; \
383 rm -f
$${subdir}/\
#* ; \
384 rm -f
$${subdir}/*~
; \
389 if
[ ! -f
${infodir}/dir ]; then \
390 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${infodir} .
/dir ; \
392 if
[ "`echo *.info*`" != "*.info*" ]; then \
393 for f in
*.
info* ; do \
394 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${infodir} $$f ; \
397 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -M
1755 -f
${bindir} src
/emacs
398 mv
${bindir}/emacs
${bindir}/emacs-
${version}
399 for page in emacs etags ctags
; do \
400 ${INSTALL_DATA} ${INSTALLFLAGS} -M
444 -f
${mandir} etc
/$${page}.1 ;\
402 -rm -f
${bindir}/emacs
403 ln
${bindir}/emacs-
${version} ${bindir}/emacs
405 ### Build all the directories we're going to install Emacs in. Since
406 ### we may be creating several layers of directories (for example,
407 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
408 ### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
410 .
/lib-src
/make-path
${COPYDESTS} ${lockdir}
411 chmod
777 ${COPYDESTS} ${lockdir}
416 # ==================== Cleaning up and miscellanea ====================
419 ### Delete all files from the current directory that are normally
420 ### created by building the program. Don't delete the files that
421 ### record the configuration. Also preserve files that could be made
422 ### by building, but normally aren't because the distribution comes
425 ### Like `clean', but may refrain from deleting a few files that
426 ### people normally don't want to recompile. For example, the
427 ### `mostlyclean' target for GCC does not delete `libgcc.a', because
428 ### recompiling it is rarely necessary and takes a lot of time.
431 cd src
; $(MAKE
) clean
432 cd lib-src
; $(MAKE
) clean
433 cd oldXMenu
; $(MAKE
) clean
434 if
[ `(cd ${etcdir} ; /bin/pwd` != `(cd etc; /bin/pwd)` ] ; then \
435 cd etc
; $(MAKE
) clean; \
440 ### Delete all files from the current directory that are created by
441 ### configuring or building the program. This should leave only the
442 ### files that would be in the distribution.
444 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} distclean); done
446 -rm config.status config-tmp-
*
449 ### Delete everything from the current directory that can be
450 ### reconstructed with this makefile. This typically includes
451 ### everything deleted by distclean, plus more: C source files
452 ### produced by Bison, tags tables, info files, and so on.
454 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} realclean); done
458 ### This doesn't actually appear in the coding standards, but Karl
459 ### says GCC supports it, and that's where the configuration part of
460 ### the coding standards seem to come from. It's like distclean, but
461 ### it deletes backup and autosave files too.
463 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} extraclean
); done
465 -rm config.status config-tmp-
*
470 (cd
${srcdir} ; lib-src
/etags
--output
=.
/src
/TAGS \
471 src
/*.
[ch
] lisp
/*.el lisp
/term
/*.el
)
474 @echo
"We don't have any tests for GNU Emacs yet."
477 cd
${srcdir}; make-dist