Makefile.in 19.3 KB
Newer Older
Jim Blandy's avatar
Jim Blandy committed
1 2 3
# DIST: This is the distribution Makefile for Emacs.  configure can
# DIST: make most of the changes to this file you might want, so try
# DIST: that first.
Jim Blandy's avatar
Jim Blandy committed
4

Jim Blandy's avatar
Jim Blandy committed
5 6
# make all	to compile and build Emacs.
# make install	to install it.
7
# make TAGS	to update tags tables.
Jim Blandy's avatar
Jim Blandy committed
8
#
9 10
# make clean  or  make mostlyclean
#      Delete all files from the current directory that are normally
11
#      created by building the program.	 Don't delete the files that
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#      record the configuration.  Also preserve files that could be made
#      by building, but normally aren't because the distribution comes
#      with them.
#
#      Delete `.dvi' files here if they are not part of the distribution.
# 
# make distclean
#      Delete all files from the current directory that are created by
#      configuring or building the program.  If you have unpacked the
#      source and built the program without creating any other files,
#      `make distclean' should leave only the files that were in the
#      distribution.
# 
# make realclean
#      Delete everything from the current directory that can be
#      reconstructed with this Makefile.  This typically includes
#      everything deleted by distclean, plus more: C source files
#      produced by Bison, tags tables, info files, and so on.
#
# make extraclean
#      Still more severe - delete backup and autosave files, too.
Jim Blandy's avatar
Jim Blandy committed
33 34

SHELL = /bin/sh
35
MAKE = make  # BSD doesn't have it as a default.
Jim Blandy's avatar
Jim Blandy committed
36

37
# ==================== Things `configure' Might Edit ====================
Jim Blandy's avatar
Jim Blandy committed
38

39 40
CC=@CC@
C_SWITCH_SYSTEM=@c_switch_system@
41
ALLOCA=@ALLOCA@
42 43
LN_S=@LN_S@
CFLAGS=@CFLAGS@
44
C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
Jim Blandy's avatar
Jim Blandy committed
45
LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@
46 47 48 49 50 51

### These help us choose version- and architecture-specific directories
### to install files in.

### This should be the number of the Emacs version we're building,
### like `18.59' or `19.0'.
52
version=@version@
53 54 55

### This should be the name of the configuration we're building Emacs
### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
56 57 58 59
configuration=@configuration@

### Libraries which should be edited into lib-src/Makefile.
libsrc_libs=@libsrc_libs@
60

61 62
# ==================== Where To Install Things ====================

Jim Blandy's avatar
Jim Blandy committed
63
# The default location for installation.  Everything is placed in
64 65
# subdirectories of this directory.  The default values for many of
# the variables below are expressed in terms of this one, so you may
66 67
# not need to change them.  This defaults to /usr/local.
prefix=@prefix@
Jim Blandy's avatar
Jim Blandy committed
68

69
# Like `prefix', but used for architecture-specific files.
70
exec_prefix=@exec_prefix@
71

Jim Blandy's avatar
Jim Blandy committed
72 73
# Where to install Emacs and other binaries that people will want to
# run directly (like etags).
74
bindir=${exec_prefix}/bin
Jim Blandy's avatar
Jim Blandy committed
75

76
# Where to install architecture-independent data files.	 ${lispdir}
77 78
# and ${etcdir} are subdirectories of this.
datadir=${prefix}/lib
79 80

# Where to install and expect the files that Emacs modifies as it
81
# runs.	 These files are all architecture-independent. Right now, the
82 83 84
# only such data is the locking directory; ${lockdir} is a
# subdirectory of this.
statedir=${prefix}/lib
85 86 87

# Where to install and expect executable files to be run by Emacs
# rather than directly by users, and other architecture-dependent
88
# data.	 ${archlibdir} is a subdirectory of this.
89
libdir=${exec_prefix}/lib
90 91

# Where to install Emacs's man pages, and what extension they should have.
92
mandir=${prefix}/man/man1
93 94 95 96 97 98 99
manext=.1

# Where to install and expect the info files describing Emacs.	In the
# past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
# since there are now many packages documented with the texinfo
# system, it is inappropriate to imply that it is part of Emacs.
infodir=${prefix}/info
Jim Blandy's avatar
Jim Blandy committed
100

