From: Tom Tromey Date: Sun, 6 May 2001 20:15:41 +0000 (+0000) Subject: For PR automake/160: X-Git-Tag: handle-languages~9 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=55e60514853a7bd31d4dbe4162e75ac7e6585077;p=automake.git For PR automake/160: * tests/Makefile.am (TESTS): Added subobj5.test and subobj6.test. (XFAIL_TESTS): Added subobj6.test. * tests/subobj6.test: New file. --- diff --git a/ChangeLog b/ChangeLog index cd798b59..c8c1c664 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2001-05-06 Tom Tromey + 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. diff --git a/automake.texi b/automake.texi index 825e97c2..d81b7011 100644 --- a/automake.texi +++ b/automake.texi @@ -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 diff --git a/stamp-vti b/stamp-vti index 610f6167..b5618f1c 100644 --- 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 diff --git a/tests/Makefile.am b/tests/Makefile.am index f785b5e4..5cf16625 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 6e54e3b4..7b859a1e 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 00000000..d87d0bad --- /dev/null +++ b/tests/subobj6.test @@ -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 +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 diff --git a/version.texi b/version.texi index 610f6167..b5618f1c 100644 --- a/version.texi +++ b/version.texi @@ -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