]> sourceware.org Git - automake.git/commitdiff
Merged dist targets into automake proper
authorTom Tromey <tromey@redhat.com>
Fri, 5 Jan 1996 06:33:33 +0000 (06:33 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 5 Jan 1996 06:33:33 +0000 (06:33 +0000)
ChangeLog
Makefile.am
Makefile.in
TODO
automake.in
configure
configure.in
dist-subd-top.am [deleted file]
dist-subd.am [deleted file]
dist.am [deleted file]
lib/am/Makefile.am

index ddf789bcc7d22c44c3490d1184c32ffcc82ee1ad..56f7d6bc0561ac1f9fa21b1b752388d1a7f695e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+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.
index c78298a3a57f3a8cbef611432ca31b00325e4612..fe05d1c8e8583972132669f38575831020f488ca 100644 (file)
@@ -4,8 +4,8 @@ TEXINFOS = automake.texi
 # 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 \
index 15a27cfb36d99f266e944c3ee336f38c54a5fd90..004c05f4b42958eeee54b0ebdcc34aa71182af0b 100644 (file)
@@ -42,8 +42,8 @@ TEXINFOS = automake.texi
 # 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 \
@@ -206,21 +206,28 @@ distclean-tags:
        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)
diff --git a/TODO b/TODO
index 95429ff653e1d8011eaa30c80237730904563f95..2fd4eb0f48ec88d8f28c16e1760317a82226d0ee 100644 (file)
--- a/TODO
+++ b/TODO
@@ -13,12 +13,11 @@ Top priorities:
 
 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
@@ -74,8 +73,6 @@ Some things for --strictness=gnits:
 * "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?
index 72bafe587c76606ad2e345e8d87aa78646691e17..c33e691d1c95999cd42888c570848edcc2ef2586 100755 (executable)
@@ -52,6 +52,9 @@ $GNITS = 2;
 # 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;
@@ -258,7 +261,8 @@ sub generate_makefile
     }
     if (! open (GM_FILE, "> " . $output_directory . '/' . $makefile . ".in"))
     {
-       &am_error ("cannot open:", $!);
+       warn "automake: ${am_file}.in: cannot open: $!\n";
+       $exit_status = 1;
        return;
     }
 
@@ -668,18 +672,92 @@ sub handle_dist
 
     # 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');
 }
 
@@ -1674,23 +1752,22 @@ sub push_phony_cleaners
 # 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";
     }
 }
 
index 89d394bcc5a30b33042affaeebade269180b25df..c4b742040c7607a7d75e37dd289be1ea1c2c1be4 100755 (executable)
--- a/configure
+++ b/configure
@@ -445,7 +445,7 @@ echo > confdefs.h
 
 # 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
index 7721500397d782c9df75e38abfd4e466e62bd56c..f5a0dd21bd5d752e8da2b59ea8deb9f11315e13a 100644 (file)
@@ -1,5 +1,5 @@
 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)
 
diff --git a/dist-subd-top.am b/dist-subd-top.am
deleted file mode 100644 (file)
index 85b135b..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-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)
diff --git a/dist-subd.am b/dist-subd.am
deleted file mode 100644 (file)
index 1ea36ae..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-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
diff --git a/dist.am b/dist.am
deleted file mode 100644 (file)
index 574c2bc..0000000
--- a/dist.am
+++ /dev/null
@@ -1,21 +0,0 @@
-## 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)
index c78298a3a57f3a8cbef611432ca31b00325e4612..fe05d1c8e8583972132669f38575831020f488ca 100644 (file)
@@ -4,8 +4,8 @@ TEXINFOS = automake.texi
 # 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 \
This page took 0.045461 seconds and 5 git commands to generate.