Commit | Line | Data |
---|---|---|
46947372 JB |
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. | |
86a5659e | 4 | |
46947372 JB |
5 | # make all to compile and build Emacs. |
6 | # make install to install it. | |
78008d14 | 7 | # make TAGS to update tags tables. |
86a5659e | 8 | # |
78008d14 JB |
9 | # make clean or make mostlyclean |
10 | # Delete all files from the current directory that are normally | |
868e080d | 11 | # created by building the program. Don't delete the files that |
78008d14 JB |
12 | # record the configuration. Also preserve files that could be made |
13 | # by building, but normally aren't because the distribution comes | |
14 | # with them. | |
15 | # | |
16 | # Delete `.dvi' files here if they are not part of the distribution. | |
17 | # | |
18 | # make distclean | |
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 | |
23 | # distribution. | |
24 | # | |
26873b72 | 25 | # make maintainer-clean |
78008d14 JB |
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. | |
30 | # | |
31 | # make extraclean | |
32 | # Still more severe - delete backup and autosave files, too. | |
86a5659e JB |
33 | |
34 | SHELL = /bin/sh | |
2dc44cb5 RS |
35 | |
36 | # If Make doesn't predefine MAKE, set it here. | |
37 | @SET_MAKE@ | |
86a5659e | 38 | |
78008d14 | 39 | # ==================== Things `configure' Might Edit ==================== |
86a5659e | 40 | |
c75ff9db | 41 | CC=@CC@ |
d4acf74f | 42 | CPP=@CPP@ |
c75ff9db | 43 | C_SWITCH_SYSTEM=@c_switch_system@ |
d3245f70 | 44 | ALLOCA=@ALLOCA@ |
b6472fc1 JB |
45 | LN_S=@LN_S@ |
46 | CFLAGS=@CFLAGS@ | |
bb5f88cc | 47 | LDFLAGS=@LDFLAGS@ |
e17d7117 | 48 | CPPFLAGS=@CPPFLAGS@ |
46af2ed8 | 49 | C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ |
09b89128 | 50 | LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@ |
4b5a51c1 | 51 | YACC=@YACC@ |
78008d14 JB |
52 | |
53 | ### These help us choose version- and architecture-specific directories | |
54 | ### to install files in. | |
55 | ||
56 | ### This should be the number of the Emacs version we're building, | |
57 | ### like `18.59' or `19.0'. | |
c75ff9db | 58 | version=@version@ |
78008d14 JB |
59 | |
60 | ### This should be the name of the configuration we're building Emacs | |
61 | ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'. | |
c75ff9db JB |
62 | configuration=@configuration@ |
63 | ||
78008d14 JB |
64 | # ==================== Where To Install Things ==================== |
65 | ||
46947372 | 66 | # The default location for installation. Everything is placed in |
78008d14 JB |
67 | # subdirectories of this directory. The default values for many of |
68 | # the variables below are expressed in terms of this one, so you may | |
8d467c70 JB |
69 | # not need to change them. This defaults to /usr/local. |
70 | prefix=@prefix@ | |
86a5659e | 71 | |
78008d14 | 72 | # Like `prefix', but used for architecture-specific files. |
86ddcc58 | 73 | exec_prefix=@exec_prefix@ |
78008d14 | 74 | |
46947372 JB |
75 | # Where to install Emacs and other binaries that people will want to |
76 | # run directly (like etags). | |
0e265b72 | 77 | bindir=@bindir@ |
86a5659e | 78 | |
868e080d | 79 | # Where to install architecture-independent data files. ${lispdir} |
78008d14 | 80 | # and ${etcdir} are subdirectories of this. |
0e265b72 | 81 | datadir=@datadir@ |
0c22fbca JB |
82 | |
83 | # Where to install and expect the files that Emacs modifies as it | |
c5bfadd6 RS |
84 | # runs. These files are all architecture-independent. |
85 | # Right now, this is not used. | |
3e74e344 | 86 | sharedstatedir=@sharedstatedir@ |
0c22fbca JB |
87 | |
88 | # Where to install and expect executable files to be run by Emacs | |
89 | # rather than directly by users, and other architecture-dependent | |
868e080d | 90 | # data. ${archlibdir} is a subdirectory of this. |
2fd54e64 | 91 | libexecdir=@libexecdir@ |
0c22fbca JB |
92 | |
93 | # Where to install Emacs's man pages, and what extension they should have. | |
0e265b72 | 94 | mandir=@mandir@ |
0c22fbca | 95 | manext=.1 |
88e7bbf1 | 96 | man1dir=$(mandir)/man1 |
0c22fbca JB |
97 | |
98 | # Where to install and expect the info files describing Emacs. In the | |
99 | # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but | |
100 | # since there are now many packages documented with the texinfo | |
101 | # system, it is inappropriate to imply that it is part of Emacs. | |
0e265b72 | 102 | infodir=@infodir@ |
86a5659e | 103 | |
b2f3c6b2 RS |
104 | # Where to look for bitmap files. |
105 | bitmapdir=@bitmapdir@ | |
106 | ||
00c29909 | 107 | # Where to find the source code. The source code for Emacs's C kernel is |
78008d14 JB |
108 | # expected to be in ${srcdir}/src, and the source code for Emacs's |
109 | # utility programs is expected to be in ${srcdir}/lib-src. This is | |
110 | # set by the configure script's `--srcdir' option. | |
d3245f70 | 111 | srcdir=@srcdir@ |
86a5659e | 112 | |
f854bb66 RM |
113 | # Tell make where to find source files; this is needed for the makefiles. |
114 | VPATH=@srcdir@ | |
115 | ||
3163d9cf RS |
116 | # Where to find the application default. |
117 | x_default_search_path=@x_default_search_path@ | |
118 | ||
0c22fbca JB |
119 | # ==================== Emacs-specific directories ==================== |
120 | ||
78008d14 JB |
121 | # These variables hold the values Emacs will actually use. They are |
122 | # based on the values of the standard Make variables above. | |
123 | ||
0e265b72 BF |
124 | # Where to install the lisp files distributed with |
125 | # Emacs. This includes the Emacs version, so that the | |
126 | # lisp files for different versions of Emacs will install | |
127 | # themselves in separate directories. | |
128 | lispdir=@lispdir@ | |
d3245f70 | 129 | |
0e265b72 BF |
130 | # Directories Emacs should search for lisp files specific |
131 | # to this site (i.e. customizations), before consulting | |
132 | # ${lispdir}. This should be a colon-separated list of | |
133 | # directories. | |
134 | locallisppath=@locallisppath@ | |
d3245f70 JB |
135 | |
136 | # Where Emacs will search to find its lisp files. Before | |
137 | # changing this, check to see if your purpose wouldn't | |
138 | # better be served by changing locallisppath. This | |
46947372 | 139 | # should be a colon-separated list of directories. |
0e265b72 | 140 | lisppath=@lisppath@ |
86a5659e | 141 | |
d3245f70 JB |
142 | # Where Emacs will search for its lisp files while |
143 | # building. This is only used during the process of | |
144 | # compiling Emacs, to help Emacs find its lisp files | |
145 | # before they've been installed in their final location. | |
90ac71dc RS |
146 | # It's usually identical to lisppath, except that |
147 | # it does not include locallisppath, and the | |
d3245f70 JB |
148 | # entry for the directory containing the installed lisp |
149 | # files has been replaced with ../lisp. This should be a | |
150 | # colon-separated list of directories. | |
3dbc7e32 | 151 | buildlisppath=${srcdir}/lisp |
86a5659e | 152 | |
0e265b72 BF |
153 | # Where to install the other architecture-independent |
154 | # data files distributed with Emacs (like the tutorial, | |
155 | # the cookie recipes and the Zippy database). This path | |
156 | # usually contains the Emacs version number, so the data | |
157 | # files for multiple versions of Emacs may be installed | |
158 | # at once. | |
159 | etcdir=@etcdir@ | |
160 | ||
0e265b72 BF |
161 | # Where to put executables to be run by Emacs rather than |
162 | # the user. This path usually includes the Emacs version | |
163 | # and configuration name, so that multiple configurations | |
164 | # for multiple versions of Emacs may be installed at | |
165 | # once. | |
166 | archlibdir=@archlibdir@ | |
a34902ab | 167 | |
e408046f KH |
168 | # Where to put the docstring file. |
169 | docdir=@docdir@ | |
170 | ||
46947372 JB |
171 | # ==================== Utility Programs for the Build ==================== |
172 | ||
173 | # Allow the user to specify the install program. | |
19697295 | 174 | INSTALL = @INSTALL@ |
86ddcc58 JB |
175 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
176 | INSTALL_DATA = @INSTALL_DATA@ | |
c1b8c545 RS |
177 | # By default, we uphold the dignity of our programs. |
178 | INSTALL_STRIP = | |
46947372 | 179 | |
46947372 | 180 | # ============================= Targets ============================== |
86a5659e | 181 | |
9ef7f9f0 KH |
182 | # What emacs should be called when installed. |
183 | EMACS = emacs | |
184 | ||
86a5659e JB |
185 | # Subdirectories to make recursively. `lisp' is not included |
186 | # because the compiled lisp files are part of the distribution | |
187 | # and you cannot remake them without installing Emacs first. | |
c55db078 | 188 | SUBDIR = lib-src src leim |
86a5659e | 189 | |
78008d14 | 190 | # The makefiles of the directories in $SUBDIR. |
c55db078 | 191 | SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile |
78008d14 | 192 | |
83f6a565 JB |
193 | # Subdirectories to install, and where they'll go. |
194 | # lib-src's makefile knows how to install it, so we don't do that here. | |
c55db078 | 195 | # leim's makefile also knows how to install it, so we don't do that here. |
83f6a565 JB |
196 | # When installing the info files, we need to do special things to |
197 | # avoid nuking an existing dir file, so we don't do that here; | |
198 | # instead, we have written out explicit code in the `install' targets. | |
78c7997f RS |
199 | COPYDIR = ${srcdir}/etc ${srcdir}/lisp |
200 | COPYDESTS = ${etcdir} ${lispdir} | |
86a5659e | 201 | |
0a0dca73 | 202 | all: ${SUBDIR} |
86a5659e | 203 | |
309848ba | 204 | removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g' |
46947372 | 205 | |
0a0dca73 RS |
206 | # Generate paths.h from paths.in. This target is invoked by `configure'. |
207 | paths-force: FRC | |
8672a560 RS |
208 | @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \ |
209 | buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \ | |
3163d9cf | 210 | x_default_search_path=`echo ${x_default_search_path}`; \ |
8d61b1e0 | 211 | sed < ${srcdir}/src/paths.in > paths.h.$$$$ \ |
8672a560 RS |
212 | -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \ |
213 | -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \ | |
214 | -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ | |
215 | -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \ | |
216 | -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \ | |
b2f3c6b2 | 217 | -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \ |
3163d9cf | 218 | -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \ |
3f16db29 | 219 | -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \ |
8d61b1e0 | 220 | ${srcdir}/move-if-change paths.h.$$$$ src/paths.h |
8672a560 | 221 | |
bea3ec88 RS |
222 | # For parallel make, src should be build before leim. |
223 | leim: src | |
224 | ||
0a0dca73 | 225 | src: lib-src FRC |
a874c104 | 226 | |
f2f4aae9 | 227 | lib-src: FRC src/config.stamp |
86a5659e JB |
228 | |
229 | .RECURSIVE: ${SUBDIR} | |
230 | ||
78008d14 | 231 | ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC |
0e265b72 | 232 | cd $@; $(MAKE) all $(MFLAGS) \ |
7c811eec RS |
233 | CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ |
234 | LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' | |
0e265b72 | 235 | |
8672a560 | 236 | blessmail: ${SUBDIR_MAKEFILES} src FRC |
df8bde8b RS |
237 | cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \ |
238 | MAKE='${MAKE}' archlibdir='$(archlibdir)' | |
d541babe | 239 | |
0e265b72 BF |
240 | Makefile: Makefile.in config.status |
241 | ./config.status | |
242 | ||
d58c5947 | 243 | src/Makefile: src/Makefile.in config.status |
0e265b72 BF |
244 | ./config.status |
245 | ||
f2f4aae9 | 246 | src/config.stamp: src/config.in config.status |
a5f32ce4 | 247 | ./config.status |
f2f4aae9 | 248 | touch src/config.stamp |
a5f32ce4 | 249 | |
0e265b72 BF |
250 | lib-src/Makefile: lib-src/Makefile.in config.status |
251 | ./config.status | |
252 | ||
fdeed418 RS |
253 | man/Makefile: man/Makefile.in config.status |
254 | ./config.status | |
255 | ||
0e265b72 | 256 | oldXMenu/Makefile: oldXMenu/Makefile.in config.status |
78008d14 JB |
257 | ./config.status |
258 | ||
98dfba1b RS |
259 | lwlib/Makefile: lwlib/Makefile.in config.status |
260 | ./config.status | |
261 | ||
c55db078 KH |
262 | leim/Makefile: leim/Makefile.in config.status |
263 | ./config.status | |
264 | ||
78008d14 JB |
265 | # ==================== Installation ==================== |
266 | ||
dbc4e1c1 JB |
267 | ## If we let lib-src do its own installation, that means we |
268 | ## don't have to duplicate the list of utilities to install in | |
269 | ## this Makefile as well. | |
d3245f70 | 270 | |
3dbc7e32 JB |
271 | ## On AIX, use tar xBf. |
272 | ## On Xenix, use tar xpf. | |
273 | ||
9ef7f9f0 | 274 | .PHONY: install mkdir |
98dfba1b | 275 | |
d3245f70 JB |
276 | ## We delete each directory in ${COPYDESTS} before we copy into it; |
277 | ## that way, we can reinstall over directories that have been put in | |
278 | ## place with their files read-only (perhaps because they are checked | |
279 | ## into RCS). In order to make this safe, we make sure that the | |
280 | ## source exists and is distinct from the destination. | |
d7ce568f RS |
281 | ### We do install-arch-indep first because |
282 | ### the executable needs the Lisp files and DOC file to work properly. | |
cff455ae | 283 | install: all install-arch-indep install-arch-dep install-leim blessmail |
a5038ae5 | 284 | @true |
8b14d296 | 285 | |
d7e2eff6 | 286 | ### Install the executables that were compiled specifically for this machine. |
d7ce568f RS |
287 | ### It would be nice to do something for a parallel make |
288 | ### to ensure that install-arch-indep finishes before this starts. | |
289 | install-arch-dep: mkdir | |
8b14d296 | 290 | (cd lib-src; \ |
0e265b72 | 291 | $(MAKE) install $(MFLAGS) prefix=${prefix} \ |
2fd54e64 | 292 | exec_prefix=${exec_prefix} bindir=${bindir} \ |
c1b8c545 RS |
293 | libexecdir=${libexecdir} archlibdir=${archlibdir} \ |
294 | INSTALL_STRIP=${INSTALL_STRIP}) | |
295 | ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs ${bindir}/emacs-${version} | |
08068cb6 | 296 | -chmod 1755 ${bindir}/emacs-${version} |
9ef7f9f0 KH |
297 | rm -f ${bindir}/$(EMACS) |
298 | -ln ${bindir}/emacs-${version} ${bindir}/$(EMACS) | |
08068cb6 | 299 | |
d7e2eff6 RS |
300 | ### Install the files that are machine-independent. |
301 | ### Most of them come straight from the distribution; | |
302 | ### the exception is the DOC-* files, which are copied | |
24127cf7 | 303 | ## from the build directory. |
d7e2eff6 | 304 | |
24127cf7 KH |
305 | ## Note that we copy DOC* and then delete DOC |
306 | ## as a workaround for a bug in tar on Ultrix 4.2. | |
d7d265f4 | 307 | install-arch-indep: mkdir |
46947372 | 308 | -set ${COPYDESTS} ; \ |
d7e2eff6 RS |
309 | for dir in ${COPYDIR} ; do \ |
310 | if [ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \ | |
311 | rm -rf $$1 ; \ | |
312 | fi ; \ | |
313 | shift ; \ | |
314 | done | |
005775ce | 315 | -set ${COPYDESTS} ; \ |
d7e2eff6 RS |
316 | mkdir ${COPYDESTS} ; \ |
317 | chmod ugo+rx ${COPYDESTS} ; \ | |
318 | for dir in ${COPYDIR} ; do \ | |
319 | dest=$$1 ; shift ; \ | |
320 | [ -d $${dir} ] \ | |
321 | && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \ | |
322 | && (echo "Copying $${dir} to $${dest}..." ; \ | |
98cd1034 RS |
323 | (cd $${dir}; tar -cf - . ) \ |
324 | |(cd $${dest};umask 022; tar -xvf - && cat > /dev/null); \ | |
d7e2eff6 | 325 | for subdir in `find $${dest} -type d ! -name RCS -print` ; do \ |
5fab7212 | 326 | chmod a+rx $${subdir} ; \ |
d7e2eff6 RS |
327 | rm -rf $${subdir}/RCS ; \ |
328 | rm -rf $${subdir}/CVS ; \ | |
329 | rm -f $${subdir}/\#* ; \ | |
330 | rm -f $${subdir}/.\#* ; \ | |
331 | rm -f $${subdir}/*~ ; \ | |
332 | rm -f $${subdir}/*.orig ; \ | |
333 | rm -f $${subdir}/[mM]akefile* ; \ | |
334 | rm -f $${subdir}/ChangeLog* ; \ | |
335 | rm -f $${subdir}/dired.todo ; \ | |
336 | done) ; \ | |
337 | done | |
b2f3c6b2 | 338 | -rm -f ${lispdir}/subdirs.el |
b4594994 | 339 | $(srcdir)/update-subdirs ${lispdir} |
cb58a6d0 | 340 | -rm -f ${datadir}/emacs/${version}/site-lisp/subdirs.el |
8dd455e1 RS |
341 | (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \ |
342 | echo " (normal-top-level-add-subdirs-to-load-path))") \ | |
cb58a6d0 KH |
343 | > ${datadir}/emacs/${version}/site-lisp/subdirs.el |
344 | -rm -f ${datadir}/emacs/site-lisp/subdirs.el | |
8dd455e1 RS |
345 | (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \ |
346 | echo " (normal-top-level-add-subdirs-to-load-path))") \ | |
cb58a6d0 | 347 | > ${datadir}/emacs/site-lisp/subdirs.el |
3577cff0 | 348 | -chmod -R a+r ${COPYDESTS} |
3be1f08e RS |
349 | if [ `(cd ./etc; /bin/pwd)` != `(cd ${docdir}; /bin/pwd)` ]; \ |
350 | then \ | |
99d7a69d | 351 | echo "Copying etc/DOC-* to ${docdir} ..." ; \ |
98cd1034 RS |
352 | (cd ./etc; tar -cf - DOC*) \ |
353 | |(cd ${docdir}; umask 0; tar -xvf - && cat > /dev/null); \ | |
ec28575a | 354 | (cd $(docdir); chmod a+r DOC*; rm DOC); \ |
3be1f08e | 355 | else true; fi |
7d2cdc3c | 356 | if [ -r ./lisp ] \ |
bc63f59a | 357 | && [ -r ./lisp/simple.el ] \ |
7d2cdc3c | 358 | && [ x`(cd ./lisp; /bin/pwd)` != x`(cd ${lispdir}; /bin/pwd)` ] \ |
9ca335ed RS |
359 | && [ x`(cd ${srcdir}/lisp; /bin/pwd)` != x`(cd ./lisp; /bin/pwd)` ]; \ |
360 | then \ | |
361 | echo "Copying lisp/*.el and lisp/*.elc to ${lispdir} ..." ; \ | |
98cd1034 RS |
362 | (cd lisp; tar -cf - *.el *.elc) \ |
363 | |(cd ${lispdir}; umask 0; tar -xvf - && cat > /dev/null); \ | |
9ca335ed | 364 | else true; fi |
8672a560 | 365 | thisdir=`/bin/pwd`; \ |
21e8e1db | 366 | if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \ |
5e9e88fd | 367 | then \ |
469dd2ef | 368 | (cd ${infodir}; \ |
6e2f2e92 | 369 | if [ -f dir ]; then \ |
efe7425c RS |
370 | if [ ! -f dir.old ]; then mv -f dir dir.old; \ |
371 | else mv -f dir dir.bak; fi; \ | |
372 | fi; \ | |
469dd2ef RS |
373 | cd ${srcdir}/info ; \ |
374 | (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir); \ | |
d7e2eff6 | 375 | (cd $${thisdir}; chmod a+r ${infodir}/dir); \ |
6437ca04 | 376 | for f in ccmode* cl* customize* dired-x* ediff* emacs* forms* gnus* info* message* mh-e* reftex* sc* vip* widget*; do \ |
d7e2eff6 RS |
377 | (cd $${thisdir}; \ |
378 | ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \ | |
379 | chmod a+r ${infodir}/$$f); \ | |
ce0b6622 | 380 | done); \ |
21e8e1db | 381 | else true; fi |
d7e2eff6 RS |
382 | thisdir=`/bin/pwd`; \ |
383 | cd ${srcdir}/etc; \ | |
384 | for page in emacs etags ctags ; do \ | |
385 | (cd $${thisdir}; \ | |
386 | ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${man1dir}/$${page}${manext}; \ | |
387 | chmod a+r ${man1dir}/$${page}${manext}); \ | |
868e080d | 388 | done |
badb0a97 | 389 | |
24127cf7 KH |
390 | ### Install LEIM files. Although they are machine-independent, we |
391 | ### have separate target here instead of including it in | |
392 | ### `install-arch-indep'. People who extracted LEIM files after they | |
393 | ### insalled Emacs itself can install only LEIM files by this target. | |
bea3ec88 | 394 | install-leim: leim/Makefile mkdir |
c10f84fb | 395 | cd leim; $(MAKE) install |
24127cf7 | 396 | |
8df9abae RS |
397 | ### Build Emacs and install it, stripping binaries while installing them. |
398 | install-strip: | |
c1b8c545 | 399 | $(MAKE) INSTALL_STRIP=-s |
8df9abae | 400 | |
868e080d | 401 | ### Build all the directories we're going to install Emacs in. Since |
78008d14 | 402 | ### we may be creating several layers of directories (for example, |
614b45a7 | 403 | ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use mkinstalldirs |
6784fb67 | 404 | ### instead of mkdir. Not all systems' mkdir programs have the `-p' flag. |
05ed817f | 405 | mkdir: FRC |
c5bfadd6 | 406 | $(srcdir)/mkinstalldirs ${COPYDESTS} ${infodir} ${man1dir} \ |
2fd54e64 | 407 | ${bindir} ${datadir} ${docdir} ${libexecdir} \ |
309848ba | 408 | `echo ${locallisppath} | sed 's/:/ /g'` |
86a5659e | 409 | |
d4acf74f JB |
410 | ### Delete all the installed files that the `install' target would |
411 | ### create (but not the noninstalled files such as `make all' would | |
412 | ### create). | |
44257b1a JB |
413 | ### |
414 | ### Don't delete the lisp and etc directories if they're in the source tree. | |
d4acf74f | 415 | uninstall: |
44257b1a | 416 | (cd lib-src; \ |
0e265b72 | 417 | $(MAKE) $(MFLAGS) uninstall \ |
44257b1a | 418 | prefix=${prefix} exec_prefix=${exec_prefix} \ |
2fd54e64 | 419 | bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir}) |
44257b1a | 420 | for dir in ${lispdir} ${etcdir} ; do \ |
726d0798 | 421 | if [ -d $${dir} ]; then \ |
8672a560 RS |
422 | case `(cd $${dir} ; /bin/pwd)` in \ |
423 | `(cd ${srcdir} ; /bin/pwd)`* ) ;; \ | |
726d0798 RS |
424 | * ) rm -rf $${dir} ;; \ |
425 | esac ; \ | |
426 | case $${dir} in \ | |
427 | ${datadir}/emacs/${version}/* ) \ | |
428 | rm -rf ${datadir}/emacs/${version} \ | |
429 | ;; \ | |
430 | esac ; \ | |
431 | fi ; \ | |
44257b1a | 432 | done |
1eb9aca7 | 433 | (cd ${infodir} && rm -f cl* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* vip*) |
88e7bbf1 | 434 | (cd ${man1dir} && rm -f emacs.1 etags.1 ctags.1) |
6b356ee8 | 435 | (cd ${bindir} && rm -f emacs-${version} $(EMACS)) |
d4acf74f JB |
436 | |
437 | ||
05ed817f | 438 | FRC: |
78008d14 JB |
439 | |
440 | # ==================== Cleaning up and miscellanea ==================== | |
441 | ||
26873b72 | 442 | .PHONY: mostlyclean clean distclean maintainer-clean extraclean |
98dfba1b | 443 | |
78008d14 | 444 | ### `mostlyclean' |
d4acf74f JB |
445 | ### Like `clean', but may refrain from deleting a few files that people |
446 | ### normally don't want to recompile. For example, the `mostlyclean' | |
447 | ### target for GCC does not delete `libgcc.a', because recompiling it | |
448 | ### is rarely necessary and takes a lot of time. | |
05ed817f | 449 | mostlyclean: FRC |
0e265b72 BF |
450 | (cd src; $(MAKE) $(MFLAGS) mostlyclean) |
451 | (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean) | |
98dfba1b | 452 | (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean) |
0e265b72 | 453 | (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean) |
e6124e9d | 454 | -(cd man && $(MAKE) $(MFLAGS) mostlyclean) |
fa2ea19a | 455 | (cd leim; $(MAKE) $(MFLAGS) mostlyclean) |
d4acf74f JB |
456 | |
457 | ### `clean' | |
458 | ### Delete all files from the current directory that are normally | |
459 | ### created by building the program. Don't delete the files that | |
460 | ### record the configuration. Also preserve files that could be made | |
461 | ### by building, but normally aren't because the distribution comes | |
462 | ### with them. | |
78008d14 | 463 | ### |
d4acf74f | 464 | ### Delete `.dvi' files here if they are not part of the distribution. |
05ed817f | 465 | clean: FRC |
0e265b72 BF |
466 | (cd src; $(MAKE) $(MFLAGS) clean) |
467 | (cd oldXMenu; $(MAKE) $(MFLAGS) clean) | |
98dfba1b | 468 | (cd lwlib; $(MAKE) $(MFLAGS) clean) |
0e265b72 | 469 | (cd lib-src; $(MAKE) $(MFLAGS) clean) |
e6124e9d | 470 | -(cd man && $(MAKE) $(MFLAGS) clean) |
fa2ea19a | 471 | (cd leim; $(MAKE) $(MFLAGS) clean) |
46947372 | 472 | |
78008d14 | 473 | ### `distclean' |
d4acf74f JB |
474 | ### Delete all files from the current directory that are created by |
475 | ### configuring or building the program. If you have unpacked the | |
476 | ### source and built the program without creating any other files, | |
477 | ### `make distclean' should leave only the files that were in the | |
478 | ### distribution. | |
479 | top_distclean=\ | |
dffd6dac | 480 | rm -f config.status config.cache config.log ; \ |
d4acf74f | 481 | rm -f Makefile ${SUBDIR_MAKEFILES} ; \ |
80e79e3e | 482 | if [ -d lock ] ; then (cd lock && (rm -f * || true)); else true; fi |
05ed817f | 483 | distclean: FRC |
0e265b72 BF |
484 | (cd src; $(MAKE) $(MFLAGS) distclean) |
485 | (cd oldXMenu; $(MAKE) $(MFLAGS) distclean) | |
98dfba1b | 486 | (cd lwlib; $(MAKE) $(MFLAGS) distclean) |
0e265b72 | 487 | (cd lib-src; $(MAKE) $(MFLAGS) distclean) |
e6124e9d | 488 | (cd man && $(MAKE) $(MFLAGS) distclean) |
fa2ea19a | 489 | (cd leim; $(MAKE) $(MFLAGS) distclean) |
d4acf74f | 490 | ${top_distclean} |
46947372 | 491 | |
26873b72 | 492 | ### `maintainer-clean' |
d4acf74f JB |
493 | ### Delete everything from the current directory that can be |
494 | ### reconstructed with this Makefile. This typically includes | |
495 | ### everything deleted by distclean, plus more: C source files | |
496 | ### produced by Bison, tags tables, info files, and so on. | |
497 | ### | |
26873b72 | 498 | ### One exception, however: `make maintainer-clean' should not delete |
d4acf74f | 499 | ### `configure' even if `configure' can be remade using a rule in the |
26873b72 | 500 | ### Makefile. More generally, `make maintainer-clean' should not delete |
d4acf74f JB |
501 | ### anything that needs to exist in order to run `configure' and then |
502 | ### begin to build the program. | |
26873b72 RS |
503 | maintainer-clean: FRC |
504 | (cd src; $(MAKE) $(MFLAGS) maintainer-clean) | |
505 | (cd oldXMenu; $(MAKE) $(MFLAGS) maintainer-clean) | |
506 | (cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean) | |
507 | (cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean) | |
508 | -(cd man && $(MAKE) $(MFLAGS) maintainer-clean) | |
fa2ea19a | 509 | (cd leim; $(MAKE) $(MFLAGS) maintainer-clean) |
d4acf74f | 510 | ${top_distclean} |
46947372 | 511 | |
78008d14 JB |
512 | ### This doesn't actually appear in the coding standards, but Karl |
513 | ### says GCC supports it, and that's where the configuration part of | |
514 | ### the coding standards seem to come from. It's like distclean, but | |
515 | ### it deletes backup and autosave files too. | |
516 | extraclean: | |
0e265b72 | 517 | for i in ${SUBDIR}; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done |
9e8886a8 RS |
518 | ${top_distclean} |
519 | -rm config-tmp-* | |
78008d14 JB |
520 | -rm -f *~ \#* |
521 | ||
29c0047b ER |
522 | ### Unlocking and relocking. The idea of these productions is to reduce |
523 | ### hassles when installing an incremental tar of Emacs. Do `make unlock' | |
524 | ### before unlocking the file to take the write locks off all sources so | |
525 | ### that tar xvof will overwrite them without fuss. Then do `make relock' | |
526 | ### afterward so that VC mode will know which files should be checked in | |
527 | ### if you want to mung them. | |
528 | ### | |
529 | ### Note: it's no disaster if these productions miss a file or two; tar | |
530 | ### and VC will swiftly let you know if this happens, and it is easily | |
531 | ### corrected. | |
e5f83e23 | 532 | SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in \ |
24470d72 | 533 | README configure make-dist move-if-change |
29c0047b | 534 | |
98dfba1b RS |
535 | .PHONY: unlock relock |
536 | ||
29c0047b | 537 | unlock: |
0c19c8b3 | 538 | chmod u+w $(SOURCES) |
29c0047b | 539 | -(cd elisp; chmod u+w Makefile README *.texi) |
0e265b72 BF |
540 | (cd etc; $(MAKE) $(MFLAGS) unlock) |
541 | (cd lib-src; $(MAKE) $(MFLAGS) unlock) | |
542 | (cd lisp; $(MAKE) $(MFLAGS) unlock) | |
29c0047b ER |
543 | (cd lisp/term; chmod u+w README *.el) |
544 | (cd man; chmod u+w *texi* ChangeLog split-man) | |
545 | (cd oldXMenu; chmod u+w *.[ch] Makefile README) | |
98dfba1b | 546 | (cd lwlib; chmod u+w *.[ch] Makefile README) |
0e265b72 | 547 | (cd src; $(MAKE) $(MFLAGS) unlock) |
29c0047b ER |
548 | |
549 | relock: | |
0c19c8b3 | 550 | chmod u-w $(SOURCES) |
29c0047b | 551 | -(cd elisp; chmod u-w Makefile README *.texi) |
0e265b72 BF |
552 | (cd etc; $(MAKE) $(MFLAGS) relock) |
553 | (cd lib-src; $(MAKE) $(MFLAGS) relock) | |
554 | (cd lisp; $(MAKE) $(MFLAGS) relock) | |
29c0047b ER |
555 | (cd lisp/term; chmod u+w README *.el) |
556 | (cd man; chmod u+w *texi* ChangeLog split-man) | |
557 | (cd oldXMenu; chmod u+w *.[ch] Makefile README) | |
98dfba1b | 558 | (cd lwlib; chmod u+w *.[ch] Makefile README) |
0e265b72 | 559 | (cd src; $(MAKE) $(MFLAGS) relock) |
78008d14 | 560 | |
fdeed418 | 561 | TAGS tags: lib-src src |
a383fece RS |
562 | # The src subdir knows how to do the right thing |
563 | # even when the build directory and source dir are different. | |
564 | cd src; $(MAKE) tags | |
46947372 JB |
565 | |
566 | check: | |
567 | @echo "We don't have any tests for GNU Emacs yet." | |
4746118a JB |
568 | |
569 | dist: | |
78008d14 | 570 | cd ${srcdir}; make-dist |
d4acf74f | 571 | |
653ddcc3 RS |
572 | .PHONY: info dvi dist check |
573 | force-info: | |
574 | info: force-info | |
5c5f75f1 RS |
575 | # Note that man/Makefile knows how to |
576 | # put the info files in $(srcdir), | |
577 | # so we can do ok running make in the build dir. | |
578 | (cd man; $(MAKE) $(MFLAGS) info) | |
d4acf74f | 579 | dvi: |
6784fb67 | 580 | (cd man; $(MAKE) $(MFLAGS) dvi) |