-SUBDIR_MAKEFILES = lib-src/Makefile src/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.
-COPYDIR = etc ${srcdir}/info ${srcdir}/lisp
-COPYDESTS = ${etcdir} ${infodir} ${lispdir}
-
-all: src/paths.h ${SUBDIR}
-
-removenullpaths=sed -e 's/^://' -e 's/:$$//' -e 's/::/:/'
-
-# 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.
-# Note that sed is not in /bin on 386bsd.
-src/paths.h: Makefile ${srcdir}/src/paths.h.in FRC
- 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}";' \
- -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
- -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";'
- ${srcdir}/move-if-change src/paths.h.tmp src/paths.h
-
-src: lib-src
-
-.RECURSIVE: ${SUBDIR}
-
-${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
- cd $@; $(MAKE) all ${MFLAGS} \
- CC='${CC}' CFLAGS='${CFLAGS}' \
- srcdir='${srcdir}/$@' libdir='${libdir}'
-
-## 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
- echo "Producing \`lib-src/Makefile' from \`${srcdir}/lib-src/Makefile.in'."
- rm -f lib-src/Makefile.tmp
- (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." ; \
- /bin/sed < ${srcdir}/lib-src/Makefile.in \
- -e 's|^\(version *=\).*$$|\1'"${version}"'|' \
- -e 's|^\(configname *=\).*$$|\1'"${configname}"'|' \
- -e 's|^\(prefix *=\).*$$|\1'"${prefix}"'|' \
- -e 's|^\(exec_prefix *=\).*$$|\1'"${exec_prefix}"'|' \
- -e 's|^\(libdir *=\).*$$|\1'"${libdir}"'|' \
- -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
- -e 's|^\(archlibdir *=\).*$$|\1'"${archlibdir}"'|' \
- -e 's|^CC *=.*$$|CC='"${CC}"'|' \
- -e 's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
- -e 's|^LOADLIBES *=.*$$|LOADLIBES='"${libsrc_libs}"'|' \
- -e '/^# DIST: /d') > lib-src/Makefile.tmp
- ${srcdir}/move-if-change lib-src/Makefile.tmp lib-src/Makefile
- chmod -w lib-src/Makefile
-
-src/Makefile: ${srcdir}/src/Makefile.in Makefile
- echo "Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
- rm -f src/Makefile.tmp
- (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." ; \
- /bin/sed < ${srcdir}/src/Makefile.in \
- -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
- -e 's|^CC *=.*$$|CC='"${CC}"'|' \
- -e 's|^CONFIG_CFLAGS *=.*$$|CONFIG_CFLAGS='"${CONFIG_CFLAGS}"'|' \
- -e '/^# DIST: /d') > src/Makefile.tmp
- ${srcdir}/move-if-change src/Makefile.tmp src/Makefile
- chmod -w src/Makefile
-
-oldXMenu/Makefile: ${srcdir}/oldXMenu/Makefile Makefile
- echo "Producing \`src/Makefile' from \`${srcdir}/src/Makefile.in'."
- rm -f src/Makefile.tmp
- cp "${srcdir}"/oldXMenu/Makefile oldXMenu/Makefile
-
-
-Makefile:
+SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile lispref/Makefile 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.
+# leim's makefile also 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.
+COPYDIR = ${srcdir}/etc ${srcdir}/lisp
+COPYDESTS = ${etcdir} ${lispdir}
+
+all: ${SUBDIR} leim
+
+removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g'
+
+# Generate epaths.h from epaths.in. This target is invoked by `configure'.
+epaths-force: FRC
+ @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
+ buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
+ x_default_search_path=`echo ${x_default_search_path}`; \
+ gamedir=`echo ${gamedir}`; \
+ sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \
+ -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'"$${lisppath}"'";' \
+ -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'"$${buildlisppath}"'";' \
+ -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
+ -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
+ -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
+ -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
+ -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
+ -e 's;\(#.*PATH_GAME\).*$$;\1 "${gamedir}";' \
+ -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \
+ -e 's;/[*] *arch-tag:.*;/*;') && \
+ ${srcdir}/move-if-change epaths.h.$$$$ src/epaths.h
+
+# For parallel make, src should be build before leim.
+# "export PARALLEL=0" is for SGI's Make, to prevent it from
+# running more than 1 process in the leim directory, especially for
+# the $TIT files there.
+leim: src ${SUBDIR_MAKEFILES} FRC
+ (export PARALLEL; PARALLEL=0; cd $@; $(MAKE) all $(MFLAGS) \
+ CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
+ LDFLAGS='${LDFLAGS}' MAKE='${MAKE}')
+
+src: lib-src FRC
+
+lib-src: FRC src/config.stamp
+
+.RECURSIVE: ${SUBDIR} leim
+
+${SUBDIR}: maybe_bootstrap ${SUBDIR_MAKEFILES} FRC
+ cd $@; $(MAKE) all $(MFLAGS) \
+ CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
+ LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
+
+blessmail: ${SUBDIR_MAKEFILES} src FRC
+ cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \
+ MAKE='${MAKE}' archlibdir='$(archlibdir)'
+
+Makefile: $(srcdir)/Makefile.in config.status
+ ./config.status
+
+config.status: ${srcdir}/configure
+ ./config.status --recheck
+
+AUTOCONF_INPUTS = @MAINT@ $(srcdir)/configure.in $(srcdir)/m4/getopt.m4
+
+$(srcdir)/configure: $(AUTOCONF_INPUTS)
+ cd ${srcdir} && autoconf
+
+$(srcdir)/src/config.in: $(srcdir)/src/stamp-h.in
+ @true
+$(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS)
+ cd ${srcdir} && autoheader
+ rm -f $(srcdir)/src/stamp-h.in
+ echo timestamp > $(srcdir)/src/stamp-h.in
+
+src/Makefile: $(srcdir)/src/Makefile.in config.status
+ ./config.status
+
+src/config.stamp: $(srcdir)/src/config.in config.status
+ ./config.status
+ touch src/config.stamp
+
+lib-src/Makefile: $(srcdir)/lib-src/Makefile.in config.status
+ ./config.status
+
+man/Makefile: $(srcdir)/man/Makefile.in config.status
+ ./config.status
+
+lispref/Makefile: $(srcdir)/lispref/Makefile.in config.status
+ ./config.status
+
+lispintro/Makefile: $(srcdir)/lispintro/Makefile.in config.status
+ ./config.status
+
+oldXMenu/Makefile: $(srcdir)/oldXMenu/Makefile.in config.status
+ ./config.status
+
+lwlib/Makefile: $(srcdir)/lwlib/Makefile.in config.status
+ ./config.status
+
+leim/Makefile: $(srcdir)/leim/Makefile.in config.status