automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: Re: AM_YFLAGS = -d, recover from parse.h removal


From: Alexandre Duret-Lutz
Subject: FYI: Re: AM_YFLAGS = -d, recover from parse.h removal
Date: Sat, 08 Jun 2002 19:21:39 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu)

>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:

 adl> If stumbled across somthing odd when working on this patch: The
 adl> `parse.h: parse.c' dependency rule is output twice by Automake.
 adl> One definition comes from &lang_yacc_target_hook, the other from
 adl> lib/am/yacc.am.  But this latter is output only when a specific
 adl> (i.e. non generic) rule is used.  I don't really understand
 adl> the logic here (assuming it was meant).

 adl> 2002-05-08  Alexandre Duret-Lutz  <address@hidden>

[...]

I'm committing this on HEAD and branch-1-6 as follows.
Bernd tested it in his package.

2002-06-08  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (lang_yacc_target_hook): Add rule to recover from
        the removal of $header.
        * lib/am/yacc.am (%BASE%.h): Remove (duplicate with the one
        output by lang_yacc_target_hook).
        * tests/yacc7.test: Try to recreate foo.h after its removal.
        * tests/yacc8.test: Add `AM_YFLAGS = -d' and try to recreate
        parse.h too.
        Reported by Bernd Jendrissek.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.166.2.8
diff -u -r1.166.2.8 THANKS
--- THANKS      8 Jun 2002 16:56:55 -0000       1.166.2.8
+++ THANKS      8 Jun 2002 17:17:09 -0000
@@ -20,6 +20,7 @@
 Assar Westerlund       address@hidden
 Axel Belinfante                address@hidden
 Bernard Urban          address@hidden
+Bernd Jendrissek       address@hidden
 Bill Currie            address@hidden
 Bill Davidson          address@hidden
 Bill Fenner            address@hidden
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1287.2.8
diff -u -r1.1287.2.8 automake.in
--- automake.in 31 May 2002 17:47:26 -0000      1.1287.2.8
+++ automake.in 8 Jun 2002 17:17:10 -0000
@@ -5491,7 +5491,12 @@
        # 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'.
-       $output_rules .= "${header}: $output\n";
+       $output_rules .= ("${header}: $output\n"
+                         # Recover from removal of $header
+                         . "address@hidden test ! -f \$@; then \\\n"
+                         . "\t  rm -f $output; \\\n"
+                         . "\t  \$(MAKE) $output; \\\n"
+                         . "\telse :; fi\n");
        &push_dist_common ($header);
        # If the files are built in the build directory, then we want
        # to remove them with `make clean'.  If they are in srcdir
Index: lib/am/yacc.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/yacc.am,v
retrieving revision 1.13
diff -u -r1.13 yacc.am
--- lib/am/yacc.am      26 Mar 2002 09:24:53 -0000      1.13
+++ lib/am/yacc.am      8 Jun 2002 17:17:10 -0000
@@ -44,8 +44,3 @@
          mv y.output %BASE%.output; \
        fi
 endif !%?MORE-THAN-ONE%
-
-## Also generate a dependency for the .h file.
-if !%?GENERIC%
-%BASE%.h: %OBJ%
-endif !%?GENERIC%
Index: tests/yacc7.test
===================================================================
RCS file: /cvs/automake/automake/tests/yacc7.test,v
retrieving revision 1.5
diff -u -r1.5 yacc7.test
--- tests/yacc7.test    26 Dec 2001 08:22:06 -0000      1.5
+++ tests/yacc7.test    8 Jun 2002 17:17:11 -0000
@@ -36,4 +36,10 @@
 
 test -f foo.h || exit 1
 
+# We should be able to recover if foo.h is deleted.
+
+rm foo.h || exit 1
+$MAKE foo.h || exit 1
+test -f foo.h || exit 1
+
 exit 0
Index: tests/yacc8.test
===================================================================
RCS file: /cvs/automake/automake/tests/yacc8.test,v
retrieving revision 1.5
diff -u -r1.5 yacc8.test
--- tests/yacc8.test    10 Apr 2002 17:30:43 -0000      1.5
+++ tests/yacc8.test    8 Jun 2002 17:17:11 -0000
@@ -20,6 +20,7 @@
 AUTOMAKE_OPTIONS = subdir-objects
 bin_PROGRAMS = foo/foo
 foo_foo_SOURCES = foo/parse.y
+AM_YFLAGS = -d
 END
 
 mkdir foo
@@ -48,6 +49,13 @@
 $MAKE foo/parse.o
 test -f foo/parse.c
 test -f foo/parse.o
+
+# Aside of the rest of this test, let's see if we can recover from
+# parse.h removal
+test -f foo/parse.h
+rm -f foo/parse.h
+$MAKE foo/parse.h
+test -f foo/parse.h
 
 # Now, adds another parser to test ylwrap.
 
-- 
Alexandre Duret-Lutz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]