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
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.
35 MAKE
= make
# BSD doesn't have it as a default.
37 # ==================== Things `configure' Might Edit ====================
40 C_SWITCH_SYSTEM
=@c_switch_system@
45 ### These help us choose version- and architecture-specific directories
46 ### to install files in.
48 ### This should be the number of the Emacs version we're building,
49 ### like `18.59' or `19.0'.
52 ### This should be the name of the configuration we're building Emacs
53 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
54 configuration
=@configuration@
56 ### Libraries which should be edited into lib-src/Makefile.
57 libsrc_libs
=@libsrc_libs@
59 # ==================== Where To Install Things ====================
61 # The default location for installation. Everything is placed in
62 # subdirectories of this directory. The default values for many of
63 # the variables below are expressed in terms of this one, so you may
64 # not need to change them.
67 # Like `prefix', but used for architecture-specific files.
70 # Where to install Emacs and other binaries that people will want to
71 # run directly (like etags).
72 bindir=${exec_prefix}/bin
74 # Where to install architecture-independent data files. ${lispdir}
75 # and ${etcdir} are subdirectories of this.
78 # Where to install and expect the files that Emacs modifies as it
79 # runs. These files are all architecture-independent. Right now, the
80 # only such data is the locking directory; ${lockdir} is a
81 # subdirectory of this.
82 statedir=${prefix}/lib
84 # Where to install and expect executable files to be run by Emacs
85 # rather than directly by users, and other architecture-dependent
86 # data. ${archlibdir} is a subdirectory of this.
87 libdir=${exec_prefix}/lib
89 # Where to install Emacs's man pages, and what extension they should have.
90 mandir=${prefix}/man
/man1
93 # Where to install and expect the info files describing Emacs. In the
94 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
95 # since there are now many packages documented with the texinfo
96 # system, it is inappropriate to imply that it is part of Emacs.
97 infodir=${prefix}/info
99 # Where to find the source code - setting this to anything but
100 # . doesn't work yet. The source code for Emacs's C kernel is
101 # expected to be in ${srcdir}/src, and the source code for Emacs's
102 # utility programs is expected to be in ${srcdir}/lib-src. This is
103 # set by the configure script's `--srcdir' option.
106 # ==================== Emacs-specific directories ====================
108 # These variables hold the values Emacs will actually use. They are
109 # based on the values of the standard Make variables above.
111 @inst_paths@
# Where to install the lisp files distributed with
112 @inst_paths@
# Emacs. This includes the Emacs version, so that the
113 @inst_paths@
# lisp files for different versions of Emacs will install
114 @inst_paths@
# themselves in separate directories.
115 @inst_paths@lispdir
=${datadir}/emacs
/${version}/lisp
117 @inst_paths@
# Where to install the lisp files which are distributed
118 @inst_paths@
# with Emacs but not maintained by the FSF. This
119 @inst_paths@
# includes the Emacs version, so that the lisp files for
120 @inst_paths@
# different versions of Emacs will install themselves in
121 @inst_paths@
# separate directories.
122 @inst_paths@externallispdir
=${datadir}/emacs
/${version}/external-lisp
124 @inst_paths@
# Directories Emacs should search for lisp files specific
125 @inst_paths@
# to this site (i.e. customizations), before consulting
126 @inst_paths@
# ${lispdir}. This should be a colon-separated list of
127 @inst_paths@
# directories.
128 @inst_paths@locallisppath
=${datadir}/emacs
/site-lisp
130 # Where Emacs will search to find its lisp files. Before
131 # changing this, check to see if your purpose wouldn't
132 # better be served by changing locallisppath. This
133 # should be a colon-separated list of directories.
134 lisppath
=${locallisppath}:${lispdir}
136 # Where Emacs will search for its lisp files while
137 # building. This is only used during the process of
138 # compiling Emacs, to help Emacs find its lisp files
139 # before they've been installed in their final location.
140 # It's usually identical to lisppath, except that the
141 # entry for the directory containing the installed lisp
142 # files has been replaced with ../lisp. This should be a
143 # colon-separated list of directories.
144 buildlisppath
=${srcdir}/lisp
146 @inst_paths@
# Where to install the other architecture-independent
147 @inst_paths@
# data files distributed with Emacs (like the tutorial,
148 @inst_paths@
# the cookie recipes and the Zippy database). This path
149 @inst_paths@
# usually contains the Emacs version number, so the data
150 @inst_paths@
# files for multiple versions of Emacs may be installed
151 @inst_paths@
# at once.
152 @inst_paths@etcdir
=${datadir}/emacs
/${version}/etc
154 @inst_paths@
# Where to create and expect the locking directory, where
155 @inst_paths@
# the Emacs locking code keeps track of which files are
156 @inst_paths@
# currently being edited.
157 @inst_paths@lockdir
=${statedir}/emacs
/lock
159 @inst_paths@
# Where to put executables to be run by Emacs rather than
160 @inst_paths@
# the user. This path usually includes the Emacs version
161 @inst_paths@
# and configuration name, so that multiple configurations
162 @inst_paths@
# for multiple versions of Emacs may be installed at
164 @inst_paths@archlibdir
=${libdir}/emacs
/${version}/${configuration}
166 # ====================== Developer's configuration =======================
168 # The following assignments make sense if you're running Emacs on a single
169 # machine, one version at a time, and you want changes to the lisp and etc
170 # directories in the source tree to show up immediately in your working
171 # environment. It saves a great deal of disk space by not duplicating the
172 # lisp and etc directories.
174 @rip_paths@lispdir
=${srcdir}/lisp
175 @rip_paths@externallispdir
=${srcdir}/externallisp
176 @rip_paths@locallisppath
=${datadir}/emacs
/site-lisp
177 @rip_paths@etcdir
=${srcdir}/etc
178 @rip_paths@lockdir
=${srcdir}/lock
179 @rip_paths@archlibdir
=${srcdir}/lib-src
180 @rip_paths@
infodir=${srcdir}/info
182 # ==================== Utility Programs for the Build ====================
184 # Allow the user to specify the install program.
186 INSTALL_PROGRAM
= ${INSTALL}
187 INSTALL_DATA
= ${INSTALL}
189 # ============================= Targets ==============================
191 # Flags passed down to subdirectory makefiles.
194 # Subdirectories to make recursively. `lisp' is not included
195 # because the compiled lisp files are part of the distribution
196 # and you cannot remake them without installing Emacs first.
199 # The makefiles of the directories in $SUBDIR.
200 SUBDIR_MAKEFILES
= lib-src
/Makefile src
/Makefile oldXMenu
/Makefile
202 # Subdirectories to install, and where they'll go.
203 # lib-src's makefile knows how to install it, so we don't do that here.
204 # When installing the info files, we need to do special things to
205 # avoid nuking an existing dir file, so we don't do that here;
206 # instead, we have written out explicit code in the `install' targets.
207 COPYDIR
= etc
${srcdir}/etc
${srcdir}/lisp
${srcdir}/external-lisp
208 COPYDESTS
= ${etcdir} ${etcdir} ${lispdir} ${externallispdir}
210 all: src
/paths.h
${SUBDIR}
212 removenullpaths
=sed
-e
's/^://' -e
's/:$$//' -e
's/::/:/'
214 # We force the rebuilding of src/paths.h because the user might give
215 # make different values for the various directories. Since we use
216 # move-if-change, src/paths.h only actually changes if the user did
217 # something notable, so the only unnecessary work we do is in building
218 # src/paths.h.tmp, which isn't much.
219 # Note that sed is not in /bin on 386bsd.
220 src
/paths.h
: Makefile
${srcdir}/src
/paths.h.in FRC
221 @echo
"Producing \`src/paths.h' from \`src/paths.h.in'."
222 @
(lisppath
=`echo ${lisppath} | ${removenullpaths}` ; \
223 buildlisppath
=`echo ${buildlisppath} | ${removenullpaths}` ; \
224 sed
< ${srcdir}/src
/paths.h.in
> src
/paths.h.tmp \
225 -e
's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
226 -e
's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
227 -e
's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
228 -e
's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
229 -e
's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";')
230 @
${srcdir}/move-if-change src
/paths.h.tmp src
/paths.h
234 .RECURSIVE
: ${SUBDIR}
236 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
237 cd
$@
; $(MAKE
) all ${MFLAGS} \
238 CC
='${CC}' CFLAGS
='${CFLAGS}' prefix='${prefix}' \
239 srcdir='${srcdir}/$@' libdir='${libdir}'
241 ## We build the makefiles for the subdirectories here so that we can
242 ## edit the values for the path variables into them. This means that
243 ## when the user has built them from this makefile once, they will use
244 ## the right default values for the path variables.
245 lib-src
/Makefile
: ${srcdir}/lib-src
/Makefile.in Makefile
246 rm -f lib-src
/Makefile.tmp
247 @echo
"Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'."
248 @
(echo
"# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \
249 echo
"# If you are thinking about editing it, you should seriously consider" ; \
250 echo
"# running \`make lib-src/Makefile' at the top of the" ; \
251 echo
"# Emacs build tree instead, or editing" ; \
252 echo
"# \`${srcdir}/lib-src/Makefile.in' itself." ; \
253 sed
< ${srcdir}/lib-src
/Makefile.in \
254 -e
's|^\(version *=\).*$$|\1'"${version}"'|' \
255 -e
's|^\(configname *=\).*$$|\1'"${configuration}"'|' \
256 -e
's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \
257 -e
's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \
258 -e
's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \
259 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/lib-src|' \
260 -e
's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/lib-src|' \
261 -e
's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \
262 -e
's|^\(ALLOCA *=\).*$$|\1'"${ALLOCA}"'|' \
263 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
264 -e
's|^CFLAGS *=.*$$|CFLAGS='"${CFLAGS}"'|' \
265 -e
's|^C_SWITCH_SYSTEM *=.*$$|C_SWITCH_SYSTEM='"${C_SWITCH_SYSTEM}"'|' \
266 -e
's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|' \
267 -e
'/^# DIST: /d') > lib-src
/Makefile.tmp
268 @
${srcdir}/move-if-change lib-src
/Makefile.tmp lib-src
/Makefile
269 chmod
-w lib-src
/Makefile
271 src
/Makefile
: ${srcdir}/src
/Makefile.in Makefile
272 rm -f src
/Makefile.tmp
273 @echo
"Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
274 @
(echo
"# This file is generated from \`${srcdir}/src/Makefile.in'." ; \
275 echo
"# If you are thinking about editing it, you should seriously consider" ; \
276 echo
"# running \`make src/Makefile' at the top of the" ; \
277 echo
"# Emacs build tree instead, or editing" ; \
278 echo
"# \`${srcdir}/src/Makefile.in' itself." ; \
279 sed
< ${srcdir}/src
/Makefile.in \
280 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/src|' \
281 -e
's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/src|' \
282 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
283 -e
's|^LN_S *=.*$$|LN_S='"${LN_S}"'|' \
284 -e
's|^CFLAGS *=.*$$|CFLAGS='"${CFLAGS}"'|' \
285 -e
'/^# DIST: /d') > src
/Makefile.tmp
286 @
${srcdir}/move-if-change src
/Makefile.tmp src
/Makefile
287 chmod
-w src
/Makefile
289 oldXMenu
/Makefile
: ${srcdir}/oldXMenu
/Makefile.in Makefile
290 rm -f oldXMenu
/Makefile.tmp
291 @echo
"Producing \`oldXMenu/Makefile' from \`${srcdir}/oldXMenu/Makefile'."
292 @
(echo
"# This file is generated from \`${srcdir}/oldXMenu/Makefile'." ; \
293 echo
"# If you are thinking about editing it, you should seriously consider" ; \
294 echo
"# running \`make oldXMenu/Makefile' at the top of the" ; \
295 echo
"# Emacs build tree instead, or editing" ; \
296 echo
"# \`${srcdir}/oldXMenu/Makefile.in' itself." ; \
297 sed
< ${srcdir}/oldXMenu
/Makefile.in \
298 -e
's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/oldXMenu|' \
299 -e
's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/oldXMenu|' \
300 -e
's|^CC *=.*$$|CC='"${CC}"'|' \
301 -e
's|^DEFS *=.*$$|DEFS='"${DEFS}"'|' \
302 -e
'/^# DIST: /d') > oldXMenu
/Makefile.tmp
303 @
${srcdir}/move-if-change oldXMenu
/Makefile.tmp oldXMenu
/Makefile
304 chmod
-w oldXMenu
/Makefile
309 # ==================== Installation ====================
311 ## If we let lib-src do its own installation, that means we
312 ## don't have to duplicate the list of utilities to install in
313 ## this Makefile as well.
315 ## On AIX, use tar xBf.
316 ## On Xenix, use tar xpf.
318 ## We delete each directory in ${COPYDESTS} before we copy into it;
319 ## that way, we can reinstall over directories that have been put in
320 ## place with their files read-only (perhaps because they are checked
321 ## into RCS). In order to make this safe, we make sure that the
322 ## source exists and is distinct from the destination.
324 (cd lib-src
; $(MAKE
) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
325 -set
${COPYDESTS} ; \
326 for
dir in
${COPYDIR} ; do \
329 && [ `(cd $${dir}; /bin/pwd)` != `(cd $${dest}; /bin/pwd)` ] \
330 && (echo
"Copying $${dir}..." ; \
331 rm -rf
$${dest} ; mkdir
$${dest} ; \
332 (cd
$${dir}; tar cf
- .
)|
(cd
$${dest}; umask
0; tar xvf
- ); \
333 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
334 rm -rf
$${subdir}/RCS
; \
335 rm -rf
$${subdir}/CVS
; \
336 rm -f
$${subdir}/\
#* ; \
337 rm -f
$${subdir}/*~
; \
340 -(cd
${srcdir}/info ; \
341 if
[ ! -f
${infodir}/dir ] && [ -f
dir ]; then \
342 ${INSTALL_DATA} dir ${infodir}/dir ; \
344 if
[ "`echo *.info*`" != "*.info*" ]; then \
345 for f in
*.
info* ; do \
346 ${INSTALL_DATA} $$f ${infodir}/$$f ; \
349 cd
${srcdir}/etc
; for page in emacs etags ctags
; do \
350 ${INSTALL_DATA} $${page}.1 ${mandir}/$${page}${manext} ; \
352 ${INSTALL_PROGRAM} src
/emacs
${bindir}/emacs-
${version}
353 chmod
1755 ${bindir}/emacs-
${version}
354 rm -f
${bindir}/emacs
355 ln
${bindir}/emacs-
${version} ${bindir}/emacs
357 ### Build all the directories we're going to install Emacs in. Since
358 ### we may be creating several layers of directories (for example,
359 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
360 ### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
362 .
/lib-src
/make-path
${COPYDESTS} ${lockdir}
363 chmod
777 ${COPYDESTS} ${lockdir}
368 # ==================== Cleaning up and miscellanea ====================
371 ### Delete all files from the current directory that are normally
372 ### created by building the program. Don't delete the files that
373 ### record the configuration. Also preserve files that could be made
374 ### by building, but normally aren't because the distribution comes
377 ### Like `clean', but may refrain from deleting a few files that
378 ### people normally don't want to recompile. For example, the
379 ### `mostlyclean' target for GCC does not delete `libgcc.a', because
380 ### recompiling it is rarely necessary and takes a lot of time.
383 cd src
; $(MAKE
) clean
384 cd lib-src
; $(MAKE
) clean
385 cd oldXMenu
; $(MAKE
) clean
386 if
[ `(cd ${etcdir} ; /bin/pwd)` != `(cd etc; /bin/pwd)` ] ; then \
387 cd etc
; $(MAKE
) clean; \
392 ### Delete all files from the current directory that are created by
393 ### configuring or building the program. This should leave only the
394 ### files that would be in the distribution.
396 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} distclean); done
398 -rm config.status config-tmp-
*
401 ### Delete everything from the current directory that can be
402 ### reconstructed with this makefile. This typically includes
403 ### everything deleted by distclean, plus more: C source files
404 ### produced by Bison, tags tables, info files, and so on.
406 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} realclean); done
410 ### This doesn't actually appear in the coding standards, but Karl
411 ### says GCC supports it, and that's where the configuration part of
412 ### the coding standards seem to come from. It's like distclean, but
413 ### it deletes backup and autosave files too.
415 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) ${MFLAGS} extraclean
); done
417 -rm config.status config-tmp-
*
420 ### Unlocking and relocking. The idea of these productions is to reduce
421 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
422 ### before unlocking the file to take the write locks off all sources so
423 ### that tar xvof will overwrite them without fuss. Then do `make relock'
424 ### afterward so that VC mode will know which files should be checked in
425 ### if you want to mung them.
427 ### Note: it's no disaster if these productions miss a file or two; tar
428 ### and VC will swiftly let you know if this happens, and it is easily
430 SOURCES
= ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
431 README build-install.in configure make-dist move-if-change
434 chmod u
+w
$(SOURCES
) cpp/*
435 -(cd elisp
; chmod u
+w Makefile README
*.texi
)
436 (cd etc
; make unlock
)
437 (cd lib-src
; make unlock
)
438 (cd lisp
; make unlock
)
439 (cd lisp
/term
; chmod u
+w README
*.el
)
440 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
441 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
442 (cd src
; make unlock
)
445 chmod u-w
$(SOURCES
) cpp/*
446 -(cd elisp
; chmod u-w Makefile README
*.texi
)
447 (cd etc
; make relock
)
448 (cd lib-src
; make relock
)
449 (cd lisp
; make relock
)
450 (cd lisp
/term
; chmod u
+w README
*.el
)
451 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
452 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
453 (cd src
; make relock
)
456 (cd
${srcdir} ; lib-src
/etags
--output
=.
/src
/TAGS \
457 src
/*.
[ch
] lisp
/*.el lisp
/term
/*.el
)
460 @echo
"We don't have any tests for GNU Emacs yet."
463 cd
${srcdir}; make-dist