summaryrefslogtreecommitdiff
path: root/lib/am
diff options
context:
space:
mode:
Diffstat (limited to 'lib/am')
-rw-r--r--lib/am/clean.am7
-rw-r--r--lib/am/depend.am3
-rw-r--r--lib/am/header-vars.am7
-rw-r--r--lib/am/subdirs.am7
-rw-r--r--lib/am/tags.am3
-rw-r--r--lib/am/texinfos.am6
6 files changed, 27 insertions, 6 deletions
diff --git a/lib/am/clean.am b/lib/am/clean.am
index 2b5adbe6d..74e7765ca 100644
--- a/lib/am/clean.am
+++ b/lib/am/clean.am
@@ -1,3 +1,10 @@
+## We must test each macro because it might be empty, and an empty
+## "rm -rf" command looks disturbing.
+
+## Each "if" must always have an else because, in some versions of sh,
+## "if" will return false if the test fails and there is no else
+## clause. Bogus!
+
mostlyclean-generic:
if test -n "$(MOSTLYCLEANFILES)"; then \
rm -f $(MOSTLYCLEANFILES); \
diff --git a/lib/am/depend.am b/lib/am/depend.am
index 96e72b4e5..faf5e0d40 100644
--- a/lib/am/depend.am
+++ b/lib/am/depend.am
@@ -6,6 +6,9 @@ MKDEP = gcc -MM
DEP_FILES = $(patsubst %.o,.deps/%.P,$(OBJECTS))
+## We use ".P" as the name of our placeholder because it can't be
+## duplicated by any C source file. (Well, there could be ".c", but
+## no one does that in practice)
-include .deps/.P
.deps/.P:
test -d .deps || mkdir .deps
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index ba4c76746..6823e7f5d 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -12,7 +12,8 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
SHELL = /bin/sh
@@ -35,6 +36,10 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
+## Some derived variables that have been found to be useful.
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am
index 98a2274e6..e5356ab95 100644
--- a/lib/am/subdirs.am
+++ b/lib/am/subdirs.am
@@ -9,14 +9,17 @@
RECURSIVE = all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
-check-recursive info-recursive dvi-recursive mostlyclean-recursive \
-clean-recursive distclean-recursive maintainer-clean-recursive
+check-recursive installcheck-recursive info-recursive dvi-recursive \
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive
$(RECURSIVE):
for subdir in $(SUBDIRS); do \
target=`echo $@ | sed s/-recursive//`; \
echo making $$target in $$subdir; \
(cd $$subdir; $(MAKE) $$target) \
+## This trick allows "-k" to keep its natural meaning when running a
+## recursive rule.
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
diff --git a/lib/am/tags.am b/lib/am/tags.am
index 6709f3510..e294d53d6 100644
--- a/lib/am/tags.am
+++ b/lib/am/tags.am
@@ -4,6 +4,7 @@ TAGS:
tags=; \
here=`pwd`; \
for subdir in $(SUBDIRS); do \
+## Never fail here if a subdir fails.
(cd $$subdir && $(MAKE) TAGS); \
if test -f $$subdir/TAGS; then \
tags="$$tags -i $$here/$$subdir/TAGS"; \
@@ -11,6 +12,8 @@ TAGS:
true; \
fi; \
done; \
+## Make sure we have something to run etags on. See clean.am to
+## understand "if...else" braindamage.
if test -n "$(ETAGS_ARGS)$(CONFIG_HEADER)$(SOURCES)$(HEADERS)$$tags"; \
then \
etags $(ETAGS_ARGS) $$tags $(CONFIG_HEADER) $(SOURCES) $(HEADERS); \
diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am
index 538e4037f..1874d546b 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.am
@@ -4,9 +4,9 @@
.texi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
-# Look in both . and srcdir because the info pages might have been
-# rebuilt in the build directory. Can't cd to srcdir; that might
-# break a possible install-sh reference.
+## Look in both . and srcdir because the info pages might have been
+## rebuilt in the build directory. Can't cd to srcdir; that might
+## break a possible install-sh reference.
install-info: $(INFO_DEPS)
$(top_srcdir)/mkinstalldirs $(infodir)
for file in $(INFO_DEPS); do \