JimB's changes since January 18th
[bpt/emacs.git] / Makefile.in
CommitLineData
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.
7# make install.sysv to install on system V. Note that on system V you
8# must change mandir to /usr/local/man/man1.
9# make install.xenix to install on Xenix.
badb0a97 10# make install.aix to install on AIX.
78008d14 11# make TAGS to update tags tables.
86a5659e 12#
78008d14
JB
13# make clean or make mostlyclean
14# Delete all files from the current directory that are normally
868e080d 15# created by building the program. Don't delete the files that
78008d14
JB
16# record the configuration. Also preserve files that could be made
17# by building, but normally aren't because the distribution comes
18# with them.
19#
20# Delete `.dvi' files here if they are not part of the distribution.
21#
22# make distclean
23# Delete all files from the current directory that are created by
24# configuring or building the program. If you have unpacked the
25# source and built the program without creating any other files,
26# `make distclean' should leave only the files that were in the
27# distribution.
28#
29# make realclean
30# Delete everything from the current directory that can be
31# reconstructed with this Makefile. This typically includes
32# everything deleted by distclean, plus more: C source files
33# produced by Bison, tags tables, info files, and so on.
34#
35# make extraclean
36# Still more severe - delete backup and autosave files, too.
86a5659e
JB
37
38SHELL = /bin/sh
08edea3c 39MAKE = make # BSD doesn't have it as a default.
86a5659e 40
78008d14 41# ==================== Things `configure' Might Edit ====================
86a5659e 42
78008d14
JB
43CC=cc
44CONFIG_CFLAGS=-g
45
46### These help us choose version- and architecture-specific directories
47### to install files in.
48
49### This should be the number of the Emacs version we're building,
50### like `18.59' or `19.0'.
0c22fbca 51version=version-not-set
78008d14
JB
52
53### This should be the name of the configuration we're building Emacs
54### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
0c22fbca
JB
55configname=configuration-name-not-set
56
78008d14
JB
57# ==================== Where To Install Things ====================
58
46947372 59# The default location for installation. Everything is placed in
78008d14
JB
60# subdirectories of this directory. The default values for many of
61# the variables below are expressed in terms of this one, so you may
62# not need to change them.
46947372 63prefix=/usr/local
86a5659e 64
78008d14
JB
65# Like `prefix', but used for architecture-specific files.
66exec_prefix=${prefix}
67
46947372
JB
68# Where to install Emacs and other binaries that people will want to
69# run directly (like etags).
78008d14 70bindir=${exec_prefix}/bin
86a5659e 71
868e080d 72# Where to install architecture-independent data files. ${lispdir}
78008d14
JB
73# and ${etcdir} are subdirectories of this.
74datadir=${prefix}/lib
0c22fbca
JB
75
76# Where to install and expect the files that Emacs modifies as it
868e080d 77# runs. These files are all architecture-independent. Right now, the
78008d14
JB
78# only such data is the locking directory; ${lockdir} is a
79# subdirectory of this.
80statedir=${prefix}/lib
0c22fbca
JB
81
82# Where to install and expect executable files to be run by Emacs
83# rather than directly by users, and other architecture-dependent
868e080d 84# data. ${archlibdir} is a subdirectory of this.
78008d14 85libdir=${exec_prefix}/lib
0c22fbca
JB
86
87# Where to install Emacs's man pages, and what extension they should have.
78008d14 88mandir=${prefix}/man/man1
0c22fbca
JB
89manext=.1
90
91# Where to install and expect the info files describing Emacs. In the
92# past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
93# since there are now many packages documented with the texinfo
94# system, it is inappropriate to imply that it is part of Emacs.
95infodir=${prefix}/info
86a5659e 96
78008d14
JB
97# Where to find the source code - setting this to anything but
98# . doesn't work yet. The source code for Emacs's C kernel is
99# expected to be in ${srcdir}/src, and the source code for Emacs's
100# utility programs is expected to be in ${srcdir}/lib-src. This is
101# set by the configure script's `--srcdir' option.
0c22fbca 102srcdir=.
86a5659e 103
0c22fbca
JB
104# ==================== Emacs-specific directories ====================
105
78008d14
JB
106# These variables hold the values Emacs will actually use. They are
107# based on the values of the standard Make variables above.
108
109# Where to install the elisp files distributed with Emacs. This
110# includes the Emacs version, so that the lisp files for different
111# versions of Emacs will install themselves in separate directories.
112lispdir=${datadir}/emacs/${version}/lisp
86a5659e 113
46947372 114# Directories Emacs should search for elisp files specific to this
4746118a 115# site (i.e. customizations), before consulting ${lispdir}. This
46947372 116# should be a colon-separated list of directories.
78008d14 117locallisppath=${datadir}/emacs/local-lisp
86a5659e 118
46947372
JB
119# Where Emacs will search to find its elisp files. Before changing
120# this, check to see if your purpose wouldn't better be served by
121# changing locallisppath. This should be a colon-separated list of
122# directories.
4746118a 123lisppath=${locallisppath}:${lispdir}
86a5659e 124
4746118a 125# Where Emacs will search for its elisp files while building. This is
46947372
JB
126# only used during the process of compiling Emacs, to help Emacs find
127# its lisp files before they've been installed in their final
128# location. It's usually identical to lisppath, except that the entry
129# for the directory containing the installed lisp files has been
130# replaced with ../lisp. This should be a colon-separated list of
131# directories.
4746118a 132buildlisppath=../lisp
86a5659e 133
0c22fbca
JB
134# Where to install the other architecture-independent data files
135# distributed with Emacs (like the tutorial, the cookie recipes and
868e080d 136# the Zippy database). This path usually contains the Emacs version
78008d14
JB
137# number, so the data files for multiple versions of Emacs may be
138# installed at once.
139etcdir=${datadir}/emacs/${version}/etc
46947372
JB
140
141# Where to create and expect the locking directory, where the Emacs
142# locking code keeps track of which files are currently being edited.
78008d14 143lockdir=${statedir}/emacs/lock
46947372 144
0c22fbca 145# Where to put executables to be run by Emacs rather than the user.
78008d14
JB
146# This path usually includes the Emacs version and configuration name,
147# so that multiple configurations for multiple versions of Emacs may
148# be installed at once.
149archlibdir=${libdir}/emacs/${version}/${configname}
46947372
JB
150
151# ==================== Utility Programs for the Build ====================
152
153# Allow the user to specify the install program.
154INSTALL = install
155INSTALLFLAGS = -c
156INSTALL_PROGRAM = ${INSTALL}
157INSTALL_DATA = ${INSTALL}
158
46947372 159# ============================= Targets ==============================
86a5659e
JB
160
161# Flags passed down to subdirectory makefiles.
78008d14
JB
162MFLAGS =
163
164CFLAGS=${CONFIG_CFLAGS}
86a5659e
JB
165
166# Subdirectories to make recursively. `lisp' is not included
167# because the compiled lisp files are part of the distribution
168# and you cannot remake them without installing Emacs first.
46947372 169SUBDIR = lib-src src
86a5659e 170
78008d14
JB
171# The makefiles of the directories in $SUBDIR.
172SUBDIR_MAKEFILES = lib-src/Makefile src/Makefile
173
174# Subdirectories to install, and where they'll go. lib-src's makefile
175# knows how to install it, so we don't do that here.
176COPYDIR = etc ${srcdir}/info ${srcdir}/lisp
177COPYDESTS = ${etcdir} ${infodir} ${lispdir}
86a5659e
JB
178
179all: src/paths.h ${SUBDIR}
180
46947372
JB
181removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/'
182
78008d14
JB
183# We force the rebuilding of src/paths.h because the user might give
184# make different values for the various directories. Since we use
185# move-if-change, src/paths.h only actually changes if the user did
186# something notable, so the only unnecessary work we do is in building
187# src/paths.h.tmp, which isn't much.
692f9ac6 188# Note that sed is not in /bin on 386bsd.
78008d14 189src/paths.h: Makefile ${srcdir}/src/paths.h.in FRC
4746118a
JB
190 lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
191 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
78008d14 192 sed < ${srcdir}/src/paths.h.in > src/paths.h.tmp \
46947372 193 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
4746118a 194 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
78008d14
JB
195 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
196 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
32676c08 197 -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";'
78008d14 198 ${srcdir}/move-if-change src/paths.h.tmp src/paths.h
86a5659e
JB
199
200src: lib-src
201
202.RECURSIVE: ${SUBDIR}
203
78008d14 204${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
08edea3c 205 cd $@; $(MAKE) all ${MFLAGS} \
78008d14
JB
206 CC='${CC}' CFLAGS='${CFLAGS}' \
207 srcdir='${srcdir}/$@' libdir='${libdir}'
208
209## We build the makefiles for the subdirectories here so that we can
210## edit the values for the path variables into them. This means that
211## when the user has built them from this makefile once, they will use
212## the right default values for the path variables.
213lib-src/Makefile: ${srcdir}/lib-src/Makefile.in Makefile
214 echo "Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'."
215 rm -f lib-src/Makefile.tmp
216 (echo "# This file is generated from \`${srcdir}/lib-src/Makefile.in'." ; \
217 echo "# If you are thinking about editing it, you should seriously consider" ; \
218 echo "# running \`make lib-src/Makefile' at the top of the" ; \
219 echo "# Emacs build tree instead, or editing" ; \
868e080d 220 echo "# \`${srcdir}/lib-src/Makefile.in' itself." ; \
78008d14 221 /bin/sed < ${srcdir}/lib-src/Makefile.in \
868e080d
JB
222 -e 's|^\(version *=\).*$$|\1'"${version}"'|' \
223 -e 's|^\(configname *=\).*$$|\1'"${configname}"'|' \
224 -e 's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \
78008d14 225 -e 's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \
868e080d
JB
226 -e 's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \
227 -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
228 -e 's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \
78008d14
JB
229 -e 's|^CC *=.*$$|CC='"${CC}"'|' \
230 -e 's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
231 -e 's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|' \
232 -e '/^# DIST: /d') > lib-src/Makefile.tmp
233 ${srcdir}/move-if-change lib-src/Makefile.tmp lib-src/Makefile
78008d14
JB
234 chmod -w lib-src/Makefile
235
236src/Makefile: ${srcdir}/src/Makefile.in Makefile
237 echo "Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
238 rm -f src/Makefile.tmp
239 (echo "# This file is generated from \`${srcdir}/src/Makefile.in'." ; \
240 echo "# If you are thinking about editing it, you should seriously consider" ; \
241 echo "# running \`make src/Makefile' at the top of the" ; \
242 echo "# Emacs build tree instead, or editing" ; \
868e080d 243 echo "# \`${srcdir}/src/Makefile.in' itself." ; \
78008d14 244 /bin/sed < ${srcdir}/src/Makefile.in \
868e080d 245 -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
78008d14
JB
246 -e 's|^CC *=.*$$|CC='"${CC}"'|' \
247 -e 's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
248 -e '/^# DIST: /d') > src/Makefile.tmp
249 ${srcdir}/move-if-change src/Makefile.tmp src/Makefile
78008d14
JB
250 chmod -w src/Makefile
251
252oldXMenu/Makefile: ${srcdir}/oldXMenu/Makefile Makefile
253 echo "Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
254 rm -f src/Makefile.tmp
255 cp "${srcdir}"/oldXMenu/Makefile oldXMenu/Makefile
256
257
258Makefile:
259 ./config.status
260
261# ==================== Installation ====================
262
dbc4e1c1
JB
263## If we let lib-src do its own installation, that means we
264## don't have to duplicate the list of utilities to install in
265## this Makefile as well.
78008d14 266install: all mkdir
08edea3c 267 (cd lib-src; $(MAKE) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
46947372
JB
268 -set ${COPYDESTS} ; \
269 for dir in ${COPYDIR} ; do \
270 dest=$$1 ; shift ; \
78008d14 271 if [ `(cd $${dir}; /bin/pwd)` != `(cd $${dest}; /bin/pwd)` ]; then \
46947372
JB
272 (cd $${dir}; tar cf - . ) | (cd $${dest}; umask 0; tar xf - ) ; \
273 for subdir in `find $${dest} -type d ! -name RCS -print` ; do \
274 rm -rf $${subdir}/RCS ; \
275 rm -f $${subdir}/\#* ; \
276 rm -f $${subdir}/*~ ; \
277 done ; \
278 fi ; \
279 done
868e080d
JB
280 -(cd info ; \
281 if [ ! -f ${infodir}/dir ]; then \
282 ${INSTALL_DATA} ${INSTALLFLAGS} -m 444 ./dir ${infodir}/dir ; \
283 fi ; \
284 if [ "`echo *.info*`" != "*.info*" ]; then \
285 for f in *.info* ; do \
286 ${INSTALL_DATA} ${INSTALLFLAGS} -m 444 $$f ${infodir}/$$f ; \
287 done ; \
288 fi)
78008d14
JB
289 for page in emacs etags ctags ; do \
290 ${INSTALL_DATA} ${INSTALLFLAGS} -m 444 etc/$${page}.1 \
291 ${mandir}/$${page}${manext} ; \
868e080d
JB
292 done
293 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -m 1755 src/emacs \
78008d14 294 ${bindir}/emacs-${version}
46947372 295 -rm -f ${bindir}/emacs
78008d14 296 ln ${bindir}/emacs-${version} ${bindir}/emacs
86a5659e 297
dbc4e1c1
JB
298## If we let lib-src do its own installation, that means we
299## don't have to duplicate the list of utilities to install in
300## this Makefile as well.
78008d14 301install.sysv: all mkdir
08edea3c 302 (cd lib-src; $(MAKE) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
46947372
JB
303 -set ${COPYDESTS} ; \
304 for dir in ${COPYDIR} ; do \
305 dest=$$1 ; shift ; \
306 if [ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
307 (cd $${dir}; find . -print | cpio -pdum ${dest} ) ; \
308 for subdir in `find $${dest} -type d ! -name RCS -print` ; do \
309 rm -rf $${subdir}/RCS ; \
310 rm -f $${subdir}/\#* ; \
311 rm -f $${subdir}/*~ ; \
312 done ; \
313 fi ; \
314 done
78008d14 315 -(cd info ; \
868e080d
JB
316 if [ ! -f ${infodir}/dir ]; then \
317 cpset ./dir ${infodir} 444 bin bin ; \
318 fi ; \
319 if [ "`echo *.info*`" != "*.info*" ]; then \
320 for f in *.info* ; do \
321 cpset $$f ${infodir} 444 bin bin ; \
322 done ; \
323 fi)
78008d14
JB
324 -for page in emacs etags ctags ; do \
325 cpset etc/$${page}.1 ${mandir}/$${page}${manext} 444 bin bin ; \
868e080d 326 done
46947372 327 -/bin/rm -f ${bindir}/emacs
868e080d 328 -cpset src/emacs ${bindir}/emacs-${version} 1755 bin bin
78008d14 329 -ln ${bindir}/emacs-${version} ${bindir}/emacs
86a5659e 330
dbc4e1c1
JB
331## If we let lib-src do its own installation, that means we
332## don't have to duplicate the list of utilities to install in
333## this Makefile as well.
78008d14 334install.xenix: all mkdir
08edea3c 335 (cd lib-src; $(MAKE) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
46947372
JB
336 -set ${COPYDESTS} ; \
337 for dir in ${COPYDIR} ; do \
338 dest=$$1 ; shift ; \
339 if [ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
340 (cd $${dir}; tar cf - . ) | (cd $${dest}; umask 0; tar xpf - ) ; \
341 for subdir in `find $${dest} -type d ! -name RCS -print` ; do \
342 rm -rf $${subdir}/RCS ; \
343 rm -f $${subdir}/\#* ; \
344 rm -f $${subdir}/*~ ; \
345 done ; \
346 fi ; \
347 done
868e080d
JB
348 -(cd info ; \
349 if [ ! -f ${infodir}/dir ]; then \
350 cp ./dir ${infodir} ; \
351 chmod 444 ${infodir}/dir ; \
352 fi ; \
353 if [ "`echo *.info*`" != "*.info*" ]; then \
354 for f in *.info* ; do \
355 cp $$f ${infodir} ; \
356 chmod 444 ${infodir}/$$f ; \
357 done ; \
358 fi)
78008d14
JB
359 for page in emacs etags ctags ; do \
360 cp etc/$${page}.1 ${mandir}/$${page}${manext} ; \
361 chmod 444 ${mandir}/$${page}${manext} ; \
868e080d 362 done
46947372 363 -mv -f ${bindir}/emacs ${bindir}/emacs.old
868e080d 364 cp src/emacs ${bindir}/emacs-${version}
78008d14 365 ln ${bindir}/emacs-${version} ${bindir}/emacs
46947372
JB
366 chmod 1755 ${bindir}/emacs
367 -rm -f ${bindir}/emacs.old
86a5659e 368
dbc4e1c1
JB
369## If we let lib-src do its own installation, that means we
370## don't have to duplicate the list of utilities to install in
371## this Makefile as well.
78008d14 372install.aix: all mkdir
08edea3c 373 (cd lib-src; $(MAKE) install ${MFLAGS} bindir=${bindir} libdir=${libdir})
46947372
JB
374 -set ${COPYDESTS} ; \
375 for dir in ${COPYDIR} ; do \
376 dest=$$1 ; shift ; \
377 if [ `/bin/pwd`/$${dir} != `(cd $${dest}; /bin/pwd)` ] ; then \
378 (cd $${dir}; tar cf - . ) | (cd $${dest}; umask 0; tar xBf - ) ; \
379 for subdir in `find $${dest} -type d ! -name RCS -print` ; do \
380 rm -rf $${subdir}/RCS ; \
381 rm -f $${subdir}/\#* ; \
382 rm -f $${subdir}/*~ ; \
383 done ; \
384 fi ; \
385 done
868e080d
JB
386 -(cd info ; \
387 if [ ! -f ${infodir}/dir ]; then \
388 ${INSTALL_DATA} ${INSTALLFLAGS} -M 444 -f ${infodir} ./dir ; \
389 fi ; \
390 if [ "`echo *.info*`" != "*.info*" ]; then \
391 for f in *.info* ; do \
392 ${INSTALL_DATA} ${INSTALLFLAGS} -M 444 -f ${infodir} $$f ; \
393 done ; \
394 fi)
395 ${INSTALL_PROGRAM} ${INSTALLFLAGS} -M 1755 -f ${bindir} src/emacs
396 mv ${bindir}/emacs ${bindir}/emacs-${version}
78008d14
JB
397 for page in emacs etags ctags ; do \
398 ${INSTALL_DATA} ${INSTALLFLAGS} -M 444 -f ${mandir} etc/$${page}.1 ;\
868e080d 399 done
46947372 400 -rm -f ${bindir}/emacs
78008d14 401 ln ${bindir}/emacs-${version} ${bindir}/emacs
badb0a97 402
868e080d 403### Build all the directories we're going to install Emacs in. Since
78008d14
JB
404### we may be creating several layers of directories (for example,
405### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
406### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
86a5659e 407mkdir: FRC
78008d14
JB
408 ./lib-src/make-path ${COPYDESTS} ${lockdir}
409 chmod 777 ${COPYDESTS} ${lockdir}
86a5659e
JB
410
411FRC:
412
78008d14
JB
413
414# ==================== Cleaning up and miscellanea ====================
415
416### `clean'
868e080d
JB
417### Delete all files from the current directory that are normally
418### created by building the program. Don't delete the files that
419### record the configuration. Also preserve files that could be made
420### by building, but normally aren't because the distribution comes
421### with them.
78008d14 422### `mostlyclean'
868e080d
JB
423### Like `clean', but may refrain from deleting a few files that
424### people normally don't want to recompile. For example, the
425### `mostlyclean' target for GCC does not delete `libgcc.a', because
426### recompiling it is rarely necessary and takes a lot of time.
78008d14 427###
46947372 428clean mostlyclean:
08edea3c
RS
429 cd src; $(MAKE) clean
430 cd lib-src; $(MAKE) clean
431 cd oldXMenu; $(MAKE) clean
78008d14 432 if [ `(cd ${etcdir} ; /bin/pwd` != `(cd etc; /bin/pwd)` ] ; then \
08edea3c 433 cd etc; $(MAKE) clean; \
46947372
JB
434 else true; \
435 fi
46947372 436
78008d14 437### `distclean'
868e080d
JB
438### Delete all files from the current directory that are created by
439### configuring or building the program. This should leave only the
440### files that would be in the distribution.
46947372 441distclean:
08edea3c 442 for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} distclean); done
46947372
JB
443 -(cd lock; rm *)
444 -rm config.status config-tmp-*
46947372 445
78008d14 446### `realclean'
868e080d
JB
447### Delete everything from the current directory that can be
448### reconstructed with this makefile. This typically includes
449### everything deleted by distclean, plus more: C source files
450### produced by Bison, tags tables, info files, and so on.
46947372 451realclean:
08edea3c 452 for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} realclean); done
46947372
JB
453 (cd lock; rm *)
454 rm config.status
455
78008d14
JB
456### This doesn't actually appear in the coding standards, but Karl
457### says GCC supports it, and that's where the configuration part of
458### the coding standards seem to come from. It's like distclean, but
459### it deletes backup and autosave files too.
460extraclean:
08edea3c 461 for i in ${SUBDIR}; do (cd $$i; $(MAKE) ${MFLAGS} extraclean); done
78008d14
JB
462 -(cd lock; rm *)
463 -rm config.status config-tmp-*
464 -rm -f *~ \#*
465
466
46947372 467TAGS tags: lib-src
78008d14
JB
468 (cd ${srcdir} ; lib-src/etags --output=./src/TAGS \
469 src/*.[ch] lisp/*.el lisp/term/*.el)
46947372
JB
470
471check:
472 @echo "We don't have any tests for GNU Emacs yet."
4746118a
JB
473
474dist:
78008d14 475 cd ${srcdir}; make-dist