]> sourceware.org Git - automake.git/commitdiff
For PR automake/160:
authorTom Tromey <tromey@redhat.com>
Sun, 6 May 2001 20:15:41 +0000 (20:15 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 6 May 2001 20:15:41 +0000 (20:15 +0000)
* tests/Makefile.am (TESTS): Added subobj5.test and subobj6.test.
(XFAIL_TESTS): Added subobj6.test.
* tests/subobj6.test: New file.

ChangeLog
automake.texi
stamp-vti
tests/Makefile.am
tests/Makefile.in
tests/subobj6.test [new file with mode: 0755]
version.texi

index cd798b5995d95da79a69eb89e66f3946ee8dfb26..c8c1c664168cce0972b742a19fe1d6a7fe923241 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2001-05-06  Tom Tromey  <tromey@redhat.com>
 
+       For PR automake/160:
+       * tests/Makefile.am (TESTS): Added subobj5.test and subobj6.test.
+       (XFAIL_TESTS): Added subobj6.test.
+       * tests/subobj6.test: New file.
+
+       * automake.texi (Uniform): Mention dist_, nodist_, and nobase_.
+       (Top level): Don't mention `flat'.
+       (Extending): Likewise.
+       (User Variables): New node.
+
        * distdir.am (distdir): Make subdirectory for each file.
        Fixes test subobj5.test.
 
index 825e97c2ae8c291c0c2fd2c31e97b54e679c7fbc..d81b7011a15581e8627faf402385478decec4c58 100644 (file)
@@ -198,6 +198,7 @@ understand how Automake works.
 * Strictness::                  Standards conformance checking
 * Uniform::                     The Uniform Naming Scheme
 * Canonicalization::            How derived variables are named
+* User Variables::             Variables reserved for the user
 @end menu
 
 
@@ -456,8 +457,13 @@ Possible primary names are @samp{PROGRAMS}, @samp{LIBRARIES},
 @vindex MANS
 @vindex TEXINFOS
 
+Some primaries also allow additional prefixes which control other
+aspects of @code{automake}'s behavior.  The currently defined prefixes
+are @samp{dist_}, @samp{nodist_}, and @samp{nobase_}.  These prefixes
+are explained later.
 
-@node Canonicalization,  , Uniform, Generalities
+
+@node Canonicalization, User Variables, Uniform, Generalities
 @section How derived variables are named
 
 @cindex canonicalizing Automake macros
@@ -471,6 +477,36 @@ when making macro references.  For example, if your program is named
 @code{sniff-glue}, the derived variable name would be
 @code{sniff_glue_SOURCES}, not @code{sniff-glue_SOURCES}.
 
+
+@node User Variables, , Canonicalization, Generalities
+@section Variables reserved for the user
+
+@cindex variables, reserved for the user
+@cindex user variables
+
+Some @code{Makefile} variables are reserved by the GNU Coding Standards
+for the use of the ``user'' -- the person building the package.  For
+instance, @code{CFLAGS} is one such variable.
+
+Sometimes package developers are tempted to set user variables such as
+@code{CFLAGS} because it appears to make their job easier -- they don't
+have to introduce a second variable into every target.
+
+However, the package itself should never set a user variable,
+particularly not to include switches which are required for proper
+compilation of the package.  Since these variables are documented as
+being for the package builder, that person rightfully expects to be able
+to override any of these variables at build time.
+
+To get around this problem, automake introduces an automake-specific
+shadow variable for each user flag variable.  (Shadow variables are not
+introduced for variables like @code{CC}, where they would make no
+sense.)  The shadow variable is named by prepending @samp{AM_} to the
+user variable's name.  For instance, the shadow variable for
+@code{YFLAGS} is @code{AM_YFLAGS}.
+
+
+
 @node Examples, Invoking Automake, Generalities, Top
 @chapter Some example packages
 
@@ -1325,9 +1361,9 @@ installed in @file{$(datadir)/aclocal}.
 
 @cindex SUBDIRS, explained
 
-In non-flat packages, the top level @file{Makefile.am} must tell
-Automake which subdirectories are to be built.  This is done via the
-@code{SUBDIRS} variable.
+In packages with subdirectories, the top level @file{Makefile.am} must
+tell Automake which subdirectories are to be built.  This is done via
+the @code{SUBDIRS} variable.
 @vindex SUBDIRS
 
 The @code{SUBDIRS} macro holds a list of subdirectories in which
@@ -3502,10 +3538,10 @@ worked around by simply adding some @code{make} targets and rules to
 
 There are some caveats to doing this.  Although you can overload a
 target already used by Automake, it is often inadvisable, particularly
-in the topmost directory of a non-flat package.  However, various useful
-targets have a @samp{-local} version you can specify in your
-@file{Makefile.in}.  Automake will supplement the standard target with
-these user-supplied targets.
+in the topmost directory of a package with subdirectories.  However,
+various useful targets have a @samp{-local} version you can specify in
+your @file{Makefile.in}.  Automake will supplement the standard target
+with these user-supplied targets.
 
 @trindex  all-local
 @trindex  info-local
index 610f616775072d8ff835f1f3aa09ea3bc87d0aa7..b5618f1c91fe557dbeab590d37ff5592e728448c 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 5 May 2001
+@set UPDATED 6 May 2001
 @set UPDATED-MONTH May 2001
 @set EDITION 1.4e
 @set VERSION 1.4e
index f785b5e4d300585ec7da31daff45dd14d39f5838..5cf16625e7f7907cd0d8e9bf10e38e0746bd7769 100644 (file)
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = gnits
 
-XFAIL_TESTS = objc.test subobj2.test yaccvpath.test texinfo10.test
+XFAIL_TESTS = objc.test subobj2.test yaccvpath.test texinfo10.test subobj6.test
 
 TESTS =        \
 acinclude.test \
@@ -246,6 +246,8 @@ subobj.test \
 subobj2.test \
 subobj3.test \
 subobj4.test \
+subobj5.test \
+subobj6.test \
 subst.test \
 suffix.test \
 suffix2.test \
index 6e54e3b4069347f366d7e4a74bf8d49a11759874..7b859a1e35b3370ff6e85911ec4fee0ada8c493c 100644 (file)
@@ -75,7 +75,7 @@ install_sh = @install_sh@
 
 AUTOMAKE_OPTIONS = gnits
 
-XFAIL_TESTS = objc.test subobj2.test yaccvpath.test texinfo10.test
+XFAIL_TESTS = objc.test subobj2.test yaccvpath.test texinfo10.test subobj6.test
 
 TESTS = \
 acinclude.test \
@@ -319,6 +319,8 @@ subobj.test \
 subobj2.test \
 subobj3.test \
 subobj4.test \
+subobj5.test \
+subobj6.test \
 subst.test \
 suffix.test \
 suffix2.test \
@@ -445,6 +447,10 @@ distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
 distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           $(mkinstalldirs) "$(distdir)/$$dir"; \
+         fi; \
          if test -d $$d/$$file; then \
            cp -pR $$d/$$file $(distdir) \
            || exit 1; \
diff --git a/tests/subobj6.test b/tests/subobj6.test
new file mode 100755 (executable)
index 0000000..d87d0ba
--- /dev/null
@@ -0,0 +1,50 @@
+#! /bin/sh
+
+# Test of subdir make dist rules.
+# From Robert Collins
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT(generic/a.c)
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AM_PROG_CC_C_O
+AC_PROG_CC
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = wish
+wish_SOURCES = generic/a.c
+END
+
+mkdir generic
+cat > generic/a.c << 'END'
+#include <stdio.h>
+int main ()
+{
+   printf ("maude!\n");
+   return 0;
+}
+END
+
+set -e
+
+$needs_autoconf
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --include-deps --copy --add-missing
+
+mkdir build
+cd build
+
+../configure
+make
+make distclean
+
+test -f generic/a.o && exit 1
+test -f generic/.dirstamp && exit 1
+
+exit 0
index 610f616775072d8ff835f1f3aa09ea3bc87d0aa7..b5618f1c91fe557dbeab590d37ff5592e728448c 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 5 May 2001
+@set UPDATED 6 May 2001
 @set UPDATED-MONTH May 2001
 @set EDITION 1.4e
 @set VERSION 1.4e
This page took 0.048051 seconds and 5 git commands to generate.