+Thu Jan 4 21:21:29 1996 Tom Tromey <tromey@cambric.colorado.edu>
+
+ * Makefile.am (pkgdata_DATA): Removed old dist files.
+
+ * dist-subd-top.am, dist-subd.am, dist.am: Removed.
+
+ * automake.in (set_strictness): Set $strictness_name.
+ (strictness_name): New variable.
+ (handle_dist): Substantially rewrote.
+
+ * configure.in: Point AC_INIT at automake.in.
+
+ * automake.in (generate_makefile): Report errors against
+ Makefile.in, not Makefile.am.
+
Wed Jan 3 00:05:40 1996 Tom Tromey <tromey@cambric.colorado.edu>
* mdate-sh: Bug fix from Jim Meyering.
# CONFIG_HEADER = config.h
pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
-compile.am data.am depend.am dist-subd-top.am \
-dist-subd.am dist-vars.am dist.am footer.am header-vars.am \
+compile.am data.am depend.am \
+dist-vars.am footer.am header-vars.am \
kr-vars.am libraries-vars.am \
libraries.am library.am mans-vars.am \
program.am programs.am remake-hdr.am \
# CONFIG_HEADER = config.h
pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
-compile.am data.am depend.am dist-subd-top.am \
-dist-subd.am dist-vars.am dist.am footer.am header-vars.am \
+compile.am data.am depend.am \
+dist-vars.am footer.am header-vars.am \
kr-vars.am libraries-vars.am \
libraries.am library.am mans-vars.am \
program.am programs.am remake-hdr.am \
rm -f TAGS ID
maintainer-clean-tags:
-
distdir = $(PACKAGE)-$(VERSION)
dist: $(DISTFILES)
rm -rf $(distdir)
mkdir $(distdir)
- (cd $(srcdir) && automake --include-deps --output-dir=$(distdir))
+ distdir=`cd $(distdir) && pwd` \
+ && cd $(srcdir) \
+ && automake --include-deps --output-dir=$$distdir --strictness=normal
@for file in $(DISTFILES); do \
test -f $(distdir)/$$file \
|| ln $(srcdir)/$$file $(distdir)/$$file \
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
done
- @sublist="$(DIST_SUBDIRS)"; \
- for dir in $$sublist; do \
+ for subdir in $(SUBDIRS); do \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $@) || exit 1; \
+ done
+ @for dir in $(DIST_SUBDIRS); do \
echo copying directory $$dir; \
- tar -chof - $$dir | (cd $(distdir) && tar -xBpf -); \
+ tar -chf - $$dir | (cd $(distdir) && tar -xBpf -); \
done
chmod -R a+r $(distdir)
tar -chozf $(distdir).tar.gz $(distdir)
uninstall and pkg-dirs should rm -rf the dir.
-Merge dist*.am files into automake itself; replication is bad. In
-general most .am files should be merged into automake. For instance
-all the "clean" targets could be merged by keeping lists of things to
-be removed. This would be a lot nicer looking. Note that the install
-targets probably should not be merged; it is sometimes useful to only
-install a small part.
+In general most .am files should be merged into automake. For
+instance all the "clean" targets could be merged by keeping lists of
+things to be removed. This would be a lot nicer looking. Note that
+the install targets probably should not be merged; it is sometimes
+useful to only install a small part.
Clean up the output:
* Order rules sensibly
* "cd $(foo); something" is an error in a rule. Should be:
"cd $(foo) && something"
* check for version number in NEWS file.
-If --gnits or --gnu specified, then it should be specified in the
-"dist" target as well.
Maybe it should be possible to disable all GNU-specific things with
--no-gnu? --ignore-standards? But what? And why?
# Strictness level.
$strictness = $NORMAL;
+# Name of strictness level.
+$strictness_name = 'normal';
+
# This is TRUE if GNU make specific automatic dependency generation
# code should be included in generated Makefile.in.
$use_dependencies = 1;
}
if (! open (GM_FILE, "> " . $output_directory . '/' . $makefile . ".in"))
{
- &am_error ("cannot open:", $!);
+ warn "automake: ${am_file}.in: cannot open: $!\n";
+ $exit_status = 1;
return;
}
# Some boilerplate.
$output_vars .= &file_contents ('dist-vars');
- if ($relative_dir ne '.')
+
+ # Initialization; only at top level.
+ if ($relative_dir eq '.')
{
- # In a subdirectory.
- $output_vars .= "subdir = " . $relative_dir . "\n\n";
- $output_rules .= &file_contents ('dist-subd');
+ $output_rules .=
+ (
+ # Some boilerplate.
+ '
+distdir = $(PACKAGE)-$(VERSION)
+dist: $(DISTFILES)
+'
+ # Create dist directory.
+ . ' rm -rf $(distdir)
+ mkdir $(distdir)
+'
+ # We need an absolute path for --output-dir. Thus the
+ # weirdness.
+ . ' distdir=`cd $(distdir) && pwd` \\
+ && cd $(srcdir) \\
+ && automake --include-deps --output-dir=$$distdir --strictness='
+ # Set strictness of output.
+ . $strictness_name . "\n"
+ );
}
else
{
- $output_rules .= &file_contents (defined $contents{'SUBDIRS'}
- ? 'dist-subd-top'
- : 'dist');
+ $output_rules .=
+ (
+ # Some boilerplate.
+ "\nsubdir = " . $relative_dir . "\n"
+ . 'distdir = $(PACKAGE)-$(VERSION)/$(subdir)
+dist: $(DISTFILES)
+'
+ );
+ }
+
+ # In loop, test for file existence because sometimes a file gets
+ # included in DISTFILES 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.
+ $output_rules .= ' @for file in $(DISTFILES); do \\
+ test -f $(distdir)/$$file \\
+ || ln $(srcdir)/$$file $(distdir)/$$file \\
+ || cp -p $(srcdir)/$$file $(distdir)/$$file; \\
+ done
+';
+
+ # If top level, create all dist subdirectories and do recursive
+ # build.
+ if ($relative_dir eq '.')
+ {
+ # Test for directory existence here because previous automake
+ # invocation might have created some directories.
+ $output_rules .= ' for subdir in $(SUBDIRS); do \\
+ test -d $(distdir)/$$subdir \\
+ || mkdir $(distdir)/$$subdir \\
+ || exit 1; \\
+ chmod 777 $(distdir)/$$subdir; \\
+ (cd $$subdir && $(MAKE) $@) || exit 1; \\
+ done
+';
}
+
+ # Make verbatim copies of some subdirectories if required. This
+ # is a hack which might go away.
+ if (defined $contents{'DIST_SUBDIRS'})
+ {
+ $output_rules .= ' @for dir in $(DIST_SUBDIRS); do \\
+ echo copying directory $$dir; \\
+ tar -chf - $$dir | (cd $(distdir) && tar -xBpf -); \\
+ done
+';
+ }
+
+ # Finalize.
+ if ($relative_dir eq '.')
+ {
+ $output_rules .= ' chmod -R a+r $(distdir)
+ tar -chozf $(distdir).tar.gz $(distdir)
+ rm -rf $(distdir)
+';
+ }
+
push (@phony, 'dist');
}
# Set strictness.
sub set_strictness
{
- local ($name) = @_;
-
- if ($name eq 'gnu')
+ $strictness_name = @_;
+ if ($strictness_name eq 'gnu')
{
$strictness = $GNU;
}
- elsif ($name eq 'gnits')
+ elsif ($strictness_name eq 'gnits')
{
$strictness = $GNITS;
}
- elsif ($name eq 'normal')
+ elsif ($strictness_name eq 'normal')
{
$strictness = $NORMAL;
}
else
{
- die "automake: level \`$name' not recognized\n";
+ die "automake: level \`$strictness_name' not recognized\n";
}
}
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=dist.am
+ac_unique_file=automake.in
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(dist.am)
+AC_INIT(automake.in)
dnl we use this for gettext
dnl AC_CONFIG_HEADER(config.h)
+++ /dev/null
-distdir = $(PACKAGE)-$(VERSION)
-dist: $(DISTFILES)
- rm -rf $(distdir)
- mkdir $(distdir)
-## We need an absolute path for --output-dir. Get that here.
- distdir=`cd $(distdir) && pwd` \
- && cd $(srcdir) \
- && automake --include-deps --output-dir=$$distdir
- @for file in $(DISTFILES); do \
-## Test for file existence because sometimes a file gets included in
-## DISTFILES 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 \
- || ln $(srcdir)/$$file $(distdir)/$$file \
- || cp -p $(srcdir)/$$file $(distdir)/$$file; \
- 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; \
- tar -chf - $$dir | (cd $(distdir) && tar -xBpf -); \
- done
- chmod -R a+r $(distdir)
- tar -chozf $(distdir).tar.gz $(distdir)
- rm -rf $(distdir)
+++ /dev/null
-distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
-dist: $(DISTFILES)
- @for file in $(DISTFILES); do \
-## See dist-subd-top.am to understand this.
- test -f $(distdir)/$$file \
- || ln $(srcdir)/$$file $(distdir)/$$file \
- || cp -p $(srcdir)/$$file $(distdir)/$$file; \
- done
+++ /dev/null
-## See dist-subd-top.am to understand this file.
-distdir = $(PACKAGE)-$(VERSION)
-dist: $(DISTFILES)
- rm -rf $(distdir)
- mkdir $(distdir)
- distdir=`cd $(distdir) && pwd` \
- && cd $(srcdir) \
- && automake --include-deps --output-dir=$$distdir
- @for file in $(DISTFILES); do \
- test -f $(distdir)/$$file \
- || ln $(srcdir)/$$file $(distdir)/$$file \
- || cp -p $(srcdir)/$$file $(distdir)/$$file; \
- done
- @sublist="$(DIST_SUBDIRS)"; \
- for dir in $$sublist; do \
- echo copying directory $$dir; \
- tar -chof - $$dir | (cd $(distdir) && tar -xBpf -); \
- done
- chmod -R a+r $(distdir)
- tar -chozf $(distdir).tar.gz $(distdir)
- rm -rf $(distdir)
# CONFIG_HEADER = config.h
pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
-compile.am data.am depend.am dist-subd-top.am \
-dist-subd.am dist-vars.am dist.am footer.am header-vars.am \
+compile.am data.am depend.am \
+dist-vars.am footer.am header-vars.am \
kr-vars.am libraries-vars.am \
libraries.am library.am mans-vars.am \
program.am programs.am remake-hdr.am \