NetBSD-Bugs archive

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

Re: toolchain/34934



The following reply was made to PR bin/34934; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: toolchain/34934
Date: Mon, 14 Feb 2022 21:32:50 +0000

 On Sat, Feb 12, 2022 at 12:20:02AM +0000, Roland Illig wrote:
  >  David A. Holland wrote on 29 Oct 2006:
  >   > It's not a matter of what the rules mean
  >  
  >  I disagree.  It's exactly a matter of what the rules mean.  From your
  >  description, you seem to think that "target1 target2: source" means that
  >  this is a single rule that builds 2 targets.
 
 Unfortunately, you are wrong.
 
 I "seem to think" that because it's true: rules of the form "target1
 target2: source" have always been used for this purpose, as well as
 *also* for rules that build several targets independently.
 
 Traditionally, this works because a non-parallel make sees the rule,
 says "oh, target1 is out of date", runs the recipe, and then
   - if target2 is now up to date, it doesn't need to run it again (and
     doesn't)
   - if target2 does not exist, it runs it again for target2
 
 This does not work correctly for parallel make and that's been a
 long-standing problem. Several solutions have been proposed but none
 have been adopted. I think there's another PR for it, but whether or
 not that's the case it's a relatively well-known issue.
 
 *This* PR is about the sequential form breaking sometimes for targets
 in other directories. As I pointed out in 2006, by default it works
 correctly. (If by chance you have broken this recently, please fix
 it.)
 
 viz.:
 
    valkyrie% cat Makefile 
    all: foo bar
    foo bar: baz
 	   touch foo bar
    valkyrie% touch baz
    valkyrie% make
    touch foo bar
    valkyrie% 
 
 Note that gmake behaves the same way:
 
    valkyrie% touch baz
    valkyrie% gmake
    touch foo bar
    valkyrie% 
 
  >  Unfortunately,
  >  [irrelevant]
 
  >  David A. Holland wrote on 29 Oct 2006:
  >   > after running the recipe make is required to check and
  >   > ascertain that both a1 and a2 have been updated
  >  
  >  If we assume that a1 and a2 are independent (as GNU make and NetBSD make
  >  treat them), why would make be required to check that both files have
  >  been updated?
 
 Because that's how it's supposed to work.
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index