bug-automake
[Top][All Lists]
Advanced

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

Re: multiple outputs rule


From: Bruno Haible
Subject: Re: multiple outputs rule
Date: Fri, 15 Dec 2006 13:14:43 +0100
User-agent: KMail/1.9.1

Ralf Wildenhues wrote:
> >      ## This code is being executed by the first process.
> >                  rm -f data.stamp; \
> >                  $(MAKE) $(AM_MAKEFLAGS) data.stamp; \
> >                  result=$$?; rm -rf data.lock data.stamp; exit $$result; \
> 
> Do you really want to remove the data.stamp file here?  That causes
> unnecessary rebuilds.

Oops, I meant to remove only data.lock here. The suggested patch is this:

--- automake.texi.bak   2006-10-15 19:41:24.000000000 +0200
+++ automake.texi       2006-12-15 01:16:47.000000000 +0100
@@ -10647,18 +10647,19 @@
 data.c data.h data.w data.x: data.stamp
 ## Recover from the removal of $@@
         @@if test -f $@@; then :; else \
-          trap 'rm -rf data.lock data.stamp 1 2 13 15; \
+          trap 'rm -rf data.lock data.stamp' 1 2 13 15; \
 ## mkdir is a portable test-and-set
           if mkdir data.lock 2>/dev/null; then \
 ## This code is being executed by the first process.
             rm -f data.stamp; \
             $(MAKE) $(AM_MAKEFLAGS) data.stamp; \
+            result=$$?; rm -rf data.lock; exit $$result; \
           else \
 ## This code is being executed by the follower processes.
 ## Wait until the first process is done.
             while test -d data.lock; do sleep 1; done; \
 ## Succeed if and only if the first process succeeded.
-            test -f data.stamp; exit $$?; \
+            test -f data.stamp; \
           fi; \
         fi
 @end example

> Is there any reason why both the trap and the above code don't just use
>   rmdir data.lock
> 
> instead of 'rm -rf data.lock'?

I don't know.

Bruno




reply via email to

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