101
# Where to find the source code.  The source code for Emacs's C kernel is
102 103 104
# expected to be in ${srcdir}/src, and the source code for Emacs's
# utility programs is expected to be in ${srcdir}/lib-src.  This is
# set by the configure script's `--srcdir' option.
105
srcdir=@srcdir@
Jim Blandy's avatar
Jim Blandy committed
106

107 108
# ==================== Emacs-specific directories ====================

109 110 111
# These variables hold the values Emacs will actually use.  They are
# based on the values of the standard Make variables above.

112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
@inst_paths@# Where to install the lisp files distributed with
@inst_paths@# Emacs.  This includes the Emacs version, so that the
@inst_paths@# lisp files for different versions of Emacs will install
@inst_paths@# themselves in separate directories.
@inst_paths@lispdir=${datadir}/emacs/${version}/lisp

@inst_paths@# Directories Emacs should search for lisp files specific
@inst_paths@# to this site (i.e. customizations), before consulting
@inst_paths@# ${lispdir}.  This should be a colon-separated list of
@inst_paths@# directories.
@inst_paths@locallisppath=${datadir}/emacs/site-lisp

# Where Emacs will search to find its lisp files.  Before
# changing this, check to see if your purpose wouldn't
# better be served by changing locallisppath.  This
Jim Blandy's avatar
Jim Blandy committed
127
# should be a colon-separated list of directories.
128
lisppath=${locallisppath}:${lispdir}
Jim Blandy's avatar
Jim Blandy committed
129

130 131 132 133 134 135 136 137
# Where Emacs will search for its lisp files while
# building.  This is only used during the process of
# compiling Emacs, to help Emacs find its lisp files
# before they've been installed in their final location.
# It's usually identical to lisppath, except that the
# entry for the directory containing the installed lisp
# files has been replaced with ../lisp.  This should be a
# colon-separated list of directories.
138
buildlisppath=${srcdir}/lisp
Jim Blandy's avatar
Jim Blandy committed
139

140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
@inst_paths@# Where to install the other architecture-independent
@inst_paths@# data files distributed with Emacs (like the tutorial,
@inst_paths@# the cookie recipes and the Zippy database). This path
@inst_paths@# usually contains the Emacs version number, so the data
@inst_paths@# files for multiple versions of Emacs may be installed
@inst_paths@# at once.
@inst_paths@etcdir=${datadir}/emacs/${version}/etc

@inst_paths@# Where to create and expect the locking directory, where
@inst_paths@# the Emacs locking code keeps track of which files are
@inst_paths@# currently being edited.
@inst_paths@lockdir=${statedir}/emacs/lock

@inst_paths@# Where to put executables to be run by Emacs rather than
@inst_paths@# the user.  This path usually includes the Emacs version
@inst_paths@# and configuration name, so that multiple configurations
@inst_paths@# for multiple versions of Emacs may be installed at
@inst_paths@# once.
@inst_paths@archlibdir=${libdir}/emacs/${version}/${configuration}
Jim Blandy's avatar
Jim Blandy committed
159

160 161 162 163 164 165 166
# ====================== Developer's configuration =======================

# The following assignments make sense if you're running Emacs on a single
# machine, one version at a time, and  you want changes to the lisp and etc
# directories in the source tree to show up immediately in your working
# environment.  It saves a great deal of disk space by not duplicating the
# lisp and etc directories.
167 168 169

@rip_paths@lispdir=${srcdir}/lisp
@rip_paths@externallispdir=${srcdir}/externallisp
170
@rip_paths@locallisppath=${srcdir}/site-lisp:${datadir}/emacs/site-lisp
171 172 173 174
@rip_paths@etcdir=${srcdir}/etc
@rip_paths@lockdir=${srcdir}/lock
@rip_paths@archlibdir=${srcdir}/lib-src
@rip_paths@infodir=${srcdir}/info
175

Jim Blandy's avatar
Jim Blandy committed
176 177 178
# ==================== Utility Programs for the Build ====================

# Allow the user to specify the install program.
179
INSTALL = @INSTALL@
180 181
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
Jim Blandy's avatar
Jim Blandy committed
182 183

