Commit | Line | Data |
---|---|---|
067d23c9 KY |
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 | |
3 | # DIST: that first. | |
4 | ||
ab422c4d | 5 | # Copyright (C) 1992-2013 Free Software Foundation, Inc. |
067d23c9 KY |
6 | |
7 | # This file is part of GNU Emacs. | |
8 | ||
9 | # GNU Emacs is free software: you can redistribute it and/or modify | |
10 | # it under the terms of the GNU General Public License as published by | |
11 | # the Free Software Foundation, either version 3 of the License, or | |
12 | # (at your option) any later version. | |
13 | ||
14 | # GNU Emacs is distributed in the hope that it will be useful, | |
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | # GNU General Public License for more details. | |
18 | ||
19 | # You should have received a copy of the GNU General Public License | |
20 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
21 | ||
22 | ### Commentary: | |
23 | ||
24 | # make all to compile and build Emacs. | |
25 | # make install to install it. | |
26 | # make TAGS to update tags tables. | |
27 | # | |
28 | # make clean or make mostlyclean | |
29 | # Delete all files from the current directory that are normally | |
30 | # created by building the program. Don't delete the files that | |
31 | # record the configuration. Also preserve files that could be made | |
32 | # by building, but normally aren't because the distribution comes | |
33 | # with them. | |
34 | # | |
35 | # Delete `.dvi' files here if they are not part of the distribution. | |
36 | # | |
37 | # make distclean | |
38 | # Delete all files from the current directory that are created by | |
39 | # configuring or building the program. If you have unpacked the | |
40 | # source and built the program without creating any other files, | |
41 | # `make distclean' should leave only the files that were in the | |
42 | # distribution. | |
43 | # | |
44 | # make maintainer-clean | |
45 | # Delete everything from the current directory that can be | |
46 | # reconstructed with this Makefile. This typically includes | |
47 | # everything deleted by distclean, plus more: .elc files, | |
48 | # C source files produced by Bison, tags tables, info files, | |
49 | # and so on. | |
50 | # | |
51 | # make extraclean | |
52 | # Still more severe - delete backup and autosave files, too. | |
53 | # | |
54 | # make bootstrap | |
55 | # Removes all the compiled files to force a new bootstrap from a | |
56 | # clean slate, and then build in the normal way. | |
b59a2e9e PE |
57 | # |
58 | # make docs | |
59 | # Make Emacs documentation files from their sources; requires makeinfo. | |
067d23c9 KY |
60 | |
61 | SHELL = /bin/sh | |
62 | ||
63 | # This may not work with certain non-GNU make's. It only matters when | |
64 | # inheriting a CDPATH not starting with the current directory. | |
65 | CDPATH= | |
66 | ||
67 | # If Make doesn't predefine MAKE, set it here. | |
68 | @SET_MAKE@ | |
69 | ||
4c9a1377 PE |
70 | # Prevent submakes from outputting "Entering directory ..." and |
71 | # "Leaving directory..." diagnostics that would mess up 'make echo-info'. | |
72 | QUIET_SUBMAKE = MAKELEVEL=0 | |
73 | ||
067d23c9 KY |
74 | # ==================== Things `configure' Might Edit ==================== |
75 | ||
6c269a38 | 76 | cache_file = @cache_file@ |
501390c5 | 77 | CONFIGURE_FLAGS = --cache-file=$(cache_file) |
6c269a38 | 78 | |
067d23c9 KY |
79 | CC=@CC@ |
80 | CFLAGS=@CFLAGS@ | |
81 | LDFLAGS=@LDFLAGS@ | |
82 | CPPFLAGS=@CPPFLAGS@ | |
83 | EXEEXT=@EXEEXT@ | |
067d23c9 KY |
84 | |
85 | ### These help us choose version- and architecture-specific directories | |
86 | ### to install files in. | |
87 | ||
88 | ### This should be the number of the Emacs version we're building, | |
89 | ### like `18.59' or `19.0'. | |
90 | version=@version@ | |
91 | ||
92 | ### This should be the name of the configuration we're building Emacs | |
93 | ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'. | |
94 | configuration=@configuration@ | |
95 | ||
96 | # ==================== Where To Install Things ==================== | |
97 | ||
3a4155de GM |
98 | # Location to install Emacs.app under GNUstep / Mac OS X. |
99 | # Later values may use these. | |
100 | ns_appbindir=@ns_appbindir@ | |
101 | ns_appresdir=@ns_appresdir@ | |
b4a36200 GM |
102 | # Either yes or no depending on whether this is a relocatable Emacs.app. |
103 | ns_self_contained=@ns_self_contained@ | |
3a4155de | 104 | |
067d23c9 KY |
105 | # The default location for installation. Everything is placed in |
106 | # subdirectories of this directory. The default values for many of | |
107 | # the variables below are expressed in terms of this one, so you may | |
108 | # not need to change them. This defaults to /usr/local. | |
109 | prefix=@prefix@ | |
110 | ||
111 | # Like `prefix', but used for architecture-specific files. | |
112 | exec_prefix=@exec_prefix@ | |
113 | ||
114 | # Where to install Emacs and other binaries that people will want to | |
115 | # run directly (like etags). | |
116 | bindir=@bindir@ | |
117 | ||
118 | # The root of the directory tree for read-only architecture-independent | |
119 | # data files. ${datadir}, ${infodir} and ${mandir} are based on this. | |
120 | datarootdir=@datarootdir@ | |
121 | ||
122 | # Where to install architecture-independent data files. ${lispdir} | |
123 | # and ${etcdir} are subdirectories of this. | |
124 | datadir=@datadir@ | |
125 | ||
126 | # Where to install and expect the files that Emacs modifies as it | |
127 | # runs. These files are all architecture-independent. | |
128 | # Right now, this is not used. | |
129 | sharedstatedir=@sharedstatedir@ | |
130 | ||
131 | # Where to install and expect executable files to be run by Emacs | |
3a4155de GM |
132 | # rather than directly by users (and other architecture-dependent |
133 | # data, although Emacs does not have any). The executables | |
134 | # are actually installed in ${archlibdir}, which is (normally) | |
135 | # a subdirectory of this. | |
067d23c9 KY |
136 | libexecdir=@libexecdir@ |
137 | ||
138 | # Where to install Emacs's man pages. | |
ab1121bd | 139 | # Note they contain cross-references that expect them to be in section 1. |
067d23c9 KY |
140 | mandir=@mandir@ |
141 | man1dir=$(mandir)/man1 | |
067d23c9 | 142 | |
9aa071df | 143 | # Where to install and expect the info files describing Emacs. |
067d23c9 | 144 | infodir=@infodir@ |
9aa071df | 145 | # Info files not in the doc/misc directory (we get those via make echo-info). |
8045b906 GM |
146 | INFO_EXT=@INFO_EXT@ |
147 | INFO_NONMISC=emacs$(INFO_EXT) eintr$(INFO_EXT) elisp$(INFO_EXT) | |
067d23c9 | 148 | |
e5365138 GM |
149 | # If no makeinfo was found and configured --without-makeinfo, "no"; else "yes". |
150 | HAVE_MAKEINFO=@HAVE_MAKEINFO@ | |
151 | ||
067d23c9 KY |
152 | # Directory for local state files for all programs. |
153 | localstatedir=@localstatedir@ | |
154 | ||
155 | # Where to look for bitmap files. | |
156 | bitmapdir=@bitmapdir@ | |
157 | ||
158 | # Where to find the source code. The source code for Emacs's C kernel is | |
159 | # expected to be in ${srcdir}/src, and the source code for Emacs's | |
160 | # utility programs is expected to be in ${srcdir}/lib-src. This is | |
161 | # set by the configure script's `--srcdir' option. | |
162 | ||
163 | # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH. | |
164 | srcdir=@srcdir@ | |
165 | ||
166 | # Where the manpage source files are kept. | |
167 | mansrcdir=$(srcdir)/doc/man | |
168 | ||
169 | # Tell make where to find source files; this is needed for the makefiles. | |
170 | VPATH=@srcdir@ | |
171 | ||
172 | # Where to find the application default. | |
173 | x_default_search_path=@x_default_search_path@ | |
174 | ||
067d23c9 KY |
175 | # Where the etc/emacs.desktop file is to be installed. |
176 | desktopdir=$(datarootdir)/applications | |
177 | ||
178 | # Where the etc/images/icons/hicolor directory is to be installed. | |
179 | icondir=$(datarootdir)/icons | |
180 | ||
181 | # The source directory for the icon files. | |
182 | iconsrcdir=$(srcdir)/etc/images/icons | |
183 | ||
184 | # ==================== Emacs-specific directories ==================== | |
185 | ||
186 | # These variables hold the values Emacs will actually use. They are | |
187 | # based on the values of the standard Make variables above. | |
188 | ||
d10cfddd | 189 | # Where to install the lisp, leim files distributed with |
067d23c9 KY |
190 | # Emacs. This includes the Emacs version, so that the |
191 | # lisp files for different versions of Emacs will install | |
192 | # themselves in separate directories. | |
193 | lispdir=@lispdir@ | |
d10cfddd | 194 | leimdir=@leimdir@ |
067d23c9 | 195 | |
ca26824c GM |
196 | # Directories Emacs should search for standard lisp files. |
197 | # The default is ${lispdir}:${leimdir}. | |
198 | standardlisppath=@standardlisppath@ | |
199 | ||
200 | # Directories Emacs should search for lisp files specific to this | |
201 | # site (i.e. customizations), before consulting ${standardlisppath}. | |
202 | # This should be a colon-separated list of directories. | |
067d23c9 KY |
203 | locallisppath=@locallisppath@ |
204 | ||
205 | # Where Emacs will search to find its lisp files. Before | |
206 | # changing this, check to see if your purpose wouldn't | |
207 | # better be served by changing locallisppath. This | |
208 | # should be a colon-separated list of directories. | |
ca26824c | 209 | # The default is ${locallisppath}:${standardlisppath}. |
067d23c9 KY |
210 | lisppath=@lisppath@ |
211 | ||
212 | # Where Emacs will search for its lisp files while | |
213 | # building. This is only used during the process of | |
214 | # compiling Emacs, to help Emacs find its lisp files | |
215 | # before they've been installed in their final location. | |
5b43da69 GM |
216 | # This should be a colon-separated list of directories. |
217 | # Normally it points to the lisp/ directory in the sources. | |
067d23c9 KY |
218 | buildlisppath=${srcdir}/lisp |
219 | ||
220 | # Where to install the other architecture-independent | |
221 | # data files distributed with Emacs (like the tutorial, | |
222 | # the cookie recipes and the Zippy database). This path | |
223 | # usually contains the Emacs version number, so the data | |
224 | # files for multiple versions of Emacs may be installed | |
225 | # at once. | |
226 | etcdir=@etcdir@ | |
227 | ||
228 | # Where to put executables to be run by Emacs rather than | |
229 | # the user. This path usually includes the Emacs version | |
230 | # and configuration name, so that multiple configurations | |
231 | # for multiple versions of Emacs may be installed at | |
232 | # once. | |
233 | archlibdir=@archlibdir@ | |
234 | ||
235 | # Where to put the docstring file. | |
236 | docdir=@docdir@ | |
237 | ||
238 | # Where to install Emacs game score files. | |
239 | gamedir=@gamedir@ | |
240 | ||
241 | # ==================== Utility Programs for the Build ==================== | |
242 | ||
243 | # Allow the user to specify the install program. | |
a36e64d0 GM |
244 | # Note that if the system does not provide a suitable install, |
245 | # configure will use build-aux/install-sh. Annoyingly, it does | |
246 | # not use an absolute path. So we must take care to always run | |
3fe7cdc8 | 247 | # INSTALL-type commands from the directory containing the Makefile. |
a36e64d0 | 248 | # This explains (I think) the cd thisdir seen in several install rules. |
067d23c9 KY |
249 | INSTALL = @INSTALL@ |
250 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
251 | INSTALL_DATA = @INSTALL_DATA@ | |
252 | INSTALL_INFO = @INSTALL_INFO@ | |
253 | # By default, we uphold the dignity of our programs. | |
254 | INSTALL_STRIP = | |
3fe7cdc8 | 255 | MKDIR_P = @MKDIR_P@ |
4f8902cd GM |
256 | # Create a link to a file in the same directory as the target. |
257 | LN_S_FILEONLY = @LN_S_FILEONLY@ | |
067d23c9 KY |
258 | |
259 | # We use gzip to compress installed .el files. | |
260 | GZIP_PROG = @GZIP_PROG@ | |
261 | # If non-nil, gzip the installed Info and man pages. | |
262 | GZIP_INFO = @GZIP_INFO@ | |
263 | ||
264 | # ============================= Targets ============================== | |
265 | ||
266 | # Program name transformation. | |
267 | TRANSFORM = @program_transform_name@ | |
268 | ||
269 | # What emacs should be called when installed. | |
59696ae0 GM |
270 | EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'` |
271 | EMACS = ${EMACS_NAME}${EXEEXT} | |
eeced60b | 272 | EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT} |
067d23c9 | 273 | |
9192d37d GM |
274 | # Subdirectories to make recursively. |
275 | SUBDIR = lib lib-src src lisp leim | |
067d23c9 KY |
276 | |
277 | # The subdir makefiles created by config.status. | |
70716b1d | 278 | SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@ |
cee4acda | 279 | SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'` |
067d23c9 KY |
280 | |
281 | # Subdirectories to install, and where they'll go. | |
282 | # lib-src's makefile knows how to install it, so we don't do that here. | |
d10cfddd GM |
283 | # Directories that cannot simply be copied, eg info, |
284 | # are treated separately. | |
285 | # quail appears twice because in out-of-tree builds, it exists twice. | |
286 | COPYDIR = ${srcdir}/etc ${srcdir}/lisp ${srcdir}/leim/ja-dic ${srcdir}/leim/quail leim/quail | |
ec21c7f8 | 287 | COPYDESTS = $(DESTDIR)${etcdir} $(DESTDIR)${lispdir} $(DESTDIR)${leimdir}/ja-dic $(DESTDIR)${leimdir}/quail $(DESTDIR)${leimdir}/quail |
067d23c9 | 288 | |
9192d37d | 289 | all: ${SUBDIR} |
067d23c9 | 290 | |
0aee6912 PE |
291 | .PHONY: all ${SUBDIR} blessmail epaths-force FRC |
292 | ||
067d23c9 KY |
293 | removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g' |
294 | ||
295 | # Generate epaths.h from epaths.in. This target is invoked by `configure'. | |
c4444d16 | 296 | # See comments in configure.ac for why it is done this way, as opposed |
067d23c9 KY |
297 | # to just letting configure generate epaths.h from epaths.in in a |
298 | # similar way to how Makefile is made from Makefile.in. | |
299 | epaths-force: FRC | |
ffd817eb JD |
300 | @(standardlisppath=`echo "${standardlisppath}" | ${removenullpaths}` ; \ |
301 | locallisppath=`echo "${locallisppath}" | ${removenullpaths}` ; \ | |
302 | buildlisppath=`echo "${buildlisppath}" | ${removenullpaths}` ; \ | |
067d23c9 KY |
303 | x_default_search_path=`echo ${x_default_search_path}`; \ |
304 | gamedir=`echo ${gamedir}`; \ | |
305 | sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \ | |
ca26824c GM |
306 | -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'"$${standardlisppath}"'";' \ |
307 | -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${locallisppath}"'";' \ | |
067d23c9 KY |
308 | -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'"$${buildlisppath}"'";' \ |
309 | -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ | |
310 | -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \ | |
311 | -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \ | |
312 | -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \ | |
313 | -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \ | |
314 | -e 's;\(#.*PATH_GAME\).*$$;\1 "${gamedir}";' \ | |
dc3e3e7b | 315 | -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \ |
24e0f6b1 | 316 | ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h |
067d23c9 | 317 | |
9a514d4a PE |
318 | lib-src src: lib |
319 | ||
067d23c9 KY |
320 | src: lib-src FRC |
321 | ||
9192d37d GM |
322 | # We need to build `emacs' in `src' to compile the *.elc files in `lisp' |
323 | # and `leim'. | |
324 | lisp leim: src | |
067d23c9 KY |
325 | |
326 | # These targets should be "${SUBDIR} without `src'". | |
9192d37d | 327 | lib lib-src lisp leim: Makefile FRC |
2e5d41e4 | 328 | cd $@ && $(MAKE) all $(MFLAGS) \ |
067d23c9 KY |
329 | CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ |
330 | LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' | |
331 | ||
332 | # Pass to src/Makefile.in an additional BOOTSTRAPEMACS variable which | |
333 | # is either set to bootstrap-emacs (in case bootstrap-emacs has not been | |
334 | # constructed yet) or the empty string (otherwise). | |
335 | # src/Makefile.in uses it to implement conditional dependencies, so that | |
336 | # files that need bootstrap-emacs to be built do not additionally need | |
337 | # to be kept fresher than bootstrap-emacs. Otherwise changing a single | |
338 | # file src/foo.c forces dumping a new bootstrap-emacs, then re-byte-compiling | |
339 | # all preloaded elisp files, and only then dump the actual src/emacs, which | |
340 | # is not wrong, but is overkill in 99.99% of the cases. | |
341 | src: Makefile FRC | |
342 | boot=bootstrap-emacs$(EXEEXT); \ | |
343 | if [ ! -x "src/$$boot" ]; then \ | |
344 | cd $@; $(MAKE) all $(MFLAGS) \ | |
345 | CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ | |
346 | LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="$$boot"; \ | |
347 | fi; | |
348 | if [ -r .bzr/checkout/dirstate ]; then \ | |
4f8c52a9 | 349 | vcswitness="`pwd`/.bzr/checkout/dirstate"; \ |
067d23c9 KY |
350 | fi; \ |
351 | cd $@; $(MAKE) all $(MFLAGS) \ | |
352 | CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ | |
353 | LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="" \ | |
354 | VCSWITNESS="$$vcswitness" | |
355 | ||
356 | blessmail: Makefile src FRC | |
39078e4a | 357 | cd lib-src && $(MAKE) maybe-blessmail $(MFLAGS) \ |
067d23c9 KY |
358 | MAKE='${MAKE}' archlibdir='$(archlibdir)' |
359 | ||
360 | # We used to have one rule per */Makefile.in, but that leads to race | |
361 | # conditions with parallel makes, so let's assume that the time stamp on | |
362 | # ./Makefile is representative of the time stamp on all the other Makefiles. | |
8f25abd3 PE |
363 | # |
364 | # config.status overrides MAKEFILE_NAME with a bogus name when creating | |
365 | # src/epaths.h, so that 'make epaths-force' does not recursively invoke | |
366 | # config.status and overwrite config.status while executing it (Bug#11214). | |
c462dda8 PE |
367 | # |
368 | # 'make bootstrap' overrides MAKEFILE_NAME to a nonexistent file but | |
369 | # then attempts to build that file. This forces 'Makefile', 'lib/Makefile', | |
370 | # etc. to be built without running into similar recursion problems. | |
8f25abd3 PE |
371 | MAKEFILE_NAME = Makefile |
372 | $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \ | |
90eacf99 | 373 | $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) $(srcdir)/src/lisp.mk |
50bfc824 | 374 | MAKE='$(MAKE)' ./config.status |
067d23c9 | 375 | |
b8b0239f PE |
376 | # Don't erase these files if make is interrupted while refreshing them. |
377 | .PRECIOUS: Makefile config.status | |
bfab7d85 | 378 | |
50bfc824 | 379 | config.status: ${srcdir}/configure ${srcdir}/lisp/version.el |
bfab7d85 SM |
380 | if [ -x ./config.status ]; then \ |
381 | ./config.status --recheck; \ | |
382 | else \ | |
d3612ac3 | 383 | $(srcdir)/configure $(CONFIGURE_FLAGS); \ |
bfab7d85 | 384 | fi |
067d23c9 | 385 | |
c4444d16 | 386 | AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4 |
067d23c9 KY |
387 | |
388 | $(srcdir)/configure: $(AUTOCONF_INPUTS) | |
389 | cd ${srcdir} && autoconf | |
390 | ||
501390c5 | 391 | ACLOCAL_INPUTS = $(srcdir)/m4/gnulib-comp.m4 |
9a514d4a PE |
392 | $(srcdir)/aclocal.m4: $(ACLOCAL_INPUTS) |
393 | cd $(srcdir) && aclocal -I m4 | |
394 | ||
501390c5 PE |
395 | AUTOMAKE_INPUTS = $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am \ |
396 | $(srcdir)/lib/gnulib.mk | |
9a514d4a PE |
397 | $(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS) |
398 | cd $(srcdir) && automake --gnu -a -c lib/Makefile | |
b8b0239f PE |
399 | |
400 | # Regenerate files that this makefile would have made, if this makefile | |
401 | # had been built by Automake. The name 'am--refresh' is for | |
402 | # compatibility with subsidiary Automake-generated makefiles. | |
925e561d | 403 | am--refresh: $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/src/config.in |
3cbecb8f | 404 | .PHONY: am--refresh |
9a514d4a | 405 | |
067d23c9 KY |
406 | $(srcdir)/src/config.in: $(srcdir)/src/stamp-h.in |
407 | @ # Usually, there's no need to rebuild src/config.in just | |
408 | @ # because stamp-h.in has changed (since building stamp-h.in | |
409 | @ # refreshes config.in as well), but if config.in is missing | |
410 | @ # then we really need to do something more. | |
411 | [ -r "$@" ] || ( cd ${srcdir} && autoheader ) | |
412 | $(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS) | |
413 | cd ${srcdir} && autoheader | |
414 | rm -f $(srcdir)/src/stamp-h.in | |
415 | echo timestamp > $(srcdir)/src/stamp-h.in | |
416 | ||
417 | # ==================== Installation ==================== | |
418 | ||
0aee6912 PE |
419 | .PHONY: install install-arch-dep install-arch-indep install-doc install-info |
420 | .PHONY: install-man install-etc install-strip uninstall | |
421 | ||
067d23c9 KY |
422 | ## If we let lib-src do its own installation, that means we |
423 | ## don't have to duplicate the list of utilities to install in | |
424 | ## this Makefile as well. | |
425 | ||
bfed8334 | 426 | install: all install-arch-indep install-doc install-arch-dep blessmail |
067d23c9 KY |
427 | @true |
428 | ||
53a84f3c | 429 | ## Ensure that $subdir contains a subdirs.el file. |
7606c360 GM |
430 | ## Here and elsewhere, we set the umask so that any created files are |
431 | ## world-readable. | |
432 | ## TODO it might be good to warn about non-standard permissions of | |
433 | ## pre-existing directories, but that does not seem easy. | |
53a84f3c GM |
434 | write_subdir=if [ -f $${subdir}/subdirs.el ]; \ |
435 | then true; \ | |
436 | else \ | |
4c54abe1 GM |
437 | umask 022; \ |
438 | ${MKDIR_P} $${subdir}; \ | |
53a84f3c GM |
439 | (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \ |
440 | echo " (normal-top-level-add-subdirs-to-load-path))") \ | |
441 | > $${subdir}/subdirs.el; \ | |
4c54abe1 | 442 | fi |
53a84f3c | 443 | |
067d23c9 | 444 | ### Install the executables that were compiled specifically for this machine. |
ed0ba302 GM |
445 | ### We do install-arch-indep first because the executable needs the |
446 | ### Lisp files and DOC file to work properly. | |
9d9edd4b | 447 | install-arch-dep: src install-arch-indep install-doc |
b533f05e | 448 | umask 022; ${MKDIR_P} $(DESTDIR)${bindir} |
39078e4a | 449 | cd lib-src && \ |
067d23c9 KY |
450 | $(MAKE) install $(MFLAGS) prefix=${prefix} \ |
451 | exec_prefix=${exec_prefix} bindir=${bindir} \ | |
452 | libexecdir=${libexecdir} archlibdir=${archlibdir} \ | |
39078e4a | 453 | INSTALL_STRIP=${INSTALL_STRIP} |
b4a36200 | 454 | if test "${ns_self_contained}" = "no"; then \ |
96182ae6 | 455 | ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL) || exit 1 ; \ |
01824657 | 456 | chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL) || true; \ |
5af9cb6b GM |
457 | if test "x${NO_BIN_LINK}" = x; then \ |
458 | rm -f $(DESTDIR)${bindir}/$(EMACS) ; \ | |
4f8902cd | 459 | cd $(DESTDIR)${bindir} && $(LN_S_FILEONLY) $(EMACSFULL) $(EMACS); \ |
5af9cb6b | 460 | fi; \ |
96182ae6 | 461 | else \ |
05f3d308 | 462 | subdir=${ns_appresdir}/site-lisp; \ |
05f3d308 GM |
463 | ${write_subdir} || exit 1; \ |
464 | rm -rf ${ns_appresdir}/share; \ | |
96182ae6 | 465 | fi |
067d23c9 | 466 | |
05f3d308 | 467 | ## In the share directory, we are deleting: |
660c8c1e GM |
468 | ## applications (with emacs.desktop, also found in etc/) |
469 | ## emacs (basically empty except for unneeded site-lisp directories) | |
05f3d308 | 470 | ## icons (duplicates etc/images/icons/hicolor) |
05f3d308 | 471 | |
6b3868cb GM |
472 | ## This is install-etc for everything except self-contained-ns builds. |
473 | ## For them, it is empty. | |
474 | INSTALL_ARCH_INDEP_EXTRA = @INSTALL_ARCH_INDEP_EXTRA@ | |
475 | ||
067d23c9 KY |
476 | ## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html |
477 | ## Needs to be the user running install, so configure can't set it. | |
478 | set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \ | |
479 | `id -un 2> /dev/null`; do \ | |
480 | [ -n "$${installuser}" ] && break ; \ | |
481 | done | |
482 | ||
483 | ### Install the files that are machine-independent. | |
29473393 GM |
484 | ### Most of them come straight from the distribution; the exception is |
485 | ### the DOC file, which is copied from the build directory. | |
067d23c9 | 486 | |
7606c360 GM |
487 | ## We delete each directory in ${COPYDESTS} before we copy into it; |
488 | ## that way, we can reinstall over directories that have been put in | |
489 | ## place with their files read-only (perhaps because they are checked | |
490 | ## into RCS). In order to make this safe, we make sure that the | |
491 | ## source exists and is distinct from the destination. | |
62061397 | 492 | |
29473393 GM |
493 | ## We delete etc/DOC* because there may be irrelevant DOC files from |
494 | ## other builds in the source directory. This is ok because we just | |
495 | ## deleted the entire installed etc/ directory and recreated it. | |
496 | ## install-doc installs the relevant DOC. | |
497 | ||
498 | ## Note that the Makefiles in the etc directory are potentially useful | |
499 | ## in an installed Emacs, so should not be excluded. | |
500 | ||
62061397 GM |
501 | ## I'm not sure creating locallisppath here serves any useful purpose. |
502 | ## If it has the default value, then the later write_subdir commands | |
503 | ## will ensure all these components exist. | |
504 | ## This will only do something if locallisppath has a non-standard value. | |
505 | ## Is it really Emacs's job to create those directories? | |
506 | ## Should we also be ensuring they contain subdirs.el files? | |
507 | ## It would be easy to do, just use write_subdir. | |
41a2ce39 GM |
508 | |
509 | ## Note that we use tar instead of plain old cp -R/-r because the latter | |
510 | ## is apparently not portable (even in 2012!). | |
511 | ## http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00278.html | |
512 | ## I have no idea which platforms Emacs supports where cp -R does not | |
513 | ## work correctly, and therefore no idea when tar can be replaced. | |
567739fb GM |
514 | ## See also these comments from 2004 about cp -r working fine: |
515 | ## http://lists.gnu.org/archive/html/autoconf-patches/2004-11/msg00005.html | |
9d9edd4b | 516 | install-arch-indep: lisp leim install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} |
62061397 | 517 | umask 022 ; \ |
57ae02b1 AS |
518 | locallisppath='${locallisppath}'; \ |
519 | IFS=:; \ | |
520 | for d in $$locallisppath; do \ | |
521 | ${MKDIR_P} "$(DESTDIR)$$d"; \ | |
522 | done | |
067d23c9 KY |
523 | -set ${COPYDESTS} ; \ |
524 | unset CDPATH; \ | |
067d23c9 KY |
525 | $(set_installuser); \ |
526 | for dir in ${COPYDIR} ; do \ | |
7606c360 | 527 | [ -d $${dir} ] || exit 1 ; \ |
067d23c9 | 528 | dest=$$1 ; shift ; \ |
b7e1feea | 529 | [ -d $${dest} ] && \ |
b847032c | 530 | [ `cd $${dest} && /bin/pwd` = `cd $${dir} && /bin/pwd` ] && \ |
7606c360 | 531 | continue ; \ |
d10cfddd GM |
532 | if [ "$${dir}" = "leim/quail" ]; then \ |
533 | [ `cd $${dir} && /bin/pwd` = `cd ${srcdir}/leim/quail && /bin/pwd` ] && \ | |
534 | continue ; \ | |
535 | else \ | |
536 | rm -rf $${dest} ; \ | |
537 | umask 022; ${MKDIR_P} $${dest} ; \ | |
538 | fi ; \ | |
e39b9806 GM |
539 | echo "Copying $${dir} to $${dest}..." ; \ |
540 | (cd $${dir}; tar -chf - . ) \ | |
541 | | (cd $${dest}; umask 022; \ | |
542 | tar -xvf - && cat > /dev/null) || exit 1; \ | |
543 | [ "$${dir}" != "${srcdir}/etc" ] || rm -f $${dest}/DOC* ; \ | |
544 | for subdir in `find $${dest} -type d -print` ; do \ | |
94898d72 | 545 | chmod a+rx $${subdir} ; \ |
afdc3477 GM |
546 | rm -f $${subdir}/.gitignore ; \ |
547 | rm -f $${subdir}/.arch-inventory ; \ | |
548 | rm -f $${subdir}/.DS_Store ; \ | |
549 | rm -f $${subdir}/\#* ; \ | |
550 | rm -f $${subdir}/.\#* ; \ | |
551 | rm -f $${subdir}/*~ ; \ | |
552 | rm -f $${subdir}/*.orig ; \ | |
553 | rm -f $${subdir}/ChangeLog* ; \ | |
e39b9806 | 554 | [ "$${dir}" != "${srcdir}/etc" ] && \ |
afdc3477 | 555 | rm -f $${subdir}/[mM]akefile*[.-]in $${subdir}/[mM]akefile ; \ |
e39b9806 GM |
556 | done ; \ |
557 | find $${dest} -exec chown $${installuser} {} ';' ;\ | |
067d23c9 | 558 | done |
d10cfddd GM |
559 | -rm -f $(DESTDIR)${leimdir}/leim-list.el |
560 | ${INSTALL_DATA} leim/leim-list.el $(DESTDIR)${leimdir}/leim-list.el | |
067d23c9 | 561 | -rm -f $(DESTDIR)${lispdir}/subdirs.el |
ff0c3cfb | 562 | umask 022; $(srcdir)/build-aux/update-subdirs $(DESTDIR)${lispdir} |
9f1ea7dc GM |
563 | subdir=$(DESTDIR)${datadir}/emacs/${version}/site-lisp ; \ |
564 | ${write_subdir} | |
565 | subdir=$(DESTDIR)${datadir}/emacs/site-lisp ; \ | |
566 | ${write_subdir} || true | |
6d1a623e GM |
567 | [ -z "${GZIP_PROG}" ] || \ |
568 | ( echo "Compressing *.el ..." ; \ | |
569 | unset CDPATH; \ | |
d10cfddd GM |
570 | thisdir=`/bin/pwd`; \ |
571 | for dir in $(DESTDIR)${lispdir} $(DESTDIR)${leimdir}; do \ | |
572 | cd $${thisdir} ; \ | |
573 | cd $${dir} || exit 1 ; \ | |
574 | for f in `find . -name "*.elc" -print`; do \ | |
575 | ${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \ | |
576 | done ; \ | |
6d1a623e | 577 | done ) |
660c8c1e GM |
578 | -chmod -R a+r $(DESTDIR)${datadir}/emacs/${version} ${COPYDESTS} |
579 | ||
94898d72 GM |
580 | ## The above chmods are needed because "umask 022; tar ..." is not |
581 | ## guaranteed to do the right thing; eg if we are root and tar is | |
582 | ## preserving source permissions. | |
42d5aa3e | 583 | |
660c8c1e GM |
584 | ## We install only the relevant DOC file if possible |
585 | ## (ie DOC-${version}.buildnumber), otherwise DOC-${version}*. | |
586 | ## (Note "otherwise" is inaccurate since 2009-08-23.) | |
587 | ||
bfed8334 GM |
588 | ## Note that install-arch-indep deletes and recreates the entire |
589 | ## installed etc/ directory, so we need it to run before this does. | |
9d9edd4b | 590 | install-doc: src install-arch-indep |
660c8c1e | 591 | -unset CDPATH; \ |
568c6157 | 592 | umask 022; ${MKDIR_P} $(DESTDIR)${docdir} ; \ |
b847032c | 593 | if [ `cd ./etc; /bin/pwd` != `cd $(DESTDIR)${docdir}; /bin/pwd` ]; \ |
067d23c9 KY |
594 | then \ |
595 | fullversion=`./src/emacs --version | sed -n '1 s/GNU Emacs *//p'`; \ | |
596 | if [ -f "./etc/DOC-$${fullversion}" ]; \ | |
597 | then \ | |
598 | docfile="DOC-$${fullversion}"; \ | |
599 | else \ | |
600 | docfile="DOC"; \ | |
601 | fi; \ | |
602 | echo "Copying etc/$${docfile} to $(DESTDIR)${docdir} ..." ; \ | |
e6124927 | 603 | ${INSTALL_DATA} etc/$${docfile} $(DESTDIR)${docdir}/$${docfile}; \ |
29473393 GM |
604 | $(set_installuser); \ |
605 | chown $${installuser} $(DESTDIR)${docdir}/$${docfile} || true ; \ | |
067d23c9 | 606 | else true; fi |
660c8c1e GM |
607 | |
608 | install-info: info | |
b533f05e | 609 | umask 022; ${MKDIR_P} $(DESTDIR)${infodir} |
067d23c9 KY |
610 | -unset CDPATH; \ |
611 | thisdir=`/bin/pwd`; \ | |
b847032c | 612 | [ `cd ${srcdir}/info && /bin/pwd` = `cd $(DESTDIR)${infodir} && /bin/pwd` ] || \ |
067d23c9 | 613 | (cd $(DESTDIR)${infodir}; \ |
6d1a623e | 614 | [ -f dir ] || \ |
067d23c9 | 615 | (cd $${thisdir}; \ |
37baa3c8 | 616 | ${INSTALL_DATA} ${srcdir}/info/dir $(DESTDIR)${infodir}/dir) ; \ |
4c9a1377 PE |
617 | info_misc=`cd $${thisdir}/doc/misc && \ |
618 | $(QUIET_SUBMAKE) $(MAKE) -s echo-info \ | |
619 | `; \ | |
067d23c9 | 620 | cd ${srcdir}/info ; \ |
9aa071df | 621 | for elt in ${INFO_NONMISC} $${info_misc}; do \ |
4f8c52a9 | 622 | test "$(HAVE_MAKEINFO)" = "no" && test ! -f $$elt && continue; \ |
067d23c9 | 623 | for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \ |
a36e64d0 GM |
624 | (cd $${thisdir}; \ |
625 | ${INSTALL_DATA} ${srcdir}/info/$$f $(DESTDIR)${infodir}/$$f); \ | |
6d1a623e GM |
626 | ( [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ] ) || continue ; \ |
627 | rm -f $(DESTDIR)${infodir}/$$f.gz; \ | |
628 | ${GZIP_PROG} -9n $(DESTDIR)${infodir}/$$f; \ | |
067d23c9 | 629 | done; \ |
7adecb99 GM |
630 | (cd $${thisdir}; \ |
631 | ${INSTALL_INFO} --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \ | |
6d1a623e | 632 | done) |
660c8c1e | 633 | |
b3cdfd9e GM |
634 | ## "gzip || true" is because some gzips exit with non-zero status |
635 | ## if compression would not reduce the file size. Eg, the gzip in | |
636 | ## OpenBSD 4.9 seems to do this (2013/03). In Emacs, this can | |
637 | ## only happen with the tiny ctags.1 manpage. We don't really care if | |
638 | ## ctags.1 is compressed or not. "gzip -f" is another option here, | |
639 | ## but not sure if portable. | |
660c8c1e | 640 | install-man: |
b533f05e | 641 | umask 022; ${MKDIR_P} $(DESTDIR)${man1dir} |
067d23c9 KY |
642 | thisdir=`/bin/pwd`; \ |
643 | cd ${mansrcdir}; \ | |
ab1121bd | 644 | for page in *.1; do \ |
a6c2cc07 | 645 | dest=`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1; \ |
067d23c9 | 646 | (cd $${thisdir}; \ |
1a9c6830 | 647 | ${INSTALL_DATA} ${mansrcdir}/$${page} $(DESTDIR)${man1dir}/$${dest}); \ |
6d1a623e | 648 | ( [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ] ) || continue ; \ |
1a9c6830 | 649 | rm -f $(DESTDIR)${man1dir}/$${dest}.gz; \ |
b3cdfd9e | 650 | ${GZIP_PROG} -9n $(DESTDIR)${man1dir}/$${dest} || true; \ |
067d23c9 KY |
651 | done |
652 | ||
653 | ## Install those items from etc/ that need to end up elsewhere. | |
d036bcdf GM |
654 | |
655 | ## If you prefer, choose "emacs22" at installation time. | |
656 | ## Note: emacs22 does not have all the resolutions. | |
657 | EMACS_ICON=emacs | |
658 | ||
d9a1e2c2 GM |
659 | install-etc: |
660 | umask 022; ${MKDIR_P} $(DESTDIR)${desktopdir} | |
1a9c6830 | 661 | tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \ |
59696ae0 GM |
662 | emacs_name=`echo emacs | sed '$(TRANSFORM)'`; \ |
663 | sed -e "/^Exec=emacs/ s/emacs/$${emacs_name}/" \ | |
664 | -e "/^Icon=emacs/ s/emacs/$${emacs_name}/" \ | |
1a9c6830 | 665 | ${srcdir}/etc/emacs.desktop > $${tmp}; \ |
59696ae0 | 666 | ${INSTALL_DATA} $${tmp} $(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop; \ |
1a9c6830 | 667 | rm -f $${tmp} |
7606c360 | 668 | thisdir=`/bin/pwd`; \ |
d9a1e2c2 GM |
669 | cd ${iconsrcdir} || exit 1; umask 022 ; \ |
670 | for dir in */*/apps */*/mimetypes; do \ | |
671 | [ -d $${dir} ] || continue ; \ | |
af006ad5 | 672 | ( cd $${thisdir}; ${MKDIR_P} $(DESTDIR)${icondir}/$${dir} ) ; \ |
d036bcdf | 673 | for icon in $${dir}/${EMACS_ICON}[.-]*; do \ |
d9a1e2c2 | 674 | [ -r $${icon} ] || continue ; \ |
8bfcb8a6 | 675 | ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \ |
d036bcdf | 676 | dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\.$${ext}$$||" -e 's/$(EMACS_ICON)/emacs/' -e '$(TRANSFORM)'`.$${ext} ; \ |
7606c360 | 677 | ( cd $${thisdir}; \ |
293902c8 | 678 | ${INSTALL_DATA} ${iconsrcdir}/$${icon} $(DESTDIR)${icondir}/$${dir}/$${dest} ) \ |
7606c360 | 679 | || exit 1; \ |
d9a1e2c2 | 680 | done ; \ |
067d23c9 KY |
681 | done |
682 | ||
067d23c9 KY |
683 | ### Build Emacs and install it, stripping binaries while installing them. |
684 | install-strip: | |
fd9d85c2 | 685 | $(MAKE) $(MFLAGS) INSTALL_STRIP=-s install |
067d23c9 | 686 | |
067d23c9 KY |
687 | ### Delete all the installed files that the `install' target would |
688 | ### create (but not the noninstalled files such as `make all' would create). | |
689 | ### | |
690 | ### Don't delete the lisp and etc directories if they're in the source tree. | |
691 | uninstall: | |
39078e4a | 692 | cd lib-src && \ |
067d23c9 KY |
693 | $(MAKE) $(MFLAGS) uninstall \ |
694 | prefix=${prefix} exec_prefix=${exec_prefix} \ | |
39078e4a | 695 | bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir} |
067d23c9 KY |
696 | -unset CDPATH; \ |
697 | for dir in $(DESTDIR)${lispdir} $(DESTDIR)${etcdir} ; do \ | |
698 | if [ -d $${dir} ]; then \ | |
b847032c GM |
699 | case `cd $${dir} ; /bin/pwd` in \ |
700 | `cd ${srcdir} ; /bin/pwd`* ) ;; \ | |
067d23c9 KY |
701 | * ) rm -rf $${dir} ;; \ |
702 | esac ; \ | |
703 | case $${dir} in \ | |
704 | $(DESTDIR)${datadir}/emacs/${version}/* ) \ | |
705 | rm -rf $(DESTDIR)${datadir}/emacs/${version} \ | |
706 | ;; \ | |
707 | esac ; \ | |
708 | fi ; \ | |
709 | done | |
067d23c9 | 710 | -rm -rf $(DESTDIR)${libexecdir}/emacs/${version} |
a36e64d0 | 711 | thisdir=`/bin/pwd`; \ |
4c9a1377 | 712 | (info_misc=`cd doc/misc && $(QUIET_SUBMAKE) $(MAKE) -s echo-info`; \ |
25ca4587 GM |
713 | if cd $(DESTDIR)${infodir}; then \ |
714 | for elt in ${INFO_NONMISC} $${info_misc}; do \ | |
715 | (cd $${thisdir}; \ | |
716 | $(INSTALL_INFO) --remove --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \ | |
717 | if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \ | |
718 | ext=.gz; else ext=; fi; \ | |
719 | rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \ | |
720 | done; \ | |
721 | fi) | |
7eb21b49 GM |
722 | (if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \ |
723 | ext=.gz; else ext=; fi; \ | |
25ca4587 GM |
724 | if cd ${mansrcdir}; then \ |
725 | for page in *.1; do \ | |
726 | rm -f $(DESTDIR)${man1dir}/`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1$$ext; done; \ | |
727 | fi) | |
728 | (cd $(DESTDIR)${bindir} && rm -f $(EMACSFULL) $(EMACS) || true) | |
729 | (if cd $(DESTDIR)${icondir}; then \ | |
59696ae0 GM |
730 | rm -f hicolor/*x*/apps/${EMACS_NAME}.png \ |
731 | hicolor/scalable/apps/${EMACS_NAME}.svg \ | |
25ca4587 GM |
732 | hicolor/scalable/mimetypes/`echo emacs-document | sed '$(TRANSFORM)'`.svg; \ |
733 | fi) | |
59696ae0 | 734 | -rm -f $(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop |
067d23c9 KY |
735 | for file in snake-scores tetris-scores; do \ |
736 | file=$(DESTDIR)${gamedir}/$${file}; \ | |
737 | [ -s $${file} ] || rm -f $$file; \ | |
738 | done | |
739 | ||
740 | FRC: | |
741 | ||
742 | # ==================== Cleaning up and miscellanea ==================== | |
743 | ||
0aee6912 | 744 | .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean extraclean |
067d23c9 KY |
745 | |
746 | ### `mostlyclean' | |
747 | ### Like `clean', but may refrain from deleting a few files that people | |
748 | ### normally don't want to recompile. For example, the `mostlyclean' | |
749 | ### target for GCC does not delete `libgcc.a', because recompiling it | |
750 | ### is rarely necessary and takes a lot of time. | |
751 | mostlyclean: FRC | |
752 | (cd src; $(MAKE) $(MFLAGS) mostlyclean) | |
753 | (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean) | |
754 | (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean) | |
9a514d4a | 755 | (cd lib; $(MAKE) $(MFLAGS) mostlyclean) |
067d23c9 KY |
756 | (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean) |
757 | -(cd doc/emacs && $(MAKE) $(MFLAGS) mostlyclean) | |
758 | -(cd doc/misc && $(MAKE) $(MFLAGS) mostlyclean) | |
759 | -(cd doc/lispref && $(MAKE) $(MFLAGS) mostlyclean) | |
760 | -(cd doc/lispintro && $(MAKE) $(MFLAGS) mostlyclean) | |
761 | (cd leim; $(MAKE) $(MFLAGS) mostlyclean) | |
762 | ||
763 | ### `clean' | |
764 | ### Delete all files from the current directory that are normally | |
765 | ### created by building the program. Don't delete the files that | |
766 | ### record the configuration. Also preserve files that could be made | |
767 | ### by building, but normally aren't because the distribution comes | |
768 | ### with them. | |
769 | ### | |
770 | ### Delete `.dvi' files here if they are not part of the distribution. | |
771 | clean: FRC | |
1a9c6830 | 772 | -rm -f etc/emacs.tmpdesktop |
067d23c9 KY |
773 | (cd src; $(MAKE) $(MFLAGS) clean) |
774 | (cd oldXMenu; $(MAKE) $(MFLAGS) clean) | |
775 | (cd lwlib; $(MAKE) $(MFLAGS) clean) | |
9a514d4a | 776 | (cd lib; $(MAKE) $(MFLAGS) clean) |
067d23c9 KY |
777 | (cd lib-src; $(MAKE) $(MFLAGS) clean) |
778 | -(cd doc/emacs && $(MAKE) $(MFLAGS) clean) | |
779 | -(cd doc/misc && $(MAKE) $(MFLAGS) clean) | |
780 | -(cd doc/lispref && $(MAKE) $(MFLAGS) clean) | |
781 | -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean) | |
782 | (cd leim; $(MAKE) $(MFLAGS) clean) | |
83da1b55 | 783 | (cd nextstep && $(MAKE) $(MFLAGS) clean) |
067d23c9 KY |
784 | |
785 | ### `bootclean' | |
786 | ### Delete all files that need to be remade for a clean bootstrap. | |
787 | top_bootclean=\ | |
788 | rm -f config.cache config.log | |
789 | ### `distclean' | |
790 | ### Delete all files from the current directory that are created by | |
791 | ### configuring or building the program. If you have unpacked the | |
792 | ### source and built the program without creating any other files, | |
793 | ### `make distclean' should leave only the files that were in the | |
794 | ### distribution. | |
795 | top_distclean=\ | |
796 | ${top_bootclean}; \ | |
773233f8 | 797 | rm -f config.status config.log~ Makefile stamp-h1 ${SUBDIR_MAKEFILES} |
067d23c9 KY |
798 | distclean: FRC |
799 | (cd src; $(MAKE) $(MFLAGS) distclean) | |
800 | (cd oldXMenu; $(MAKE) $(MFLAGS) distclean) | |
801 | (cd lwlib; $(MAKE) $(MFLAGS) distclean) | |
9a514d4a | 802 | (cd lib; $(MAKE) $(MFLAGS) distclean) |
067d23c9 KY |
803 | (cd lib-src; $(MAKE) $(MFLAGS) distclean) |
804 | (cd doc/emacs && $(MAKE) $(MFLAGS) distclean) | |
805 | (cd doc/misc && $(MAKE) $(MFLAGS) distclean) | |
806 | (cd doc/lispref && $(MAKE) $(MFLAGS) distclean) | |
807 | (cd doc/lispintro && $(MAKE) $(MFLAGS) distclean) | |
808 | (cd leim; $(MAKE) $(MFLAGS) distclean) | |
809 | (cd lisp; $(MAKE) $(MFLAGS) distclean) | |
83da1b55 | 810 | (cd nextstep && $(MAKE) $(MFLAGS) distclean) |
067d23c9 KY |
811 | ${top_distclean} |
812 | ||
813 | ### `bootstrap-clean' | |
814 | ### Delete everything that can be reconstructed by `make' and that | |
815 | ### needs to be deleted in order to force a bootstrap from a clean state. | |
816 | bootstrap-clean: FRC | |
817 | (cd src; $(MAKE) $(MFLAGS) bootstrap-clean) | |
818 | (cd oldXMenu; $(MAKE) $(MFLAGS) maintainer-clean) | |
819 | (cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean) | |
9a514d4a | 820 | (cd lib; $(MAKE) $(MFLAGS) maintainer-clean) |
067d23c9 KY |
821 | (cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean) |
822 | -(cd doc/emacs && $(MAKE) $(MFLAGS) maintainer-clean) | |
823 | -(cd doc/misc && $(MAKE) $(MFLAGS) maintainer-clean) | |
824 | -(cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean) | |
825 | -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean) | |
826 | (cd leim; $(MAKE) $(MFLAGS) maintainer-clean) | |
827 | (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean) | |
83da1b55 | 828 | (cd nextstep && $(MAKE) $(MFLAGS) maintainer-clean) |
4f8c52a9 | 829 | [ ! -f config.log ] || mv -f config.log config.log~ |
067d23c9 KY |
830 | ${top_bootclean} |
831 | ||
832 | ### `maintainer-clean' | |
833 | ### Delete everything from the current directory that can be | |
834 | ### reconstructed with this Makefile. This typically includes | |
835 | ### everything deleted by distclean, plus more: C source files | |
836 | ### produced by Bison, tags tables, info files, and so on. | |
837 | ### | |
838 | ### One exception, however: `make maintainer-clean' should not delete | |
839 | ### `configure' even if `configure' can be remade using a rule in the | |
840 | ### Makefile. More generally, `make maintainer-clean' should not delete | |
841 | ### anything that needs to exist in order to run `configure' and then | |
842 | ### begin to build the program. | |
9a514d4a PE |
843 | top_maintainer_clean=\ |
844 | ${top_distclean}; \ | |
e02ea74b | 845 | rm -fr autom4te.cache |
067d23c9 KY |
846 | maintainer-clean: bootstrap-clean FRC |
847 | (cd src; $(MAKE) $(MFLAGS) maintainer-clean) | |
848 | (cd lisp; $(MAKE) $(MFLAGS) maintainer-clean) | |
9a514d4a | 849 | ${top_maintainer_clean} |
067d23c9 KY |
850 | |
851 | ### This doesn't actually appear in the coding standards, but Karl | |
852 | ### says GCC supports it, and that's where the configuration part of | |
853 | ### the coding standards seem to come from. It's like distclean, but | |
854 | ### it deletes backup and autosave files too. | |
855 | extraclean: | |
9192d37d | 856 | for i in ${SUBDIR}; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done |
9a514d4a | 857 | ${top_maintainer_clean} |
067d23c9 KY |
858 | -rm -f config-tmp-* |
859 | -rm -f *~ \#* | |
860 | ||
861 | # The src subdir knows how to do the right thing | |
862 | # even when the build directory and source dir are different. | |
0aee6912 | 863 | .PHONY: TAGS tags |
9a514d4a | 864 | TAGS tags: lib lib-src src |
5a95c002 | 865 | cd src; $(MAKE) $(MFLAGS) tags |
067d23c9 KY |
866 | |
867 | check: | |
6c7e099d | 868 | @if test ! -d test/automated; then \ |
a22d9d2c GM |
869 | echo "You do not seem to have the test/ directory."; \ |
870 | echo "Maybe you are using a release tarfile, rather than a repository checkout."; \ | |
871 | else \ | |
872 | cd test/automated && $(MAKE) $(MFLAGS) check; \ | |
873 | fi | |
067d23c9 KY |
874 | |
875 | dist: | |
876 | cd ${srcdir}; ./make-dist | |
877 | ||
b59a2e9e PE |
878 | DVIS = lispref-dvi lispintro-dvi emacs-dvi misc-dvi |
879 | HTMLS = lispref-html lispintro-html emacs-html misc-html | |
880 | INFOS = lispref-info lispintro-info emacs-info misc-info | |
881 | PDFS = lispref-pdf lispintro-pdf emacs-pdf misc-pdf | |
882 | PSS = lispref-ps lispintro-ps emacs-ps # no misc-ps | |
883 | ||
884 | DOCS = $(DVIS) $(HTMLS) $(INFOS) $(PDFS) $(PSS) | |
885 | $(DOCS): | |
886 | t=$@; IFS=-; set $$t; IFS=; cd doc/$$1 && $(MAKE) $(MFLAGS) $$2 | |
887 | ||
888 | .PHONY: $(DOCS) docs pdf ps | |
0aee6912 | 889 | .PHONY: info dvi dist check html info-real force-info check-info-dir |
067d23c9 | 890 | |
b59a2e9e PE |
891 | docs: $(DOCS) |
892 | dvi: $(DVIS) | |
893 | html: $(HTMLS) | |
894 | info-real: $(INFOS) | |
895 | pdf: $(PDFS) | |
896 | ps: $(PSS) | |
067d23c9 KY |
897 | |
898 | force-info: | |
899 | # Note that man/Makefile knows how to put the info files in $(srcdir), | |
900 | # so we can do ok running make in the build dir. | |
901 | # This used to have a clause that exited with an error if MAKEINFO = no. | |
902 | # But it is inappropriate to do so without checking if makeinfo is | |
903 | # actually needed - it is not if the info files are up-to-date. (Bug#3982) | |
904 | # Only the doc/*/Makefiles can decide that, so we let those rules run | |
905 | # and give a standard error if makeinfo is needed but missing. | |
906 | # While it would be nice to give a more detailed error message, that | |
907 | # would require changing every rule in doc/ that builds an info file, | |
908 | # and it's not worth it. This case is only relevant if you download a | |
909 | # release, then change the .texi files. | |
910 | info: force-info | |
e5365138 | 911 | @if test "$(HAVE_MAKEINFO)" = "no"; then \ |
067d23c9 KY |
912 | echo "Configured --without-makeinfo, not building manuals" ; \ |
913 | else \ | |
914 | $(MAKE) $(MFLAGS) info-real ; \ | |
915 | fi | |
916 | ||
917 | # The info/dir file must be updated by hand when new manuals are added. | |
918 | check-info-dir: info | |
919 | cd info ; \ | |
920 | missing= ; \ | |
921 | for file in *; do \ | |
922 | test -f "$${file}" || continue ; \ | |
923 | case $${file} in \ | |
924 | *-[0-9]*|COPYING|dir) continue ;; \ | |
925 | esac ; \ | |
8045b906 | 926 | file=`echo $${file} | sed 's/\.info//'` ; \ |
067d23c9 KY |
927 | grep -q -F ": ($${file})." dir || missing="$${missing} $${file}" ; \ |
928 | done ; \ | |
929 | if test -n "$${missing}"; then \ | |
930 | echo "Missing info/dir entries: $${missing}" ; \ | |
931 | exit 1 ; \ | |
932 | fi ; \ | |
933 | echo "info/dir is OK" | |
934 | ||
067d23c9 KY |
935 | #### Bootstrapping. |
936 | ||
937 | ### This first cleans the lisp subdirectory, removing all compiled | |
938 | ### Lisp files. Then re-run make to build all the files anew. | |
939 | ||
940 | .PHONY: bootstrap | |
941 | ||
b8b0239f | 942 | # Bootstrapping does the following: |
bbe099e7 | 943 | # * Remove files to start from a bootstrap-clean slate. |
dee26dfa | 944 | # * Run autogen.sh, falling back on copy_autogen if autogen.sh fails. |
bbe099e7 | 945 | # * Rebuild Makefile, to update the build procedure itself. |
b8b0239f | 946 | # * Do the actual build. |
067d23c9 | 947 | bootstrap: bootstrap-clean FRC |
dee26dfa | 948 | cd $(srcdir) && { ./autogen.sh || autogen/copy_autogen; } |
c462dda8 | 949 | $(MAKE) $(MFLAGS) MAKEFILE_NAME=force-Makefile force-Makefile |
067d23c9 KY |
950 | $(MAKE) $(MFLAGS) info all |
951 | ||
952 | .PHONY: check-declare | |
953 | ||
954 | check-declare: | |
4f8c52a9 | 955 | @if [ ! -f $(srcdir)/src/emacs ]; then \ |
067d23c9 KY |
956 | echo "You must build Emacs to use this command"; \ |
957 | exit 1; \ | |
958 | fi | |
959 | (cd leim; $(MAKE) $(MFLAGS) $@) | |
960 | (cd lisp; $(MAKE) $(MFLAGS) $@) |