Correct buggy dispatch logic.
[bpt/emacs.git] / Makefile.in
index 045a1e2..8307c9d 100644 (file)
@@ -84,6 +84,7 @@ CPPFLAGS=@CPPFLAGS@
 C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
 LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@
 EXEEXT=@EXEEXT@
+MAKEINFO=@MAKEINFO@
 
 ### These help us choose version- and architecture-specific directories
 ### to install files in.
@@ -177,6 +178,9 @@ 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
@@ -259,8 +263,8 @@ EMACSFULL = `echo emacs-${version}${EXEEXT} | sed '$(TRANSFORM)'`
 # leim is not included because it needs special handling.
 SUBDIR = lib-src src
 
-# The makefiles of the directories in $SUBDIR.
-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
+# The subdir makefiles created by config.status.
+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 lisp/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.
@@ -367,6 +371,9 @@ lwlib/Makefile: $(srcdir)/lwlib/Makefile.in config.status
 leim/Makefile: $(srcdir)/leim/Makefile.in config.status
        ./config.status
 
+lisp/Makefile: $(srcdir)/lisp/Makefile.in config.status
+       ./config.status
+
 # ==================== Installation ====================
 
 ## If we let lib-src do its own installation, that means we
@@ -414,6 +421,13 @@ install-arch-dep: mkdir
                        && 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
@@ -431,11 +445,6 @@ install-arch-dep: mkdir
 ## Note that the Makefiles in the etc directory are potentially useful
 ## in an installed Emacs, so should not be excluded.
 
-## installuser:
-## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html
-## Nuisance because i) it needs to be the user running install, so
-## configure can't set it; ii) can't (?) use the result of rule
-## commands to set make variables.
 install-arch-indep: mkdir info install-etc
        -set ${COPYDESTS} ; \
        unset CDPATH; \
@@ -449,10 +458,7 @@ install-arch-indep: mkdir info install-etc
        mkdir ${COPYDESTS} ; \
        chmod ugo+rx ${COPYDESTS} ; \
        unset CDPATH; \
-       for installuser in $${LOGNAME} $${USERNAME} $${USER} \
-         `id -un 2> /dev/null`; do \
-         [ -n "$${installuser}" ] && break ; \
-       done ; \
+       $(set_installuser); \
        for dir in ${COPYDIR} ; do \
          dest=$$1 ; shift ; \
          [ -d $${dir} ] \
@@ -510,10 +516,7 @@ install-arch-indep: mkdir info install-etc
           (cd ./etc; tar -chf - $${docfile}) \
             |(cd $(DESTDIR)${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
           (cd $(DESTDIR)$(docdir); \
-           for installuser in $${LOGNAME} $${USERNAME} $${USER} \
-             `id -un 2> /dev/null`; do \
-              [ -n "$${installuser}" ] && break ; \
-           done ; \
+           $(set_installuser); \
            chown $${installuser} DOC*; chmod a+r DOC*; \
            if test "`echo DOC-*`" != "DOC-*"; then rm -f DOC; fi); \
        else true; fi
@@ -527,10 +530,7 @@ install-arch-indep: mkdir info install-etc
           (cd lisp; tar -chf - *.el *.elc) \
             |(cd $(DESTDIR)${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
           (cd $(DESTDIR)${lispdir}; \
-           for installuser in $${LOGNAME} $${USERNAME} $${USER} \
-             `id -un 2> /dev/null`; do \
-              [ -n "$${installuser}" ] && break ; \
-           done ; \
+           $(set_installuser); \
            find . -exec chown $${installuser} {} ';') ; \
        else true; fi
        -unset CDPATH; \
@@ -554,6 +554,7 @@ install-arch-indep: mkdir info install-etc
           fi; \
           cd ${srcdir}/info ; \
           for elt in $(INFO_FILES); do \
+             test "$(MAKEINFO)" = "no" && ! test -e $$elt && continue; \
              for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
                ${INSTALL_DATA} $$f $(DESTDIR)${infodir}/$$f; \
                chmod a+r $(DESTDIR)${infodir}/$$f; \
@@ -565,6 +566,7 @@ install-arch-indep: mkdir info install-etc
        if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd $(DESTDIR)${infodir} && /bin/pwd)` ]; \
        then \
          for elt in $(INFO_FILES); do \
+           test "$(MAKEINFO)" = "no" && ! test -e $$elt && continue; \
            (cd $${thisdir}; \
             ${INSTALL_INFO} --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \
          done; \
@@ -582,7 +584,8 @@ install-arch-indep: mkdir info install-etc
 install-etc: mkdir
        ${INSTALL_DATA} ${srcdir}/etc/emacs.desktop \
          $(DESTDIR)${desktopdir}/emacs.desktop
-       for icon in $(srcdir)/etc/images/icons/*/*x*/apps/*.*; do \
+       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} ; \
@@ -610,7 +613,7 @@ mkdir: FRC
          chmod a+r $(DESTDIR)${datadir};\
        fi
        icondirs= ; \
-       for dir in $(srcdir)/etc/images/icons/*/*x*/apps; do \
+       for dir in $(iconsrcdir)/*/*/apps $(iconsrcdir)/*/*/mimetypes; do \
          if [ -d $${dir} ]; then \
            icondirs="$${icondirs} $${dir}" ; \
          fi ; \
@@ -770,15 +773,41 @@ dist:
        cd ${srcdir}; ./make-dist
 
 .PHONY: info dvi dist check html
+
+info-real: 
+       -(cd doc/emacs; $(MAKE) $(MFLAGS) info)
+       -(cd doc/misc; $(MAKE) $(MFLAGS) info)
+       -(cd doc/lispref; $(MAKE) $(MFLAGS) info)
+       -(cd doc/lispintro; $(MAKE) $(MFLAGS) info)
+
 force-info:
 # Note that man/Makefile knows how to
 # put the info files in $(srcdir),
 # so we can do ok running make in the build dir.
 info: force-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)
+       @if test "$(MAKEINFO)" = "no"; then \
+         echo "Configured without makeinfo, not building manuals" ; \
+       else \
+         $(MAKE) $(MFLAGS) info-real ; \
+       fi
+
+# 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 doc/emacs; $(MAKE) $(MFLAGS) dvi)
        (cd doc/misc; $(MAKE) $(MFLAGS) dvi)