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
5 # make all to compile and build Emacs.
6 # make install to install it.
7 # make TAGS to update tags tables.
9 # make clean or make mostlyclean
10 # Delete all files from the current directory that are normally
11 # created by building the program. Don't delete the files that
12 # record the configuration. Also preserve files that could be made
13 # by building, but normally aren't because the distribution comes
16 # Delete `.dvi' files here if they are not part of the distribution.
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
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.
32 # Still more severe - delete backup and autosave files, too.
36 # If Make doesn't predefine MAKE, set it here.
39 # ==================== Things `configure' Might Edit ====================
43 C_SWITCH_SYSTEM
=@c_switch_system@
47 C_SWITCH_X_SITE
=@C_SWITCH_X_SITE@
48 LD_SWITCH_X_SITE
=@LD_SWITCH_X_SITE@
51 ### These help us choose version- and architecture-specific directories
52 ### to install files in.
54 ### This should be the number of the Emacs version we're building,
55 ### like `18.59' or `19.0'.
58 ### This should be the name of the configuration we're building Emacs
59 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
60 configuration
=@configuration@
62 ### Libraries which should be edited into lib-src/Makefile.
63 libsrc_libs
=@libsrc_libs@
65 # ==================== Where To Install Things ====================
67 # The default location for installation. Everything is placed in
68 # subdirectories of this directory. The default values for many of
69 # the variables below are expressed in terms of this one, so you may
70 # not need to change them. This defaults to /usr/local.
73 # Like `prefix', but used for architecture-specific files.
74 exec_prefix=@
exec_prefix@
76 # Where to install Emacs and other binaries that people will want to
77 # run directly (like etags).
80 # Where to install architecture-independent data files. ${lispdir}
81 # and ${etcdir} are subdirectories of this.
84 # Where to install and expect the files that Emacs modifies as it
85 # runs. These files are all architecture-independent. Right now, the
86 # only such data is the locking directory; ${lockdir} is a
87 # subdirectory of this.
90 # Where to install and expect executable files to be run by Emacs
91 # rather than directly by users, and other architecture-dependent
92 # data. ${archlibdir} is a subdirectory of this.
95 # Where to install Emacs's man pages, and what extension they should have.
99 # Where to install and expect the info files describing Emacs. In the
100 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
101 # since there are now many packages documented with the texinfo
102 # system, it is inappropriate to imply that it is part of Emacs.
105 # Where to find the source code. The source code for Emacs's C kernel is
106 # expected to be in ${srcdir}/src, and the source code for Emacs's
107 # utility programs is expected to be in ${srcdir}/lib-src. This is
108 # set by the configure script's `--srcdir' option.
111 # Tell make where to find source files; this is needed for the makefiles.
114 # ==================== Emacs-specific directories ====================
116 # These variables hold the values Emacs will actually use. They are
117 # based on the values of the standard Make variables above.
119 # Where to install the lisp files distributed with
120 # Emacs. This includes the Emacs version, so that the
121 # lisp files for different versions of Emacs will install
122 # themselves in separate directories.
125 # Directories Emacs should search for lisp files specific
126 # to this site (i.e. customizations), before consulting
127 # ${lispdir}. This should be a colon-separated list of
129 locallisppath
=@locallisppath@
131 # Where Emacs will search to find its lisp files. Before
132 # changing this, check to see if your purpose wouldn't
133 # better be served by changing locallisppath. This
134 # should be a colon-separated list of directories.
137 # Where Emacs will search for its lisp files while
138 # building. This is only used during the process of
139 # compiling Emacs, to help Emacs find its lisp files
140 # before they've been installed in their final location.
141 # It's usually identical to lisppath, except that the
142 # entry for the directory containing the installed lisp
143 # files has been replaced with ../lisp. This should be a
144 # colon-separated list of directories.
145 buildlisppath
=${srcdir}/lisp
147 # Where to install the other architecture-independent
148 # data files distributed with Emacs (like the tutorial,
149 # the cookie recipes and the Zippy database). This path
150 # usually contains the Emacs version number, so the data
151 # files for multiple versions of Emacs may be installed
155 # Where to create and expect the locking directory, where
156 # the Emacs locking code keeps track of which files are
157 # currently being edited.
160 # Where to put executables to be run by Emacs rather than
161 # the user. This path usually includes the Emacs version
162 # and configuration name, so that multiple configurations
163 # for multiple versions of Emacs may be installed at
165 archlibdir
=@archlibdir@
167 # Where to put the docstring file.
170 # ==================== Utility Programs for the Build ====================
172 # Allow the user to specify the install program.
174 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
175 INSTALL_DATA
= @INSTALL_DATA@
177 # ============================= Targets ==============================
179 # What emacs should be called when installed.
182 # Subdirectories to make recursively. `lisp' is not included
183 # because the compiled lisp files are part of the distribution
184 # and you cannot remake them without installing Emacs first.
187 # The makefiles of the directories in $SUBDIR.
188 SUBDIR_MAKEFILES
= lib-src
/Makefile src
/Makefile oldXMenu
/Makefile lwlib
/Makefile
190 # Subdirectories to install, and where they'll go.
191 # lib-src's makefile knows how to install it, so we don't do that here.
192 # When installing the info files, we need to do special things to
193 # avoid nuking an existing dir file, so we don't do that here;
194 # instead, we have written out explicit code in the `install' targets.
195 COPYDIR
= ${srcdir}/etc
${srcdir}/lisp
196 COPYDESTS
= ${etcdir} ${lispdir}
198 all: src
/paths.h
${SUBDIR}
200 removenullpaths
=sed
-e
's/^://' -e
's/:$$//' -e
's/::/:/'
202 # We force the rebuilding of src/paths.h because the user might give
203 # make different values for the various directories. Since we use
204 # move-if-change, src/paths.h only actually changes if the user did
205 # something notable, so the only unnecessary work we do is in building
206 # src/paths.h.tmp, which isn't much.
207 # Note that sed is not in /bin on 386bsd.
208 src
/paths.h
: Makefile
${srcdir}/src
/paths.h.in FRC.src.paths.h
209 @echo
"Producing \`src/paths.h' from \`src/paths.h.in'."
210 @
(lisppath
=`echo ${lisppath} | ${removenullpaths}` ; \
211 buildlisppath
=`echo ${buildlisppath} | ${removenullpaths}` ; \
212 sed
< ${srcdir}/src
/paths.h.in
> src
/paths.h.tmp \
213 -e
's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
214 -e
's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
215 -e
's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
216 -e
's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
217 -e
's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
218 -e
's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \
219 -e
's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";')
220 @
${srcdir}/move-if-change src
/paths.h.tmp src
/paths.h
225 .RECURSIVE
: ${SUBDIR}
227 ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
228 cd
$@
; $(MAKE
) all $(MFLAGS
) \
229 CC
='${CC}' CFLAGS
='${CFLAGS}' CPPFLAGS
='${CPPFLAGS}' \
230 LDFLAGS
='${LDFLAGS}' MAKE
='${MAKE}'
232 Makefile
: Makefile.in config.status
235 src
/Makefile
: src
/Makefile.in.in config.status
238 lib-src
/Makefile
: lib-src
/Makefile.in config.status
241 oldXMenu
/Makefile
: oldXMenu
/Makefile.in config.status
244 lwlib
/Makefile
: lwlib
/Makefile.in config.status
247 # ==================== Installation ====================
249 ## If we let lib-src do its own installation, that means we
250 ## don't have to duplicate the list of utilities to install in
251 ## this Makefile as well.
253 ## On AIX, use tar xBf.
254 ## On Xenix, use tar xpf.
256 .PHONY
: install mkdir
258 ## We delete each directory in ${COPYDESTS} before we copy into it;
259 ## that way, we can reinstall over directories that have been put in
260 ## place with their files read-only (perhaps because they are checked
261 ## into RCS). In order to make this safe, we make sure that the
262 ## source exists and is distinct from the destination.
263 ## We don't depend on `all', but rather on ${SUBDIR}, so that we won't
264 ## ever modify src/paths.h.
265 install: ${SUBDIR} install-arch-dep install-arch-indep
;
267 ### Note that we copy the DOC-* files from the build etc directory
268 ### as well as lots of things from ${srcdir}/etc.
270 ## The docfile isn't really architecture-dependent, but we want to
271 ## install it along with the version of Emacs that it's keyed to.
272 install-arch-dep
: mkdir install-doc
274 $(MAKE
) install $(MFLAGS
) prefix=${prefix} \
275 exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
276 archlibdir
=${archlibdir})
277 ${INSTALL_PROGRAM} src
/emacs
${bindir}/emacs-
${version}
278 -chmod
1755 ${bindir}/emacs-
${version}
279 rm -f
${bindir}/$(EMACS
)
280 -ln
${bindir}/emacs-
${version} ${bindir}/$(EMACS
)
283 if
[ `(cd ./etc; /bin/pwd)` != `(cd ${docdir}; /bin/pwd)` ]; \
285 echo
"Copying etc/DOC* ..." ; \
286 (cd etc
; tar -cf
- DOC
*)|
(cd
${docdir}; umask
0; tar -xvf
- ); \
289 install-arch-indep
: mkdir
290 -set
${COPYDESTS} ; \
291 for
dir in
${COPYDIR} ; do \
292 if
[ `(cd $$1 && pwd)` != `(cd $${dir} && pwd)` ] ; then \
297 -set
${COPYDESTS} ; \
298 mkdir
${COPYDESTS} ; \
299 for
dir in
${COPYDIR} ; do \
302 && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
303 && (echo
"Copying $${dir}..." ; \
304 (cd
$${dir}; tar -cf
- .
)|
(cd
$${dest};umask
022; tar -xvf
- ); \
305 for subdir in
`find $${dest} -type d ! -name RCS -print` ; do \
306 rm -rf
$${subdir}/RCS
; \
307 rm -rf
$${subdir}/CVS
; \
308 rm -f
$${subdir}/\
#* ; \
309 rm -f
$${subdir}/*~
; \
313 if
[ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
315 (cd
${srcdir}/info ; \
316 if
[ ! -f
${infodir}/dir ] && [ -f
dir ]; then \
317 (cd
$${thisdir}; ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir); \
319 for f in cl
* emacs
* forms
* gnus
* info* sc
* vip
* ; do \
320 (cd
$${thisdir}; ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f); \
323 thisdir
=`pwd`; cd
${srcdir}/etc
; for page in emacs etags ctags
; do \
324 (cd
$${thisdir}; ${INSTALL_DATA} ${srcdir}/etc
/$${page}.1 ${mandir}/$${page}${manext}); \
327 ### Build all the directories we're going to install Emacs in. Since
328 ### we may be creating several layers of directories (for example,
329 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use make-path
330 ### instead of mkdir. Not all systems' mkdirs have the `-p' flag.
332 .
/lib-src
/make-path
${COPYDESTS} ${lockdir} ${infodir} ${mandir} \
333 ${bindir} ${datadir} ${docdir} ${libdir} \
334 `echo ${locallisppath} | sed 's/:/ /'`
335 -chmod
777 ${lockdir}
337 ### Delete all the installed files that the `install' target would
338 ### create (but not the noninstalled files such as `make all' would
341 ### Don't delete the lisp and etc directories if they're in the source tree.
344 $(MAKE
) $(MFLAGS
) uninstall \
345 prefix=${prefix} exec_prefix=${exec_prefix} \
346 bindir=${bindir} libdir=${libdir} archlibdir
=${archlibdir})
347 for
dir in
${lispdir} ${etcdir} ; do \
348 case
`(cd $${dir} ; pwd)` in \
349 `(cd ${srcdir} ; pwd)`* ) ;; \
350 * ) rm -rf
$${dir} ;; \
353 ${datadir}/emacs
/${version}/* ) \
354 rm -rf
${datadir}/emacs
/${version} \
358 (cd
${infodir}; rm -f cl
* emacs
* forms
* info* vip
*)
359 (cd
${mandir}; rm -f emacs
.1 etags
.1 ctags
.1)
360 (cd
${bindir}; rm -f emacs-
${version} emacs
)
363 ### Some makes seem to remember that they've built something called FRC,
364 ### so you can only use a given FRC once per makefile.
365 FRC FRC.src.paths.h FRC.src FRC.lib-src FRC.mkdir
:
366 FRC.
mostlyclean FRC.
clean FRC.
distclean FRC.
realclean:
368 # ==================== Cleaning up and miscellanea ====================
370 .PHONY
: mostlyclean clean distclean realclean extraclean
373 ### Like `clean', but may refrain from deleting a few files that people
374 ### normally don't want to recompile. For example, the `mostlyclean'
375 ### target for GCC does not delete `libgcc.a', because recompiling it
376 ### is rarely necessary and takes a lot of time.
377 mostlyclean: FRC.
mostlyclean
378 (cd src
; $(MAKE
) $(MFLAGS
) mostlyclean)
379 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) mostlyclean)
380 (cd lwlib
; $(MAKE
) $(MFLAGS
) mostlyclean)
381 (cd lib-src
; $(MAKE
) $(MFLAGS
) mostlyclean)
382 -(cd man
; $(MAKE
) $(MFLAGS
) mostlyclean)
385 ### Delete all files from the current directory that are normally
386 ### created by building the program. Don't delete the files that
387 ### record the configuration. Also preserve files that could be made
388 ### by building, but normally aren't because the distribution comes
391 ### Delete `.dvi' files here if they are not part of the distribution.
393 (cd src
; $(MAKE
) $(MFLAGS
) clean)
394 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) clean)
395 (cd lwlib
; $(MAKE
) $(MFLAGS
) clean)
396 (cd lib-src
; $(MAKE
) $(MFLAGS
) clean)
397 -(cd man
; $(MAKE
) $(MFLAGS
) clean)
400 ### Delete all files from the current directory that are created by
401 ### configuring or building the program. If you have unpacked the
402 ### source and built the program without creating any other files,
403 ### `make distclean' should leave only the files that were in the
406 rm -f config.status build-install
; \
407 rm -f Makefile
${SUBDIR_MAKEFILES} ; \
409 distclean: FRC.
distclean
410 (cd src
; $(MAKE
) $(MFLAGS
) distclean)
411 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) distclean)
412 (cd lwlib
; $(MAKE
) $(MFLAGS
) distclean)
413 (cd lib-src
; $(MAKE
) $(MFLAGS
) distclean)
414 (cd man
; $(MAKE
) $(MFLAGS
) distclean)
419 ### Delete everything from the current directory that can be
420 ### reconstructed with this Makefile. This typically includes
421 ### everything deleted by distclean, plus more: C source files
422 ### produced by Bison, tags tables, info files, and so on.
424 ### One exception, however: `make realclean' should not delete
425 ### `configure' even if `configure' can be remade using a rule in the
426 ### Makefile. More generally, `make realclean' should not delete
427 ### anything that needs to exist in order to run `configure' and then
428 ### begin to build the program.
429 realclean: FRC.
realclean
430 (cd src
; $(MAKE
) $(MFLAGS
) realclean)
431 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) realclean)
432 (cd lwlib
; $(MAKE
) $(MFLAGS
) realclean)
433 (cd lib-src
; $(MAKE
) $(MFLAGS
) realclean)
434 -(cd man
; $(MAKE
) $(MFLAGS
) realclean)
437 ### This doesn't actually appear in the coding standards, but Karl
438 ### says GCC supports it, and that's where the configuration part of
439 ### the coding standards seem to come from. It's like distclean, but
440 ### it deletes backup and autosave files too.
442 for i in
${SUBDIR}; do
(cd
$$i; $(MAKE
) $(MFLAGS
) extraclean
); done
444 -rm config.status config-tmp-
*
447 ### Unlocking and relocking. The idea of these productions is to reduce
448 ### hassles when installing an incremental tar of Emacs. Do `make unlock'
449 ### before unlocking the file to take the write locks off all sources so
450 ### that tar xvof will overwrite them without fuss. Then do `make relock'
451 ### afterward so that VC mode will know which files should be checked in
452 ### if you want to mung them.
454 ### Note: it's no disaster if these productions miss a file or two; tar
455 ### and VC will swiftly let you know if this happens, and it is easily
457 SOURCES
= ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
458 README build-install.in configure make-dist move-if-change
460 .PHONY
: unlock relock
463 chmod u
+w
$(SOURCES
) cpp/*
464 -(cd elisp
; chmod u
+w Makefile README
*.texi
)
465 (cd etc
; $(MAKE
) $(MFLAGS
) unlock
)
466 (cd lib-src
; $(MAKE
) $(MFLAGS
) unlock
)
467 (cd lisp
; $(MAKE
) $(MFLAGS
) unlock
)
468 (cd lisp
/term
; chmod u
+w README
*.el
)
469 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
470 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
471 (cd lwlib
; chmod u
+w
*.
[ch
] Makefile README
)
472 (cd src
; $(MAKE
) $(MFLAGS
) unlock
)
475 chmod u-w
$(SOURCES
) cpp/*
476 -(cd elisp
; chmod u-w Makefile README
*.texi
)
477 (cd etc
; $(MAKE
) $(MFLAGS
) relock
)
478 (cd lib-src
; $(MAKE
) $(MFLAGS
) relock
)
479 (cd lisp
; $(MAKE
) $(MFLAGS
) relock
)
480 (cd lisp
/term
; chmod u
+w README
*.el
)
481 (cd man
; chmod u
+w
*texi
* ChangeLog split-man
)
482 (cd oldXMenu
; chmod u
+w
*.
[ch
] Makefile README
)
483 (cd lwlib
; chmod u
+w
*.
[ch
] Makefile README
)
484 (cd src
; $(MAKE
) $(MFLAGS
) relock
)
488 ..
/lib-src
/etags
*.
[ch
] ..
/lisp
/*.el ..
/lisp
/term
/*.el
)
491 @echo
"We don't have any tests for GNU Emacs yet."
494 cd
${srcdir}; make-dist
496 .PHONY
: info dvi dist check
499 (cd
${srcdir}/man
; $(MAKE
) $(MFLAGS
) info)
501 (cd
${srcdir}/man
; $(MAKE
) $(MFLAGS
) dvi)