# DIST: that first.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-# 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
# This file is part of GNU Emacs.
# GNU Emacs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
+# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# GNU Emacs is distributed in the hope that it will be useful,
# since there are now many packages documented with the texinfo
# system, it is inappropriate to imply that it is part of Emacs.
infodir=@infodir@
-INFO_FILES=ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
- elisp eintr emacs emacs-mime eshell eudc flymake \
- forms gnus idlwave info message mh-e newsticker org pcl-cvs \
- pgg reftex sc ses sieve speedbar tramp vip viper widget \
- woman smtpmail url rcirc erc
+INFO_FILES=ada-mode autotype calc ccmode cl dbus dired-x ebrowse ediff \
+ efaq eintr elisp emacs emacs-mime epa erc eshell eudc \
+ flymake forms gnus idlwave info message mh-e newsticker \
+ nxml-mode org pcl-cvs pgg rcirc reftex remember sc ses sieve \
+ speedbar tramp vip viper widget woman smtpmail url
# Directory for local state files for all programs.
localstatedir=@localstatedir@
# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
srcdir=@srcdir@
+# Where the manpage source files are kept.
+mansrcdir=$(srcdir)/doc/man
+
# Tell make where to find source files; this is needed for the makefiles.
VPATH=@srcdir@
# Location to install Emacs.app on Mac OS X
carbon_appdir=@carbon_appdir@
+# Where the etc/emacs.desktop file is to be installed.
+desktopdir=$(datarootdir)/applications
+
+# Where the etc/images/icons/hicolor directory is to be installed.
+icondir=$(datarootdir)/icons
+
+# The source directory for the icon files.
+iconsrcdir=$(srcdir)/etc/images/icons
+
# ==================== Emacs-specific directories ====================
# These variables hold the values Emacs will actually use. They are
SUBDIR = lib-src src
# The makefiles of the directories in $SUBDIR.
-SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile lispref/Makefile lispintro/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile
+SUBDIR_MAKEFILES = lib-src/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispref/Makefile doc/lispintro/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile
# Subdirectories to install, and where they'll go.
# lib-src's makefile knows how to install it, so we don't do that here.
lib-src/Makefile: $(srcdir)/lib-src/Makefile.in config.status
./config.status
-man/Makefile: $(srcdir)/man/Makefile.in config.status
+doc/emacs/Makefile: $(srcdir)/doc/emacs/Makefile.in config.status
+ ./config.status
+
+doc/misc/Makefile: $(srcdir)/doc/misc/Makefile.in config.status
./config.status
-lispref/Makefile: $(srcdir)/lispref/Makefile.in config.status
+doc/lispref/Makefile: $(srcdir)/doc/lispref/Makefile.in config.status
./config.status
-lispintro/Makefile: $(srcdir)/lispintro/Makefile.in config.status
+doc/lispintro/Makefile: $(srcdir)/doc/lispintro/Makefile.in config.status
./config.status
oldXMenu/Makefile: $(srcdir)/oldXMenu/Makefile.in config.status
&& cat > /dev/null))) || exit 1; \
fi
+## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html
+## Needs to be the user running install, so configure can't set it.
+set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
+ `id -un 2> /dev/null`; do \
+ [ -n "$${installuser}" ] && break ; \
+ done
+
### Install the files that are machine-independent.
### Most of them come straight from the distribution;
### the exception is the DOC-* files, which are copied
## If people complain about the h flag in tar command, take that out.
## That flag is also used in leim/Makefile.in
-install-arch-indep: mkdir info
+
+## Note that the Makefiles in the etc directory are potentially useful
+## in an installed Emacs, so should not be excluded.
+
+install-arch-indep: mkdir info install-etc
-set ${COPYDESTS} ; \
unset CDPATH; \
for dir in ${COPYDIR} ; do \
mkdir ${COPYDESTS} ; \
chmod ugo+rx ${COPYDESTS} ; \
unset CDPATH; \
+ $(set_installuser); \
for dir in ${COPYDIR} ; do \
dest=$$1 ; shift ; \
[ -d $${dir} ] \
(cd $${dir}; tar -chf - . ) \
| (cd $${dest}; umask 022; \
tar -xvf - && cat > /dev/null) || exit 1; \
- find $${dest} -exec chown $${LOGNAME:-$$USERNAME} {} ';' ;\
+ find $${dest} -exec chown $${installuser} {} ';' ;\
for subdir in `find $${dest} -type d ! -name RCS ! -name CVS -print` ; do \
chmod a+rx $${subdir} ; \
rm -rf $${subdir}/RCS ; \
rm -f $${subdir}/.\#* ; \
rm -f $${subdir}/*~ ; \
rm -f $${subdir}/*.orig ; \
- rm -f $${subdir}/[mM]akefile* ; \
+ [ "$${dir}" != "${srcdir}/etc" ] && \
+ rm -f $${subdir}/[mM]akefile* ; \
rm -f $${subdir}/ChangeLog* ; \
rm -f $${subdir}/dired.todo ; \
done) ; \
echo "Copying etc/$${docfile} to $(DESTDIR)${docdir} ..." ; \
(cd ./etc; tar -chf - $${docfile}) \
|(cd $(DESTDIR)${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(DESTDIR)$(docdir); chown $${LOGNAME:-$$USERNAME} DOC*; chmod a+r DOC*; \
- if test "`echo DOC-*`" != "DOC-*"; then rm DOC; fi); \
+ (cd $(DESTDIR)$(docdir); \
+ $(set_installuser); \
+ chown $${installuser} DOC*; chmod a+r DOC*; \
+ if test "`echo DOC-*`" != "DOC-*"; then rm -f DOC; fi); \
else true; fi
-unset CDPATH; \
if [ -r ./lisp ] \
echo "Copying lisp/*.el and lisp/*.elc to $(DESTDIR)${lispdir} ..." ; \
(cd lisp; tar -chf - *.el *.elc) \
|(cd $(DESTDIR)${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(DESTDIR)${lispdir}; find . -exec chown $${LOGNAME:-$$USERNAME} {} ';') ; \
+ (cd $(DESTDIR)${lispdir}; \
+ $(set_installuser); \
+ find . -exec chown $${installuser} {} ';') ; \
else true; fi
-unset CDPATH; \
if [ -n "${GZIP_PROG}" ]; \
else true; fi
-chmod -R a+r $(DESTDIR)${datadir}/emacs/${version} $(DESTDIR)${datadir}/emacs/site-lisp ${COPYDESTS} $(DESTDIR)${infodir}
thisdir=`/bin/pwd`; \
- cd ${srcdir}/etc; \
+ cd ${mansrcdir}; \
for page in emacs emacsclient etags ctags ; do \
(cd $${thisdir}; \
- ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 $(DESTDIR)${man1dir}/$${page}${manext}; \
+ ${INSTALL_DATA} ${mansrcdir}/$${page}.1 $(DESTDIR)${man1dir}/$${page}${manext}; \
chmod a+r $(DESTDIR)${man1dir}/$${page}${manext}); \
done
+## Install those items from etc/ that need to end up elsewhere.
+install-etc: mkdir
+ ${INSTALL_DATA} ${srcdir}/etc/emacs.desktop \
+ $(DESTDIR)${desktopdir}/emacs.desktop
+ for icon in $(iconsrcdir)/*/*/apps/*.* \
+ $(iconsrcdir)/*/*/mimetypes/*.*; do \
+ if [ -r $${icon} ]; then \
+ iicon=`echo "$${icon}" | sed 's,$(srcdir)/etc/images/icons,$(DESTDIR)${icondir},'` ; \
+ ${INSTALL_DATA} $${icon} $${iicon} ; \
+ fi ; \
+ done
+
### Install LEIM files. Although they are machine-independent, we
### have separate target here instead of including it in
### `install-arch-indep'. People who extracted LEIM files after they
$(srcdir)/mkinstalldirs $(DESTDIR)${datadir}; \
chmod a+r $(DESTDIR)${datadir};\
fi
+ icondirs= ; \
+ for dir in $(iconsrcdir)/*/*/apps $(iconsrcdir)/*/*/mimetypes; do \
+ if [ -d $${dir} ]; then \
+ icondirs="$${icondirs} $${dir}" ; \
+ fi ; \
+ done ; \
+ icondirs=`echo "$${icondirs}" | sed 's,$(srcdir)/etc/images/icons,$(DESTDIR)${icondir},g'` ; \
$(srcdir)/mkinstalldirs ${COPYDESTS} $(DESTDIR)${infodir} $(DESTDIR)${man1dir} \
$(DESTDIR)${bindir} $(DESTDIR)${docdir} $(DESTDIR)${libexecdir} \
$(DESTDIR)${datadir}/emacs/site-lisp \
$(DESTDIR)${datadir}/emacs/${version}/site-lisp \
- $(DESTDIR)`echo ${locallisppath} | sed 's,:, $(DESTDIR),g'`
+ $(DESTDIR)`echo ${locallisppath} | sed 's,:, $(DESTDIR),g'` \
+ $(DESTDIR)${desktopdir} $${icondirs}
### Delete all the installed files that the `install' target would
### create (but not the noninstalled files such as `make all' would
(cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean)
(cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
(cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
- -(cd man && $(MAKE) $(MFLAGS) mostlyclean)
- -(cd lispref && $(MAKE) $(MFLAGS) mostlyclean)
- -(cd lispintro && $(MAKE) $(MFLAGS) mostlyclean)
+ -(cd doc/emacs && $(MAKE) $(MFLAGS) mostlyclean)
+ -(cd doc/misc && $(MAKE) $(MFLAGS) mostlyclean)
+ -(cd doc/lispref && $(MAKE) $(MFLAGS) mostlyclean)
+ -(cd doc/lispintro && $(MAKE) $(MFLAGS) mostlyclean)
(cd leim; $(MAKE) $(MFLAGS) mostlyclean)
### `clean'
(cd oldXMenu; $(MAKE) $(MFLAGS) clean)
(cd lwlib; $(MAKE) $(MFLAGS) clean)
(cd lib-src; $(MAKE) $(MFLAGS) clean)
- -(cd man && $(MAKE) $(MFLAGS) clean)
- -(cd lispref && $(MAKE) $(MFLAGS) clean)
- -(cd lispintro && $(MAKE) $(MFLAGS) clean)
+ -(cd doc/emacs && $(MAKE) $(MFLAGS) clean)
+ -(cd doc/misc && $(MAKE) $(MFLAGS) clean)
+ -(cd doc/lispref && $(MAKE) $(MFLAGS) clean)
+ -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean)
(cd leim; $(MAKE) $(MFLAGS) clean)
### `distclean'
(cd oldXMenu; $(MAKE) $(MFLAGS) distclean)
(cd lwlib; $(MAKE) $(MFLAGS) distclean)
(cd lib-src; $(MAKE) $(MFLAGS) distclean)
- (cd man && $(MAKE) $(MFLAGS) distclean)
- (cd lispref && $(MAKE) $(MFLAGS) distclean)
- (cd lispintro && $(MAKE) $(MFLAGS) distclean)
+ (cd doc/emacs && $(MAKE) $(MFLAGS) distclean)
+ (cd doc/misc && $(MAKE) $(MFLAGS) distclean)
+ (cd doc/lispref && $(MAKE) $(MFLAGS) distclean)
+ (cd doc/lispintro && $(MAKE) $(MFLAGS) distclean)
(cd leim; $(MAKE) $(MFLAGS) distclean)
(cd lisp; $(MAKE) $(MFLAGS) distclean)
${top_distclean}
(cd oldXMenu; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean)
- -(cd man && $(MAKE) $(MFLAGS) maintainer-clean)
- -(cd lispref && $(MAKE) $(MFLAGS) maintainer-clean)
- -(cd lispintro && $(MAKE) $(MFLAGS) maintainer-clean)
+ -(cd doc/emacs && $(MAKE) $(MFLAGS) maintainer-clean)
+ -(cd doc/misc && $(MAKE) $(MFLAGS) maintainer-clean)
+ -(cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean)
+ -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean)
(cd leim; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lisp; $(MAKE) $(MFLAGS) maintainer-clean)
${top_distclean}
-rm -f config-tmp-*
-rm -f *~ \#*
-### 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 FTP INSTALL Makefile.in \
- README configure make-dist move-if-change
-
-.PHONY: unlock relock
-
-unlock:
- chmod u+w $(SOURCES)
- -(cd elisp; chmod u+w Makefile README *.texi)
- (cd etc; $(MAKE) $(MFLAGS) unlock)
- (cd lib-src; $(MAKE) $(MFLAGS) unlock)
- (cd lisp; $(MAKE) $(MFLAGS) unlock)
- (cd lisp/term; chmod u+w README *.el)
- (cd man; chmod u+w *texi* ChangeLog split-man)
- (cd lispref; chmod u+w *texi* ChangeLog)
- (cd lispintro; chmod u+w *texi* ChangeLog)
- (cd oldXMenu; chmod u+w *.[ch] Makefile README)
- (cd lwlib; chmod u+w *.[ch] Makefile README)
- (cd src; $(MAKE) $(MFLAGS) unlock)
-
-relock:
- chmod u-w $(SOURCES)
- -(cd elisp; chmod u-w Makefile README *.texi)
- (cd etc; $(MAKE) $(MFLAGS) relock)
- (cd lib-src; $(MAKE) $(MFLAGS) relock)
- (cd lisp; $(MAKE) $(MFLAGS) relock)
- (cd lisp/term; chmod u+w README *.el)
- (cd man; chmod u+w *texi* ChangeLog split-man)
- (cd lispref; chmod u+w *texi* ChangeLog)
- (cd lispintro; chmod u+w *texi* ChangeLog)
- (cd oldXMenu; chmod u+w *.[ch] Makefile README)
- (cd lwlib; chmod u+w *.[ch] Makefile README)
- (cd src; $(MAKE) $(MFLAGS) relock)
-
# The src subdir knows how to do the right thing
# even when the build directory and source dir are different.
TAGS tags: lib-src src
# put the info files in $(srcdir),
# so we can do ok running make in the build dir.
info: force-info
- -(cd man; $(MAKE) $(MFLAGS) info)
- -(cd lispref; $(MAKE) $(MFLAGS) info)
- -(cd lispintro; $(MAKE) $(MFLAGS) info)
+ -(cd doc/emacs; $(MAKE) $(MFLAGS) info)
+ -(cd doc/misc; $(MAKE) $(MFLAGS) info)
+ -(cd doc/lispref; $(MAKE) $(MFLAGS) info)
+ -(cd doc/lispintro; $(MAKE) $(MFLAGS) info)
+
+# The info/dir file must be updated by hand when new manuals are added.
+check-info-dir: info
+ cd info ; \
+ missing= ; \
+ for file in *; do \
+ test -f "$${file}" || continue ; \
+ case $${file} in \
+ *-[0-9]*|COPYING|dir) continue ;; \
+ esac ; \
+ grep -q -F ": ($${file})." dir || missing="$${missing} $${file}" ; \
+ done ; \
+ if test -n "$${missing}"; then \
+ echo "Missing info/dir entries: $${missing}" ; \
+ exit 1 ; \
+ fi ; \
+ echo "info/dir is OK"
+
dvi:
- (cd man; $(MAKE) $(MFLAGS) dvi)
- (cd lispref; $(MAKE) $(MFLAGS) elisp.dvi)
- (cd lispintro; $(MAKE) $(MFLAGS) emacs-lisp-intro.dvi)
+ (cd doc/emacs; $(MAKE) $(MFLAGS) dvi)
+ (cd doc/misc; $(MAKE) $(MFLAGS) dvi)
+ (cd doc/lispref; $(MAKE) $(MFLAGS) elisp.dvi)
+ (cd doc/lispintro; $(MAKE) $(MFLAGS) emacs-lisp-intro.dvi)
#### Bootstrapping.
if [ \( "$$bar" = '$(srcdir)/lisp/*.elc' \) -o \( "$$bar" = '' \) ]; then \
echo "Your tree does not include the compiled Lisp files."; \
echo "You need to do \`make bootstrap' to build Emacs."; \
- echo "Emacs now requires Texinfo version 4.2."; \
exit 1;\
fi
(cd oldXMenu; $(MAKE) $(MFLAGS) clean)
(cd lwlib; $(MAKE) $(MFLAGS) clean)
(cd lib-src; $(MAKE) $(MFLAGS) clean)
- -(cd man && $(MAKE) $(MFLAGS) clean)
- -(cd lispref && $(MAKE) $(MFLAGS) clean)
- -(cd lispintro && $(MAKE) $(MFLAGS) clean)
+ -(cd doc/emacs && $(MAKE) $(MFLAGS) clean)
+ -(cd doc/misc && $(MAKE) $(MFLAGS) clean)
+ -(cd doc/lispref && $(MAKE) $(MFLAGS) clean)
+ -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean)
(cd leim; $(MAKE) $(MFLAGS) clean)
+
+.PHONY: check-declare
+
+check-declare:
+ @if [ ! -e $(srcdir)/src/emacs ]; then \
+ echo "You must build Emacs to use this command"; \
+ exit 1; \
+ fi
+ (cd leim; $(MAKE) $(MFLAGS) $@)
+ (cd lisp; $(MAKE) $(MFLAGS) $@)