]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in (target_hook): Accept %transform as last argument.
authorAlexandre Duret-Lutz <adl@gnu.org>
Wed, 14 Jul 2004 14:49:09 +0000 (14:49 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Wed, 14 Jul 2004 14:49:09 +0000 (14:49 +0000)
(define_objects_from_sources): Pass %transform to target_hook.
(handle_source_transform): Define DIST_SOURCE to tell whether
a the source of a file is distributed or not.
(lang_yacc_target_hook): Check DIST_SOURCE, and do not distribute
the generated header if the .y source is not distributed.
* tests/pr204.test: Use AM_YFLAGS = -d and make sure generated
headers are not distributed.

ChangeLog
automake.in
tests/pr204.test

index 45a415728d45dcc3a3ef2b6f906ed9e404babdad..0c317ba716cf79a4f10ffd9164b340caac495eec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-07-14  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * automake.in (target_hook): Accept %transform as last argument.
+       (define_objects_from_sources): Pass %transform to target_hook.
+       (handle_source_transform): Define DIST_SOURCE to tell whether
+       a the source of a file is distributed or not.
+       (lang_yacc_target_hook): Check DIST_SOURCE, and do not distribute
+       the generated header if the .y source is not distributed.
+       * tests/pr204.test: Use AM_YFLAGS = -d and make sure generated
+       headers are not distributed.
+
 2004-07-12  Simon Josefsson  <jas@extundo.com>  (tiny change)
 
        * doc/automake.texi (Options): Improve ustar file name length
index 66f2a0230fefdba2d0b19d856db1f67cb4454aba..186af6e658b6cd61b9190db7127017fd844fc04b 100755 (executable)
@@ -112,7 +112,7 @@ sub finish ($)
     }
 }
 
-sub target_hook ($$$$)
+sub target_hook ($$$$%)
 {
     my ($self) = @_;
     if (defined $self->_target_hook)
@@ -1724,7 +1724,7 @@ sub handle_single_transform ($$$$$%)
        if (defined $lang)
        {
            # Let the language do some special magic if required.
-           $lang->target_hook ($aggregate, $object, $full);
+           $lang->target_hook ($aggregate, $object, $full, %transform);
        }
 
        if ($derived_source)
@@ -1902,6 +1902,7 @@ sub handle_source_transform ($$$$%)
                                         $xpfx . $one_file . '_OBJECTS',
                                         $prefix =~ /EXTRA_/,
                                         $one_file, $obj, $varname, $where,
+                                        DIST_SOURCE => ($prefix !~ /^nodist_/),
                                         %transform);
     }
     if ($needlinker)
@@ -5239,7 +5240,7 @@ sub lang_c_finish
 # compile a yacc file.
 sub lang_yacc_target_hook
 {
-    my ($self, $aggregate, $output, $input) = @_;
+    my ($self, $aggregate, $output, $input, %transform) = @_;
 
     my $flag = $aggregate . "_YFLAGS";
     my $flagvar = var $flag;
@@ -5253,7 +5254,6 @@ sub lang_yacc_target_hook
        # Found a `-d' that applies to the compilation of this file.
        # Add a dependency for the generated header file, and arrange
        # for that file to be included in the distribution.
-       # FIXME: this fails for `nodist_*_SOURCES'.
        foreach my $cond (Automake::Rule::define (${header}, 'internal',
                                                  RULE_AUTOMAKE, TRUE,
                                                  INTERNAL))
@@ -5266,7 +5266,11 @@ sub lang_yacc_target_hook
                              . "$condstr\t  \$(MAKE) $output; \\\n"
                              . "$condstr\telse :; fi\n");
          }
-       &push_dist_common ($header);
+       # Distribute the generated file, unless its .y source was
+       # listed in a nodist_ variable.  (&handle_source_transform
+       # will set DIST_SOURCE.)
+       &push_dist_common ($header)
+         if $transform{'DIST_SOURCE'};
 
        # If the files are built in the build directory, then we want
        # to remove them with `make clean'.  If they are in srcdir
index a0e6705fafb77fabd97a83acba0aa11c123557fc..26c86111016052e4b0074967d7f087f45679e70e 100755 (executable)
@@ -39,6 +39,7 @@ EOF
 # sure Automake match 'nodist_' against the right
 # variable name...
 cat > Makefile.am << 'EOF'
+AM_YFLAGS = -d
 EXTRA_PROGRAMS = foo
 PARSE2 = parse2.y
 nodist_foo_SOURCES = parse.y $(PARSE2)
@@ -62,7 +63,9 @@ $AUTOMAKE -a
 $MAKE distdir
 test -f pr204-0.1/parse.c && exit 1
 test -f pr204-0.1/parse.y && exit 1
+test -f pr204-0.1/parse.h && exit 1
 test -f pr204-0.1/parse2.c && exit 1
 test -f pr204-0.1/parse2.y && exit 1
+test -f pr204-0.1/parse2.h && exit 1
 # Make sure parse.c and parse2.c are still targets.
 $MAKE parse.c parse2.c