# ============================= Targets ==============================
Jim Blandy's avatar
Jim Blandy committed
184 185

# Flags passed down to subdirectory makefiles.
186 187
MFLAGS = 

Jim Blandy's avatar
Jim Blandy committed
188 189 190
# Subdirectories to make recursively.  `lisp' is not included
# because the compiled lisp files are part of the distribution
# and you cannot remake them without installing Emacs first.
Jim Blandy's avatar
Jim Blandy committed
191
SUBDIR = lib-src src
Jim Blandy's avatar
Jim Blandy committed
192

193
# The makefiles of the directories in $SUBDIR.
194
SUBDIR_MAKEFILES = lib-src/Makefile src/Makefile oldXMenu/Makefile
195

196 197 198 199 200
# Subdirectories to install, and where they'll go.
# lib-src's makefile knows how to install it, so we don't do that here.
# When installing the info files, we need to do special things to
# avoid nuking an existing dir file, so we don't do that here;
# instead, we have written out explicit code in the `install' targets.
201 202
COPYDIR = ${srcdir}/etc ${srcdir}/lisp
COPYDESTS = ${etcdir} ${lispdir}
Jim Blandy's avatar
Jim Blandy committed
203 204 205

all:	src/paths.h ${SUBDIR}

Jim Blandy's avatar
Jim Blandy committed
206 207
removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/'

