summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>1995-12-03 06:12:34 +0000
committerTom Tromey <tromey@redhat.com>1995-12-03 06:12:34 +0000
commitd090b70bff33abc9e417eeb00be168bcb37fe77b (patch)
treee3637b85df02ec64a4f01de69e89d8b889210cbb
parentca0dd75950f4dc5a33d036b5ef62366cf1247a18 (diff)
downloadautomake-d090b70bff33abc9e417eeb00be168bcb37fe77b.tar.gz
Handle installcheck.
Handle ## comments. Fixlets
-rw-r--r--ChangeLog19
-rw-r--r--Makefile.in17
-rw-r--r--README28
-rw-r--r--TODO3
-rwxr-xr-xautomake.in27
-rw-r--r--clean.am7
-rw-r--r--depend.am3
-rw-r--r--dist-subd-top.am9
-rw-r--r--dist-subd.am1
-rw-r--r--dist.am1
-rw-r--r--distname.am3
-rw-r--r--header-vars.am7
-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
-rw-r--r--subdirs.am7
-rw-r--r--tags.am3
-rw-r--r--texi-version.am4
-rw-r--r--texinfos.am6
22 files changed, 126 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index b8b60d649..c311c8ad4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+Sat Dec 2 21:39:56 1995 Tom Tromey <tromey@cambric.colorado.edu>
+
+ * automake.in: Updated FSF address. From Jim Meyering.
+ * header-vars.am: Updated FSF address.
+
+ * distname.am: Removed.
+
+ * automake.in (file_contents): Strip "##" comments.
+ * Various files: Added "##" comments for strange things.
+
+ * automake.in (handle_tags): Generate TAGS rule for every
+ directory.
+
+ * subdirs.am (RECURSIVE): Include installcheck-recursive.
+ * automake.in (installcheck): New variable.
+ (generate_makefile): Initialize it.
+ (handle_subdirs): Push 'installcheck-recursive'.
+ (handle_merge_targets): Handle installcheck target.
+
Thu Nov 30 20:13:16 1995 Tom Tromey <tromey@cambric>
* automake.in ($PACKAGE): Removed.
diff --git a/Makefile.in b/Makefile.in
index c7e8ecacd..c0d24cf72 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -13,7 +13,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
@@ -71,7 +72,7 @@ INFO_DEPS = automake.info
DVIS = automake.dvi
ACLOCAL = aclocal.m4
-DIST_COMMON = Makefile.in Makefile.am version.texi stamp-vti mdate-sh texinfo.tex aclocal.m4 install-sh mkinstalldirs THANKS TODO README NEWS INSTALL ABOUT-NLS configure configure.in
+DIST_COMMON = Makefile.in Makefile.am version.texi stamp-vti mdate-sh texinfo.tex aclocal.m4 install-sh mkinstalldirs THANKS TODO README NEWS INSTALL ChangeLog configure configure.in
PACKAGE = @PACKAGE@
VERSION = @VERSION@
@@ -103,8 +104,6 @@ maintainer-clean-scripts:
version.texi: stamp-vti
-# Depend on configure.in so that version number updates cause a
-# rebuild.
stamp-vti: automake.texi $(top_srcdir)/configure.in
echo "@set UPDATED `cd $(srcdir) && $(SHELL) mdate-sh automake.texi`" \
> version.tmp
@@ -135,9 +134,6 @@ automake.info: automake.texi version.texi
.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.
install-info: $(INFO_DEPS)
$(top_srcdir)/mkinstalldirs $(infodir)
for file in $(INFO_DEPS); do \
@@ -196,6 +192,9 @@ config.status: configure
${srcdir}/configure: configure.in ${ACLOCAL}
cd $(srcdir); autoconf
+tags: TAGS
+TAGS:
+
distdir = $(PACKAGE)-$(VERSION)
dist: $(DIST_FILES)
rm -rf $(distdir)
@@ -227,6 +226,8 @@ dvi: $(DVIS)
check:
+installcheck:
+
install-exec: install-scripts
install-data: install-info install-pdata
@@ -238,6 +239,8 @@ uninstall: uninstall-scripts uninstall-info uninstall-pdata
installdirs:
$(top_srcdir)/mkinstalldirs $(bindir) $(infodir) $(datadir)/$(PACKAGE)
+
+
mostlyclean-generic:
if test -n "$(MOSTLYCLEANFILES)"; then \
rm -f $(MOSTLYCLEANFILES); \
diff --git a/README b/README
index b99935a18..83d0fdc14 100644
--- a/README
+++ b/README
@@ -1,28 +1,16 @@
-This is AutoMake, an experimental Makefile generator. It was inspired
+This is Automake, an experimental Makefile generator. It was inspired
by the 4.4BSD make and include files, but aims to be portable and to
conform to the GNU standards for Makefile variables and targets.
-automake is a shell script. The input files are called Makefile.am.
+Automake is a Perl script. The input files are called Makefile.am.
The output files are called Makefile.in; they are intended for use
-with Autoconf.
+with Autoconf. Automake requires certain things to be done in your
+configure.in.
Variable assignment lines in Makefile.am pull in defaults from various
little *.am files.
-To use AutoMake, replace your Makefile.in files with Makefile.am
-files. Since there's no documentation, look at the automake script
-and the examples provided for GNU m4 1.3 and fileutils 3.9 (along with
-patches you need to apply to those packages) and time 1.6 and find and
-indent (unreleased versions).
-
-AutoMake is just a prototype at this point -- expect omissions and bugs.
-It uses only the programs that the GNU coding standards allow in
-configure scripts, because I wrote it keeping in mind the possibility
-of it becoming an Autoconf macro, so it would run at configure-time.
-That would slow configuration down a bit, but allow users to modify
-the Makefile.am without needing to fetch the AutoMake package. And,
-the Makefile.in files wouldn't need to be distributed. But all of
-AutoMake would. So I might reimplement AutoMake in Perl, m4, or some
-other more appropriate language.
-
-- David MacKenzie <djm@gnu.ai.mit.edu>
+To use Automake, replace your Makefile.in files with Makefile.am
+files. Read the documentation to see what to do. The only currently
+valid example is in samples/cpio; the stuff in samples/old is
+obsolete.
diff --git a/TODO b/TODO
index cd42bdc26..912a9db1f 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,5 @@
Top priorities:
-* Implement new where_HOW scheme.
-* Handle installcheck target
+* Implement new `where_HOW' scheme.
* Handle installable libraries and headers
Some known problems:
diff --git a/automake.in b/automake.in
index 353f58cf4..4ffdb1408 100755
--- a/automake.in
+++ b/automake.in
@@ -20,7 +20,8 @@ eval "exec /usr/local/bin/perl -S $0 $*"
# 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.
# Originally written by David Mackenzie <djm@gnu.ai.mit.edu>.
# Perl reimplementation by Tom Tromey <tromey@drip.colorado.edu>.
@@ -74,6 +75,7 @@ $output_directory = '.';
@dvi = ();
@all = ();
@check = ();
+@installcheck = ();
@clean = ();
# TRUE if current directory holds any C source files.
@@ -233,6 +235,7 @@ sub generate_makefile
@dvi = ();
@all = ();
@check = ();
+ @installcheck = ();
@clean = ();
# Generate header before reading .am file. The header must come
@@ -665,6 +668,13 @@ sub handle_tags
$output_rules .= &file_contents ('tags-clean');
push (@clean, 'tags');
}
+ else
+ {
+ # Every Makefile must define some sort of TAGS rule.
+ # Otherwise, it would be possible for a top-level "make TAGS"
+ # to fail because some subdirectory failed.
+ $output_rules .= "tags: TAGS\nTAGS:\n\n";
+ }
}
# Handle 'dist' target.
@@ -745,6 +755,7 @@ sub handle_subdirs
push (@all, "all-recursive");
push (@check, "check-recursive");
+ push (@installcheck, "installcheck-recursive");
push (@info, "info-recursive");
push (@dvi, "dvi-recursive");
@@ -855,6 +866,7 @@ sub handle_merge_targets
&do_one_merge_target ('info', @info);
&do_one_merge_target ('dvi', @dvi);
&do_one_merge_target ('check', @check);
+ &do_one_merge_target ('installcheck', @installcheck);
# Handle the various install targets specially. We do this so
# that (eg) "make install-exec" will run "install-exec-recursive"
@@ -1179,12 +1191,15 @@ sub file_contents
exit 1;
}
- # Yes, we really want to slurp it.
- local ($results) = join ('', <FC_FILE>);
-
+ # Lines starting with "##" are comments for developer use only.
+ # Maybe this is a bad idea?
+ local ($result) = '';
+ while (<FC_FILE>)
+ {
+ $result .= $_ unless ( m/^##/);
+ }
close (FC_FILE);
-
- return $results;
+ return $result;
}
# Return contents of some Makefile.am variable. Allow for AM_ style
diff --git a/clean.am b/clean.am
index 2b5adbe6d..74e7765ca 100644
--- a/clean.am
+++ b/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/depend.am b/depend.am
index 96e72b4e5..faf5e0d40 100644
--- a/depend.am
+++ b/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/dist-subd-top.am b/dist-subd-top.am
index 84e37bd95..b7dfbf215 100644
--- a/dist-subd-top.am
+++ b/dist-subd-top.am
@@ -4,6 +4,12 @@ dist: $(DIST_FILES)
mkdir $(distdir)
(cd $(srcdir); automake --include-deps --output-dir=$(distdir))
@for file in $(DIST_FILES); do \
+## Test for file existence because sometimes a file gets included in
+## DIST_FILES twice. For example this happens when a single source
+## file is used in building more than one program. Also, there are
+## situations in which "ln" can fail. For instance a file to
+## distribute could actually be a cross-filesystem symlink -- this can
+## easily happen if "gettextize" was run on the distribution.
test -f $(distdir)/$$file || { \
echo linking $$file; \
ln $(srcdir)/$$file $(distdir)/$$file; \
@@ -13,12 +19,15 @@ dist: $(DIST_FILES)
}; \
done
for subdir in $(SUBDIRS); do \
+## Test for directory existence here because previous automake
+## invocation might have created some directories.
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir; $(MAKE) $@) || exit 1; \
done
+## Set "sublist" here because shells fail on "for dir in ; do".
@sublist="$(DIST_SUBDIRS)"; \
for dir in $$sublist; do \
echo copying directory $$dir; \
diff --git a/dist-subd.am b/dist-subd.am
index 65d564a1f..449767656 100644
--- a/dist-subd.am
+++ b/dist-subd.am
@@ -1,6 +1,7 @@
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
dist: $(DIST_FILES)
@for file in $(DIST_FILES); do \
+## See dist-subd-top.am to understand this.
test -f $(distdir)/$$file || { \
echo linking $$file; \
ln $(srcdir)/$$file $(distdir)/$$file; \
diff --git a/dist.am b/dist.am
index f8d5f52b4..a397e2609 100644
--- a/dist.am
+++ b/dist.am
@@ -1,3 +1,4 @@
+## See dist-subd-top.am to understand this file.
distdir = $(PACKAGE)-$(VERSION)
dist: $(DIST_FILES)
rm -rf $(distdir)
diff --git a/distname.am b/distname.am
deleted file mode 100644
index bf20f303a..000000000
--- a/distname.am
+++ /dev/null
@@ -1,3 +0,0 @@
-distname:
- (cd $(srcdir); pwd) | sed 's%.*/%%; s%$$%$(VERSION)%' > $@
-
diff --git a/header-vars.am b/header-vars.am
index ba4c76746..6823e7f5d 100644
--- a/header-vars.am
+++ b/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/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 \
diff --git a/subdirs.am b/subdirs.am
index 98a2274e6..e5356ab95 100644
--- a/subdirs.am
+++ b/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/tags.am b/tags.am
index 6709f3510..e294d53d6 100644
--- a/tags.am
+++ b/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/texi-version.am b/texi-version.am
index bd59f0a84..62b5d44d7 100644
--- a/texi-version.am
+++ b/texi-version.am
@@ -1,7 +1,7 @@
version.texi: stamp-vti
-# Depend on configure.in so that version number updates cause a
-# rebuild.
+## Depend on configure.in so that version number updates cause a
+## rebuild.
stamp-vti: @TEXI@ $(top_srcdir)/configure.in
echo "@set UPDATED `cd $(srcdir) && $(SHELL) mdate-sh @TEXI@`" \
> version.tmp
diff --git a/texinfos.am b/texinfos.am
index 538e4037f..1874d546b 100644
--- a/texinfos.am
+++ b/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 \