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 | # | |
25 | # make realclean | |
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 | |
08edea3c | 35 | MAKE = make # BSD doesn't have it as a default. |
86a5659e | 36 | |
78008d14 | 37 | # ==================== Things `configure' Might Edit ==================== |
86a5659e | 38 | |
c75ff9db | 39 | CC=@CC@ |
d4acf74f | 40 | CPP=@CPP@ |
c75ff9db | 41 | C_SWITCH_SYSTEM=@c_switch_system@ |
d3245f70 | 42 | ALLOCA=@ALLOCA@ |
b6472fc1 JB |
43 | LN_S=@LN_S@ |
44 | CFLAGS=@CFLAGS@ | |
46af2ed8 | 45 | C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ |
09b89128 | 46 | LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@ |
4b5a51c1 | 47 | YACC=@YACC@ |
78008d14 JB |
48 | |
49 | ### These help us choose version- and architecture-specific directories | |
50 | ### to install files in. | |
51 | ||
52 | ### This should be the number of the Emacs version we're building, | |
53 | ### like `18.59' or `19.0'. | |
c75ff9db | 54 | version=@version@ |
78008d14 JB |
55 | |
56 | ### This should be the name of the configuration we're building Emacs | |
57 | ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'. | |
c75ff9db JB |
58 | configuration=@configuration@ |
59 | ||
60 | ### Libraries which should be edited into lib-src/Makefile. | |
61 | libsrc_libs=@libsrc_libs@ | |
0c22fbca | 62 | |
78008d14 JB |
63 | # ==================== Where To Install Things ==================== |
64 | ||
46947372 | 65 | # The default location for installation. Everything is placed in |
78008d14 JB |
66 | # subdirectories of this directory. The default values for many of |
67 | # the variables below are expressed in terms of this one, so you may | |
8d467c70 JB |
68 | # not need to change them. This defaults to /usr/local. |
69 | prefix=@prefix@ | |
86a5659e | 70 | |
78008d14 | 71 | # Like `prefix', but used for architecture-specific files. |
86ddcc58 | 72 | exec_prefix=@exec_prefix@ |
78008d14 | 73 | |
46947372 JB |
74 | # Where to install Emacs and other binaries that people will want to |
75 | # run directly (like etags). | |
78008d14 | 76 | bindir=${exec_prefix}/bin |
86a5659e | 77 | |
868e080d | 78 | # Where to install architecture-independent data files. ${lispdir} |
78008d14 JB |
79 | # and ${etcdir} are subdirectories of this. |
80 | datadir=${prefix}/lib | |
0c22fbca JB |
81 | |
82 | # Where to install and expect the files that Emacs modifies as it | |
868e080d | 83 | # runs. These files are all architecture-independent. Right now, the |
78008d14 JB |
84 | # only such data is the locking directory; ${lockdir} is a |
85 | # subdirectory of this. | |
86 | statedir=${prefix}/lib | |
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. |
78008d14 | 91 | libdir=${exec_prefix}/lib |
0c22fbca JB |
92 | |
93 | # Where to install Emacs's man pages, and what extension they should have. | |
78008d14 | 94 | mandir=${prefix}/man/man1 |
0c22fbca JB |
95 | manext=.1 |
96 | ||
97 | # Where to install and expect the info files describing Emacs. In the | |
98 | # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but | |
99 | # since there are now many packages documented with the texinfo | |
100 | # system, it is inappropriate to imply that it is part of Emacs. | |
101 | infodir=${prefix}/info | |
86a5659e | 102 | |
00c29909 | 103 | # Where to find the source code. The source code for Emacs's C kernel is |
78008d14 JB |
104 | # expected to be in ${srcdir}/src, and the source code for Emacs's |
105 | # utility programs is expected to be in ${srcdir}/lib-src. This is | |
106 | # set by the configure script's `--srcdir' option. | |
d3245f70 | 107 | srcdir=@srcdir@ |
86a5659e | 108 | |
0c22fbca JB |
109 | # ==================== Emacs-specific directories ==================== |
110 | ||
78008d14 JB |
111 | # These variables hold the values Emacs will actually use. They are |
112 | # based on the values of the standard Make variables above. | |
113 | ||
d3245f70 JB |
114 | @inst_paths@# Where to install the lisp files distributed with |
115 | @inst_paths@# Emacs. This includes the Emacs version, so that the | |
116 | @inst_paths@# lisp files for different versions of Emacs will install | |
117 | @inst_paths@# themselves in separate directories. | |
118 | @inst_paths@lispdir=${datadir}/emacs/${version}/lisp | |
119 | ||
d3245f70 JB |
120 | @inst_paths@# Directories Emacs should search for lisp files specific |
121 | @inst_paths@# to this site (i.e. customizations), before consulting | |
122 | @inst_paths@# ${lispdir}. This should be a colon-separated list of | |
123 | @inst_paths@# directories. | |
124 | @inst_paths@locallisppath=${datadir}/emacs/site-lisp | |
125 | ||
126 | # Where Emacs will search to find its lisp files. Before | |
127 | # changing this, check to see if your purpose wouldn't | |
128 | # better be served by changing locallisppath. This | |
46947372 | 129 | # should be a colon-separated list of directories. |
ab8478d1 | 130 | lisppath=${locallisppath}:${lispdir} |
86a5659e | 131 | |
d3245f70 JB |
132 | # Where Emacs will search for its lisp files while |
133 | # building. This is only used during the process of | |
134 | # compiling Emacs, to help Emacs find its lisp files | |
135 | # before they've been installed in their final location. | |
136 | # It's usually identical to lisppath, except that the | |
137 | # entry for the directory containing the installed lisp | |
138 | # files has been replaced with ../lisp. This should be a | |
139 | # colon-separated list of directories. | |
3dbc7e32 | 140 | buildlisppath=${srcdir}/lisp |
86a5659e | 141 | |
d3245f70 JB |
142 | @inst_paths@# Where to install the other architecture-independent |
143 | @inst_paths@# data files distributed with Emacs (like the tutorial, | |
144 | @inst_paths@# the cookie recipes and the Zippy database). This path | |
145 | @inst_paths@# usually contains the Emacs version number, so the data | |
146 | @inst_paths@# files for multiple versions of Emacs may be installed | |
147 | @inst_paths@# at once. | |
148 | @inst_paths@etcdir=${datadir}/emacs/${version}/etc | |
149 | ||
150 | @inst_paths@# Where to create and expect the locking directory, where | |
151 | @inst_paths@# the Emacs locking code keeps track of which files are | |
152 | @inst_paths@# currently being edited. | |
153 | @inst_paths@lockdir=${statedir}/emacs/lock | |
154 | ||
155 | @inst_paths@# Where to put executables to be run by Emacs rather than | |
156 | @inst_paths@# the user. This path usually includes the Emacs version | |
157 | @inst_paths@# and configuration name, so that multiple configurations | |
158 | @inst_paths@# for multiple versions of Emacs may be installed at | |
159 | @inst_paths@# once. | |
160 | @inst_paths@archlibdir=${libdir}/emacs/${version}/${configuration} | |
46947372 | 161 | |
a34902ab ER |
162 | # ====================== Developer's configuration ======================= |
163 | ||
164 | # The following assignments make sense if you're running Emacs on a single | |
165 | # machine, one version at a time, and you want changes to the lisp and etc | |
166 | # directories in the source tree to show up immediately in your working | |
167 | # environment. It saves a great deal of disk space by not duplicating the | |
168 | # lisp and etc directories. | |
d3245f70 JB |
169 | |
170 | @rip_paths@lispdir=${srcdir}/lisp | |
171 | @rip_paths@externallispdir=${srcdir}/externallisp | |
97c70113 | 172 | @rip_paths@locallisppath=${srcdir}/site-lisp:${datadir}/emacs/site-lisp |
d3245f70 JB |
173 | @rip_paths@etcdir=${srcdir}/etc |
174 | @rip_paths@lockdir=${srcdir}/lock | |
175 | @rip_paths@archlibdir=${srcdir}/lib-src | |
176 | @rip_paths@infodir=${srcdir}/info | |
a34902ab | 177 | |
46947372 JB |
178 | # ==================== Utility Programs for the Build ==================== |
179 | ||
180 | # Allow the user to specify the install program. | |
19697295 | 181 | INSTALL = @INSTALL@ |
86ddcc58 JB |
182 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
183 | INSTALL_DATA = @INSTALL_DATA@ | |
46947372 | 184 | |
46947372 | 185 | # ============================= Targets ============================== |
86a5659e JB |
186 | |
187 | # Flags passed down to subdirectory makefiles. | |
78008d14 JB |
188 | MFLAGS = |
189 | ||
86a5659e JB |
190 | # Subdirectories to make recursively. `lisp' is not included |
191 | # because the compiled lisp files are part of the distribution | |
192 | # and you cannot remake them without installing Emacs first. | |
46947372 | 193 | SUBDIR = lib-src src |
86a5659e | 194 | |
78008d14 | 195 | # The makefiles of the directories in $SUBDIR. |
ddb73021 | 196 | SUBDIR_MAKEFILES = lib-src/Makefile src/Makefile oldXMenu/Makefile |
78008d14 | 197 | |
83f6a565 JB |
198 | # Subdirectories to install, and where they'll go. |
199 | # lib-src's makefile knows how to install it, so we don't do that here. | |
200 | # When installing the info files, we need to do special things to | |
201 | # avoid nuking an existing dir file, so we don't do that here; | |
202 | # instead, we have written out explicit code in the `install' targets. | |
78c7997f RS |
203 | COPYDIR = ${srcdir}/etc ${srcdir}/lisp |
204 | COPYDESTS = ${etcdir} ${lispdir} | |
86a5659e JB |
205 | |
206 | all: src/paths.h ${SUBDIR} | |
207 | ||
46947372 JB |
208 | removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/' |
209 | ||
78008d14 JB |
210 | # We force the rebuilding of src/paths.h because the user might give |
211 | # make different values for the various directories. Since we use | |
212 | # move-if-change, src/paths.h only actually changes if the user did | |
213 | # something notable, so the only unnecessary work we do is in building | |
214 | # src/paths.h.tmp, which isn't much. | |
692f9ac6 | 215 | # Note that sed is not in /bin on 386bsd. |
b305e8e5 | 216 | src/paths.h: Makefile ${srcdir}/src/paths.h.in FRC.src.paths.h |
7987a169 JB |
217 | @echo "Producing \`src/paths.h' from \`src/paths.h.in'." |
218 | @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \ | |
219 | buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \ | |
220 | sed < ${srcdir}/src/paths.h.in > src/paths.h.tmp \ | |
221 | -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \ | |
222 | -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \ | |
223 | -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ | |
8b14d296 | 224 | -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \ |
7987a169 JB |
225 | -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \ |
226 | -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";') | |
c75ff9db | 227 | @${srcdir}/move-if-change src/paths.h.tmp src/paths.h |
86a5659e | 228 | |
b305e8e5 JB |
229 | src: lib-src FRC.src |
230 | lib-src: FRC.lib-src | |
86a5659e JB |
231 | |
232 | .RECURSIVE: ${SUBDIR} | |
233 | ||
78008d14 | 234 | ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC |
08edea3c | 235 | cd $@; $(MAKE) all ${MFLAGS} \ |
4736b17e JB |
236 | CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \ |
237 | prefix='${prefix}' srcdir='${srcdir}/$@' libdir='${libdir}' | |
78008d14 JB |
238 | |
239 | ## We build the makefiles for the subdirectories here so that we can | |
240 | ## edit the values for the path variables into them. This means that | |
241 | ## when the user has built them from this makefile once, they will use | |
242 | ## the right default values for the path variables. | |
1304c993 | 243 | lib-src/Makefile: ${srcdir}/lib-src/Makefile.in Makefile vpath.sed |
78008d14 | 244 | rm -f lib-src/Makefile.tmp |
7987a169 JB |
245 | @echo "Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'." |
246 | @(echo "# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \ | |
247 | echo "# If you are thinking about editing it, you should seriously consider" ; \ | |
248 | echo "# running \`make lib-src/Makefile' at the top of the" ; \ | |
249 | echo "# Emacs build tree instead, or editing" ; \ | |
250 | echo "# \`${srcdir}/lib-src/Makefile.in' itself." ; \ | |
1304c993 | 251 | subdir=lib-src; \ |
ddb73021 | 252 | sed < ${srcdir}/lib-src/Makefile.in \ |
7987a169 | 253 | -e 's|^\(version *=\).*$$|\1'"${version}"'|' \ |
c75ff9db | 254 | -e 's|^\(configname *=\).*$$|\1'"${configuration}"'|' \ |
7987a169 JB |
255 | -e 's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \ |
256 | -e 's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \ | |
257 | -e 's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \ | |
ddb73021 | 258 | -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/lib-src|' \ |
1304c993 | 259 | @vpath_sed@ \ |
7987a169 | 260 | -e 's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \ |
d3245f70 | 261 | -e 's|^\(ALLOCA *=\).*$$|\1'"${ALLOCA}"'|' \ |
4b5a51c1 | 262 | -e 's|^\(YACC *=\).*$$|\1'"${YACC}"'|' \ |
7987a169 | 263 | -e 's|^CC *=.*$$|CC='"${CC}"'|' \ |
b6472fc1 | 264 | -e 's|^CFLAGS *=.*$$|CFLAGS='"${CFLAGS}"'|' \ |
7987a169 JB |
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 | |
c75ff9db | 268 | @${srcdir}/move-if-change lib-src/Makefile.tmp lib-src/Makefile |
78008d14 JB |
269 | chmod -w lib-src/Makefile |
270 | ||
1304c993 | 271 | src/Makefile: ${srcdir}/src/Makefile.in Makefile vpath.sed |
78008d14 | 272 | rm -f src/Makefile.tmp |
7987a169 JB |
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." ; \ | |
1304c993 | 279 | subdir=src; \ |
ddb73021 | 280 | sed < ${srcdir}/src/Makefile.in \ |
80496279 | 281 | -e 's|^\(srcdir *=\).*$$|\1${srcdir}/src|' \ |
1304c993 | 282 | @vpath_sed@ \ |
80496279 JB |
283 | -e 's|^CC *=.*$$|CC=${CC}|' \ |
284 | -e 's|^CPP *=.*$$|CPP=${CPP}|' \ | |
285 | -e 's|^LN_S *=.*$$|LN_S=${LN_S}|' \ | |
286 | -e 's|^CFLAGS *=.*$$|CFLAGS=${CFLAGS}|' \ | |
174be3e7 | 287 | -e 's|^\(C_SWITCH_SYSTEM *=\).*$$|\1'"${C_SWITCH_SYSTEM}"'|' \ |
80496279 | 288 | -e 's|^\(LD_SWITCH_X_SITE *=\).*$$|\1${LD_SWITCH_X_SITE}|' \ |
7987a169 | 289 | -e '/^# DIST: /d') > src/Makefile.tmp |
c75ff9db | 290 | @${srcdir}/move-if-change src/Makefile.tmp src/Makefile |
78008d14 JB |
291 | chmod -w src/Makefile |
292 | ||
1304c993 | 293 | oldXMenu/Makefile: ${srcdir}/oldXMenu/Makefile.in Makefile vpath.sed |
6d8856bd | 294 | rm -f oldXMenu/Makefile.tmp |
fe7cd06e JB |
295 | @echo "Producing \`oldXMenu/Makefile' from \`${srcdir}/oldXMenu/Makefile.in'." |
296 | @(echo "# This file is generated from \`${srcdir}/oldXMenu/Makefile.in'." ; \ | |
ddb73021 JB |
297 | echo "# If you are thinking about editing it, you should seriously consider" ; \ |
298 | echo "# running \`make oldXMenu/Makefile' at the top of the" ; \ | |
299 | echo "# Emacs build tree instead, or editing" ; \ | |
300 | echo "# \`${srcdir}/oldXMenu/Makefile.in' itself." ; \ | |
1304c993 | 301 | subdir=oldXMenu; \ |
8b8d8332 | 302 | sed < ${srcdir}/oldXMenu/Makefile.in \ |
ddb73021 | 303 | -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/oldXMenu|' \ |
1304c993 | 304 | @vpath_sed@ \ |
46af2ed8 | 305 | -e 's|^\(C_SWITCH_X_SITE *=\).*$$|\1'"${C_SWITCH_X_SITE}"'|' \ |
ddb73021 JB |
306 | -e 's|^CC *=.*$$|CC='"${CC}"'|' \ |
307 | -e 's|^DEFS *=.*$$|DEFS='"${DEFS}"'|' \ | |
308 | -e '/^# DIST: /d') > oldXMenu/Makefile.tmp | |
309 | @${srcdir}/move-if-change oldXMenu/Makefile.tmp oldXMenu/Makefile | |
310 | chmod -w oldXMenu/Makefile | |
78008d14 JB |
311 | |
312 | Makefile: | |
313 | ./config.status | |
314 | ||
315 | # ==================== Installation ==================== | |
316 | ||
dbc4e1c1 JB |
317 | ## If we let lib-src do its own installation, that means we |
318 | ## don't have to duplicate the list of utilities to install in | |
319 | ## this Makefile as well. | |
d3245f70 | 320 | |
3dbc7e32 JB |
321 | ## On AIX, use tar xBf. |
322 | ## On Xenix, use tar xpf. | |
323 | ||
d3245f70 JB |
324 | ## We delete each directory in ${COPYDESTS} before we copy into it; |
325 | ## that way, we can reinstall over directories that have been put in | |
326 | ## place with their files read-only (perhaps because they are checked | |
327 | ## into RCS). In order to make this safe, we make sure that the | |
328 | ## source exists and is distinct from the destination. | |
8b14d296 JB |
329 | install: all do-install |
330 | ||
af1d3b64 RS |
331 | ### Note that we copy the DOC-* files from the build etc directory |
332 | ### as well as lots of things from ${srcdir}/etc. | |
8b14d296 JB |
333 | do-install: mkdir |
334 | (cd lib-src; \ | |
335 | $(MAKE) install ${MFLAGS} prefix=${prefix} \ | |
336 | exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \ | |
337 | archlibdir=${archlibdir}) | |
46947372 | 338 | -set ${COPYDESTS} ; \ |
005775ce | 339 | for dir in ${COPYDIR} ; do \ |
8fd812d1 | 340 | if [ `(cd $$1 && pwd)` != `(cd $${dir} && pwd)` ] ; then \ |
88190b54 | 341 | rm -rf $$1 ; \ |
005775ce | 342 | fi ; \ |
335bb18d | 343 | shift ; \ |
005775ce JB |
344 | done |
345 | -set ${COPYDESTS} ; \ | |
8b14d296 | 346 | mkdir ${COPYDESTS} ; \ |
46947372 JB |
347 | for dir in ${COPYDIR} ; do \ |
348 | dest=$$1 ; shift ; \ | |
d3245f70 | 349 | [ -d $${dir} ] \ |
8fd812d1 | 350 | && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \ |
3dbc7e32 | 351 | && (echo "Copying $${dir}..." ; \ |
f8bc869a | 352 | (cd $${dir}; tar -cf - . )|(cd $${dest};umask 0; tar -xvf - ); \ |
d3245f70 JB |
353 | for subdir in `find $${dest} -type d ! -name RCS -print` ; do \ |
354 | rm -rf $${subdir}/RCS ; \ | |
355 | rm -rf $${subdir}/CVS ; \ | |
356 | rm -f $${subdir}/\#* ; \ | |
357 | rm -f $${subdir}/*~ ; \ | |
358 | done) ; \ | |
46947372 | 359 | done |
21e8e1db RS |
360 | if [ `(cd ./etc; /bin/pwd)` != `(cd ${srcdir}/etc; /bin/pwd)` ]; \ |
361 | then \ | |
362 | echo "Copying etc/DOC* ..." ; \ | |
363 | (cd etc; tar -cf - DOC*)|(cd ${etcdir}; umask 0; tar -xvf - ); \ | |
364 | else true; fi | |
365 | if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \ | |
366 | then (cd ${srcdir}/info ; \ | |
005775ce JB |
367 | if [ ! -f ${infodir}/dir ] && [ -f dir ]; then \ |
368 | ${INSTALL_DATA} dir ${infodir}/dir ; \ | |
369 | fi ; \ | |
57a16fed | 370 | for f in cl* emacs* forms* gnus* info* sc* vip* ; do \ |
005775ce | 371 | ${INSTALL_DATA} $$f ${infodir}/$$f ; \ |
21e8e1db RS |
372 | done); \ |
373 | else true; fi | |
ddb73021 | 374 | cd ${srcdir}/etc; for page in emacs etags ctags ; do \ |
3dbc7e32 | 375 | ${INSTALL_DATA} $${page}.1 ${mandir}/$${page}${manext} ; \ |
868e080d | 376 | done |
3dbc7e32 JB |
377 | ${INSTALL_PROGRAM} src/emacs ${bindir}/emacs-${version} |
378 | chmod 1755 ${bindir}/emacs-${version} | |
379 | rm -f ${bindir}/emacs | |
78008d14 | 380 | ln ${bindir}/emacs-${version} ${bindir}/emacs |
badb0a97 | 381 | |
868e080d | 382 | ### Build all the directories we're going to install Emacs in. Since |
78008d14 JB |
383 | ### we may be creating several layers of directories (for example, |
384 | ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path | |
385 | ### instead of mkdir. Not all systems' mkdirs have the `-p' flag. | |
b305e8e5 | 386 | mkdir: FRC.mkdir |
8b14d296 | 387 | ./lib-src/make-path ${COPYDESTS} ${lockdir} ${infodir} ${mandir} \ |
c469713a JB |
388 | ${bindir} ${datadir} ${libdir} \ |
389 | `echo ${locallisppath} | sed 's/:/ /'` | |
78008d14 | 390 | chmod 777 ${COPYDESTS} ${lockdir} |
86a5659e | 391 | |
d4acf74f JB |
392 | ### Delete all the installed files that the `install' target would |
393 | ### create (but not the noninstalled files such as `make all' would | |
394 | ### create). | |
44257b1a JB |
395 | ### |
396 | ### Don't delete the lisp and etc directories if they're in the source tree. | |
d4acf74f | 397 | uninstall: |
44257b1a JB |
398 | (cd lib-src; \ |
399 | $(MAKE) ${MFLAGS} uninstall \ | |
400 | prefix=${prefix} exec_prefix=${exec_prefix} \ | |
d4acf74f | 401 | bindir=${bindir} libdir=${libdir} archlibdir=${archlibdir}) |
44257b1a JB |
402 | for dir in ${lispdir} ${etcdir} ; do \ |
403 | case `(cd $${dir} ; pwd)` in \ | |
404 | `(cd ${srcdir} ; pwd)`* ) ;; \ | |
405 | * ) rm -rf $${dir} ;; \ | |
406 | esac ; \ | |
407 | case $${dir} in \ | |
408 | ${datadir}/emacs/${version}/* ) \ | |
409 | rm -rf ${datadir}/emacs/${version} \ | |
410 | ;; \ | |
411 | esac ; \ | |
412 | done | |
d4acf74f JB |
413 | (cd ${infodir}; rm -f cl* emacs* forms* info* vip*) |
414 | (cd ${mandir}; rm -f emacs.1 etags.1 ctags.1) | |
415 | (cd ${bindir}; rm -f emacs-${version} emacs) | |
416 | ||
417 | ||
04d9326a JB |
418 | ### Some makes seem to remember that they've built something called FRC, |
419 | ### so you can only use a given FRC once per makefile. | |
b305e8e5 | 420 | FRC FRC.src.paths.h FRC.src FRC.lib-src FRC.mkdir: |
d4acf74f | 421 | FRC.mostlyclean FRC.clean FRC.distclean FRC.realclean: |
78008d14 JB |
422 | |
423 | # ==================== Cleaning up and miscellanea ==================== | |
424 | ||
78008d14 | 425 | ### `mostlyclean' |
d4acf74f JB |
426 | ### Like `clean', but may refrain from deleting a few files that people |
427 | ### normally don't want to recompile. For example, the `mostlyclean' | |
428 | ### target for GCC does not delete `libgcc.a', because recompiling it | |
429 | ### is rarely necessary and takes a lot of time. | |
430 | mostlyclean: FRC.mostlyclean | |
68c43ec4 RM |
431 | (cd src; $(MAKE) ${MFLAGS} mostlyclean) |
432 | (cd oldXMenu; $(MAKE) ${MFLAGS} mostlyclean) | |
433 | (cd lib-src; $(MAKE) ${MFLAGS} mostlyclean) | |
434 | (cd man; $(MAKE) ${MFLAGS} mostlyclean) | |
d4acf74f JB |
435 | |
436 | ### `clean' | |
437 | ### Delete all files from the current directory that are normally | |
438 | ### created by building the program. Don't delete the files that | |
439 | ### record the configuration. Also preserve files that could be made | |
440 | ### by building, but normally aren't because the distribution comes | |
441 | ### with them. | |
78008d14 | 442 | ### |
d4acf74f JB |
443 | ### Delete `.dvi' files here if they are not part of the distribution. |
444 | clean: FRC.clean | |
68c43ec4 RM |
445 | (cd src; $(MAKE) ${MFLAGS} clean) |
446 | (cd oldXMenu; $(MAKE) ${MFLAGS} clean) | |
447 | (cd lib-src; $(MAKE) ${MFLAGS} clean) | |
448 | (cd man; $(MAKE) ${MFLAGS} clean) | |
46947372 | 449 | |
78008d14 | 450 | ### `distclean' |
d4acf74f JB |
451 | ### Delete all files from the current directory that are created by |
452 | ### configuring or building the program. If you have unpacked the | |
453 | ### source and built the program without creating any other files, | |
454 | ### `make distclean' should leave only the files that were in the | |
455 | ### distribution. | |
456 | top_distclean=\ | |
457 | rm -f config.status build-install ; \ | |
458 | rm -f Makefile ${SUBDIR_MAKEFILES} ; \ | |
39b62b3b | 459 | (cd lock ; rm -f *) |
d4acf74f | 460 | distclean: FRC.distclean |
68c43ec4 RM |
461 | (cd src; $(MAKE) ${MFLAGS} distclean) |
462 | (cd oldXMenu; $(MAKE) ${MFLAGS} distclean) | |
463 | (cd lib-src; $(MAKE) ${MFLAGS} distclean) | |
464 | (cd man; $(MAKE) ${MFLAGS} distclean) | |
d4acf74f JB |
465 | ${top_distclean} |
466 | ||
46947372 | 467 | |
78008d14 | 468 | ### `realclean' |
d4acf74f JB |
469 | ### Delete everything from the current directory that can be |
470 | ### reconstructed with this Makefile. This typically includes | |
471 | ### everything deleted by distclean, plus more: C source files | |
472 | ### produced by Bison, tags tables, info files, and so on. | |
473 | ### | |
474 | ### One exception, however: `make realclean' should not delete | |
475 | ### `configure' even if `configure' can be remade using a rule in the | |
476 | ### Makefile. More generally, `make realclean' should not delete | |
477 | ### anything that needs to exist in order to run `configure' and then | |
478 | ### begin to build the program. | |
479 | realclean: FRC.realclean | |
68c43ec4 RM |
480 | (cd src; $(MAKE) ${MFLAGS} realclean) |
481 | (cd oldXMenu; $(MAKE) ${MFLAGS} realclean) | |
482 | (cd lib-src; $(MAKE) ${MFLAGS} realclean) | |
483 | (cd man; $(MAKE) ${MFLAGS} realclean) | |
d4acf74f | 484 | ${top_distclean} |
46947372 | 485 | |
78008d14 JB |
486 | ### This doesn't actually appear in the coding standards, but Karl |
487 | ### says GCC supports it, and that's where the configuration part of | |
488 | ### the coding standards seem to come from. It's like distclean, but | |
489 | ### it deletes backup and autosave files too. | |
490 | extraclean: | |
08edea3c | 491 | for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} extraclean); done |
78008d14 JB |
492 | -(cd lock; rm *) |
493 | -rm config.status config-tmp-* | |
494 | -rm -f *~ \#* | |
495 | ||
29c0047b ER |
496 | ### Unlocking and relocking. The idea of these productions is to reduce |
497 | ### hassles when installing an incremental tar of Emacs. Do `make unlock' | |
498 | ### before unlocking the file to take the write locks off all sources so | |
499 | ### that tar xvof will overwrite them without fuss. Then do `make relock' | |
500 | ### afterward so that VC mode will know which files should be checked in | |
501 | ### if you want to mung them. | |
502 | ### | |
503 | ### Note: it's no disaster if these productions miss a file or two; tar | |
504 | ### and VC will swiftly let you know if this happens, and it is easily | |
505 | ### corrected. | |
506 | SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \ | |
507 | README build-install.in configure make-dist move-if-change | |
508 | ||
509 | unlock: | |
510 | chmod u+w $(SOURCES) cpp/* | |
511 | -(cd elisp; chmod u+w Makefile README *.texi) | |
68c43ec4 RM |
512 | (cd etc; $(MAKE) unlock) |
513 | (cd lib-src; $(MAKE) unlock) | |
514 | (cd lisp; $(MAKE) unlock) | |
29c0047b ER |
515 | (cd lisp/term; chmod u+w README *.el) |
516 | (cd man; chmod u+w *texi* ChangeLog split-man) | |
517 | (cd oldXMenu; chmod u+w *.[ch] Makefile README) | |
68c43ec4 | 518 | (cd src; $(MAKE) unlock) |
29c0047b ER |
519 | |
520 | relock: | |
521 | chmod u-w $(SOURCES) cpp/* | |
522 | -(cd elisp; chmod u-w Makefile README *.texi) | |
68c43ec4 RM |
523 | (cd etc; $(MAKE) relock) |
524 | (cd lib-src; $(MAKE) relock) | |
525 | (cd lisp; $(MAKE) relock) | |
29c0047b ER |
526 | (cd lisp/term; chmod u+w README *.el) |
527 | (cd man; chmod u+w *texi* ChangeLog split-man) | |
528 | (cd oldXMenu; chmod u+w *.[ch] Makefile README) | |
68c43ec4 | 529 | (cd src; $(MAKE) relock) |
78008d14 | 530 | |
46947372 | 531 | TAGS tags: lib-src |
86f46642 RS |
532 | (cd ${srcdir}/src; \ |
533 | ../lib-src/etags *.[ch] ../lisp/*.el ../lisp/term/*.el) | |
46947372 JB |
534 | |
535 | check: | |
536 | @echo "We don't have any tests for GNU Emacs yet." | |
4746118a JB |
537 | |
538 | dist: | |
78008d14 | 539 | cd ${srcdir}; make-dist |
d4acf74f JB |
540 | |
541 | info: | |
68c43ec4 | 542 | (cd ${srcdir}/man; $(MAKE) ${MFLAGS} info) |
d4acf74f | 543 | dvi: |
68c43ec4 | 544 | (cd ${srcdir}/man; $(MAKE) ${MFLAGS} dvi) |