208 209 210 211 212
# We force the rebuilding of src/paths.h because the user might give
# make different values for the various directories.  Since we use
# move-if-change, src/paths.h only actually changes if the user did
# something notable, so the only unnecessary work we do is in building
# src/paths.h.tmp, which isn't much.
Jim Blandy's avatar
Jim Blandy committed
213
# Note that sed is not in /bin on 386bsd.
214
src/paths.h: Makefile ${srcdir}/src/paths.h.in FRC.src.paths.h
215 216 217 218 219 220 221
	@echo "Producing \`src/paths.h' from \`src/paths.h.in'."
	@(lisppath=`echo ${lisppath} | ${removenullpaths}` ;		\
	  buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ;	\
	  sed < ${srcdir}/src/paths.h.in > src/paths.h.tmp		\
	  -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";'	\
	  -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
	  -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";'		\
222
	  -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";'			\
223 224
	  -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";'			\
	  -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";')
225
	@${srcdir}/move-if-change src/paths.h.tmp src/paths.h
Jim Blandy's avatar
Jim Blandy committed
226

227 228
src:	lib-src FRC.src
lib-src: FRC.lib-src
Jim Blandy's avatar
Jim Blandy committed
229 230 231

.RECURSIVE: ${SUBDIR}

232
${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
233
	cd $@; $(MAKE) all ${MFLAGS} \
234 235
		CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
		prefix='${prefix}' srcdir='${srcdir}/$@' libdir='${libdir}'
236 237 238 239 240 241 242

## We build the makefiles for the subdirectories here so that we can
## edit the values for the path variables into them.  This means that
## when the user has built them from this makefile once, they will use
## the right default values for the path variables.
lib-src/Makefile: ${srcdir}/lib-src/Makefile.in Makefile
	rm -f lib-src/Makefile.tmp
243 244 245 246 247 248
	@echo "Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'."
	@(echo "# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \
	  echo "# If you are thinking about editing it, you should seriously consider" ; \
	  echo "# running \`make lib-src/Makefile' at the top of the" ;	\
	  echo "# Emacs build tree instead, or editing" ;		\
	  echo "# \`${srcdir}/lib-src/Makefile.in' itself." ;		\
249
	  sed < ${srcdir}/lib-src/Makefile.in				\
250
	  -e 's|^\(version *=\).*$$|\1'"${version}"'|'			\
251
	  -e 's|^\(configname *=\).*$$|\1'"${configuration}"'|'		\
252 253 254
	  -e 's|^\(prefix *=\).*$$|\1'"${prefix}"'|'			\
	  -e 's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|'		\
	  -e 's|^\(libdir *=\).*$$|\1'"${libdir}"'|'			\
255 256
	  -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/lib-src|'		\
	  -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/lib-src|'		\
257
	  -e 's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|'		\
258
	  -e 's|^\(ALLOCA *=\).*$$|\1'"${ALLOCA}"'|'			\
259
	  -e 's|^CC *=.*$$|CC='"${CC}"'|'				\
260
	  -e 's|^CFLAGS *=.*$$|CFLAGS='"${CFLAGS}"'|' \
261 262 263
	  -e 's|^C_SWITCH_SYSTEM *=.*$$|C_SWITCH_SYSTEM='"${C_SWITCH_SYSTEM}"'|' \
	  -e 's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|'	\
	  -e '/^# DIST: /d') > lib-src/Makefile.tmp
264
	@${srcdir}/move-if-change lib-src/Makefile.tmp lib-src/Makefile
265 266 267 268
	chmod -w lib-src/Makefile

src/Makefile: ${srcdir}/src/Makefile.in Makefile
	rm -f src/Makefile.tmp
269 270 271 272 273 274
	@echo "Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
	@(echo "# This file is generated from \`${srcdir}/src/Makefile.in'." ; \
	  echo "# If you are thinking about editing it, you should seriously consider" ; \
	  echo "# running \`make src/Makefile' at the top of the" ;	\
	  echo "# Emacs build tree instead, or editing" ;		\
	  echo "# \`${srcdir}/src/Makefile.in' itself." ;		\
275 276 277
	  sed < ${srcdir}/src/Makefile.in				\
	  -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/src|'		\
	  -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/src|'			\
278
	  -e 's|^CC *=.*$$|CC='"${CC}"'|'				\
279 280
	  -e 's|^LN_S *=.*$$|LN_S='"${LN_S}"'|'				\
	  -e 's|^CFLAGS *=.*$$|CFLAGS='"${CFLAGS}"'|' 			\
281
	  -e 's|^\(LD_SWITCH_X_SITE *=\).*$$|\1'"${LD_SWITCH_X_SITE}"'|'	\
282
	  -e '/^# DIST: /d') > src/Makefile.tmp
283
	@${srcdir}/move-if-change src/Makefile.tmp src/Makefile
284 285
	chmod -w src/Makefile

286
oldXMenu/Makefile: ${srcdir}/oldXMenu/Makefile.in Makefile
287
	rm -f oldXMenu/Makefile.tmp
Jim Blandy's avatar
Jim Blandy committed
288 289
	@echo "Producing \`oldXMenu/Makefile' from \`${srcdir}/oldXMenu/Makefile.in'."
	@(echo "# This file is generated from \`${srcdir}/oldXMenu/Makefile.in'." ; \
290 291 292 293
	  echo "# If you are thinking about editing it, you should seriously consider" ; \
	  echo "# running \`make oldXMenu/Makefile' at the top of the" ; \
	  echo "# Emacs build tree instead, or editing" ;		\
	  echo "# \`${srcdir}/oldXMenu/Makefile.in' itself." ;		\
294
	  sed < ${srcdir}/oldXMenu/Makefile.in				\
295 296
	  -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'/oldXMenu|'		\
	  -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'/oldXMenu|'		\
297
	  -e 's|^\(C_SWITCH_X_SITE *=\).*$$|\1'"${C_SWITCH_X_SITE}"'|'	\
298 299 300 301 302
	  -e 's|^CC *=.*$$|CC='"${CC}"'|'				\
	  -e 's|^DEFS *=.*$$|DEFS='"${DEFS}"'|' \
	  -e '/^# DIST: /d') > oldXMenu/Makefile.tmp
	@${srcdir}/move-if-change oldXMenu/Makefile.tmp oldXMenu/Makefile
	chmod -w oldXMenu/Makefile
303 304 305 306 307 308

Makefile:
	./config.status

# ==================== Installation ====================

Jim Blandy's avatar
Jim Blandy committed
309 310 311
## If we let lib-src do its own installation, that means we
## don't have to duplicate the list of utilities to install in
## this Makefile as well.
312

313 314 315
## On AIX, use tar xBf.
## On Xenix, use tar xpf.

316 317 318 319 320
## We delete each directory in ${COPYDESTS} before we copy into it;
## that way, we can reinstall over directories that have been put in
## place with their files read-only (perhaps because they are checked
## into RCS).  In order to make this safe, we make sure that the
## source exists and is distinct from the destination.
321 322
install: all do-install

323 324
### Note that we copy the DOC-* files from the build etc directory
### as well as lots of things from ${srcdir}/etc.
325 326 327 328 329
do-install: mkdir
	(cd lib-src; \
	  $(MAKE) install ${MFLAGS} prefix=${prefix} \
	    exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
	    archlibdir=${archlibdir})
Jim Blandy's avatar
Jim Blandy committed
330
	-set ${COPYDESTS} ; \
331
	 for dir in ${COPYDIR} ; do \
332
	   if [ `(cd $$1 && pwd)` != `(cd $${dir} && pwd)` ] ; then \
333
	     rm -rf $$1 ; \
334
	   fi ; \
335
	   shift ; \
336 337
	 done
	-set ${COPYDESTS} ; \
338
	 mkdir ${COPYDESTS} ; \
Jim Blandy's avatar
Jim Blandy committed
339 340
	 for dir in ${COPYDIR} ; do \
	   dest=$$1 ; shift ; \
341
	   [ -d $${dir} ] \
342
	   && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
343
	   && (echo "Copying $${dir}..." ; \
344
	       (cd $${dir}; tar -cf - . )|(cd $${dest};umask 0; tar -xvf - ); \
345 346 347 348 349 350
	       for subdir in `find $${dest} -type d ! -name RCS -print` ; do \
		 rm -rf $${subdir}/RCS ; \
		 rm -rf $${subdir}/CVS ; \
		 rm -f  $${subdir}/\#* ; \
		 rm -f  $${subdir}/*~ ; \
	       done) ; \
Jim Blandy's avatar
Jim Blandy committed
351
	 done
352 353 354
	-[ `(cd ./etc; /bin/pwd)` != `(cd ${srcdir}etc; /bin/pwd)` ] \
	 && (echo "Copying etc/DOC* ..." ; \
	     (cd etc; tar -cf - DOC*)|(cd ${etcdir}; umask 0; tar -xvf - ))
355
	-[ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ] \
356 357 358 359 360 361 362
	 && (cd ${srcdir}/info ; \
	     if [ ! -f ${infodir}/dir ] && [ -f dir ]; then \
	       ${INSTALL_DATA} dir ${infodir}/dir ; \
	     fi ; \
	     for f in cl* emacs* forms* info* vip* ; do \
	       ${INSTALL_DATA} $$f ${infodir}/$$f ; \
	     done)
363
	cd ${srcdir}/etc; for page in emacs etags ctags ; do \
364
	  ${INSTALL_DATA} $${page}.1 ${mandir}/$${page}${manext} ; \
365
	done
366 367 368
	${INSTALL_PROGRAM} src/emacs ${bindir}/emacs-${version}
	chmod 1755  ${bindir}/emacs-${version}
	rm -f ${bindir}/emacs
369
	ln ${bindir}/emacs-${version} ${bindir}/emacs
Jim Blandy's avatar
Jim Blandy committed
370

371
### Build all the directories we're going to install Emacs in.	Since
372 373 374
### we may be creating several layers of directories (for example,
### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
### instead of mkdir.  Not all systems' mkdirs have the `-p' flag.
375
mkdir: FRC.mkdir
376
	./lib-src/make-path ${COPYDESTS} ${lockdir} ${infodir} ${mandir} \
377 378
	  ${bindir} ${datadir} ${libdir} \
	  `echo ${locallisppath} | sed 's/:/ /'`
379
	chmod 777 ${COPYDESTS} ${lockdir}
Jim Blandy's avatar
Jim Blandy committed
380

381 382
### Some makes seem to remember that they've built something called FRC,
### so you can only use a given FRC once per makefile.
383
FRC FRC.src.paths.h FRC.src FRC.lib-src FRC.mkdir:
Jim Blandy's avatar
Jim Blandy committed
384

385 386 387 388

# ==================== Cleaning up and miscellanea ====================

### `clean'
389 390 391 392 393
###	 Delete all files from the current directory that are normally
###	 created by building the program.  Don't delete the files that
###	 record the configuration.  Also preserve files that could be made
###	 by building, but normally aren't because the distribution comes
###	 with them.
394
### `mostlyclean'
395 396 397 398
###	 Like `clean', but may refrain from deleting a few files that
###	 people normally don't want to recompile.  For example, the
###	 `mostlyclean' target for GCC does not delete `libgcc.a', because
###	 recompiling it is rarely necessary and takes a lot of time.
399
### 
Jim Blandy's avatar
Jim Blandy committed
400
clean mostlyclean:
401 402 403
	cd src; $(MAKE) clean
	cd lib-src; $(MAKE) clean
	cd oldXMenu; $(MAKE) clean
404
	if [ `(cd ${etcdir} && /bin/pwd)` != `(cd etc && /bin/pwd)` ] ; then \
405
	  cd etc; $(MAKE) clean; \
Jim Blandy's avatar
Jim Blandy committed
406 407 408
	else true; \
	fi

409
### `distclean'
410 411 412
###	 Delete all files from the current directory that are created by
###	 configuring or building the program.  This should leave only the
###	 files that would be in the distribution.
Jim Blandy's avatar
Jim Blandy committed
413
distclean:
414
	for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} distclean); done
Jim Blandy's avatar
Jim Blandy committed
415 416 417
	-(cd lock; rm *)
	-rm config.status config-tmp-*

418
### `realclean'
419 420 421 422
###	 Delete everything from the current directory that can be
###	 reconstructed with this makefile.  This typically includes
###	 everything deleted by distclean, plus more: C source files
###	 produced by Bison, tags tables, info files, and so on.
Jim Blandy's avatar
Jim Blandy committed
423
realclean:
424
	for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} realclean); done
Jim Blandy's avatar
Jim Blandy committed
425 426 427
	(cd lock; rm *)
	rm config.status

428 429 430 431 432
### This doesn't actually appear in the coding standards, but Karl
### says GCC supports it, and that's where the configuration part of
### the coding standards seem to come from.  It's like distclean, but
### it deletes backup and autosave files too.
extraclean:
433
	for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} extraclean); done
434 435 436 437
	-(cd lock; rm *)
	-rm config.status config-tmp-*
	-rm -f *~ \#*

438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
### Unlocking and relocking.  The idea of these productions is to reduce
### hassles when installing an incremental tar of Emacs.  Do `make unlock'
### before unlocking the file to take the write locks off all sources so
### that tar xvof will overwrite them without fuss.  Then do `make relock'
### afterward so that VC mode will know which files should be checked in
### if you want to mung them.
###
### Note: it's no disaster if these productions miss a file or two; tar
### and VC will swiftly let you know if this happens, and it is easily
### corrected.
SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
	README build-install.in configure make-dist move-if-change

unlock:
	chmod u+w $(SOURCES) cpp/*
	-(cd elisp; chmod u+w Makefile README *.texi)
	(cd etc; make unlock)
	(cd lib-src; make unlock)
	(cd lisp; make unlock)
	(cd lisp/term; chmod u+w README *.el)
	(cd man; chmod u+w *texi* ChangeLog split-man)
	(cd oldXMenu; chmod u+w *.[ch] Makefile README)
	(cd src; make unlock)

relock:
	chmod u-w $(SOURCES) cpp/*
	-(cd elisp; chmod u-w Makefile README *.texi)
	(cd etc; make relock)
	(cd lib-src; make relock)
	(cd lisp; make relock)
	(cd lisp/term; chmod u+w README *.el)
	(cd man; chmod u+w *texi* ChangeLog split-man)
	(cd oldXMenu; chmod u+w *.[ch] Makefile README)
	(cd src; make relock)
472

Jim Blandy's avatar
Jim Blandy committed
473
TAGS tags:	lib-src
474 475
	(cd ${srcdir} ; lib-src/etags --output=./src/TAGS \
	 src/*.[ch] lisp/*.el lisp/term/*.el)
Jim Blandy's avatar
Jim Blandy committed
476 477 478

check:
	@echo "We don't have any tests for GNU Emacs yet."
Jim Blandy's avatar
Jim Blandy committed
479 480

dist:
481
	cd ${srcdir}; make-dist