mainmake - Support: sr #107228, Desire for a somewhat smarter...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

sr #107228: Desire for a somewhat smarter order only dependency

Submitter:  Brian Cody <epistax2>
Submitted:  Thu 21 Jan 2010 02:53:44 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  1 - Wish Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  Any

Thu 21 Jan 2010 03:06:20 PM UTC, comment #2: 

No, because 'a' in my case is actually a pattern match that will match hundreds of targets, and we only want to do 'c' if and only if any 'a' matches (and only once).


Thanks

Brian Cody <epistax2>
Thu 21 Jan 2010 03:02:30 PM UTC, comment #1: 

Would it work to do something like:

all: a

a:
        $(MAKE) c
        @touch a

b: ; @touch b

c: ; @echo c

a: b


?

Paul D. Smith <psmith>
Group administrator
Thu 21 Jan 2010 02:53:44 PM UTC, original submission:  

I don't much care if the syntax would be different, but one glaring issue that I'm experiencing right now in make is that I cannot have a dependency only be made if it is actually needed. For example given the file:

all : a

a :
 @touch a

b:
 @touch b

c:
 @echo c

a : b | c

The first run would result in b being created, c being echoed, and a being created.  The second run would result in c being echoed. However, I never specified c as a target. a is already up to date by virtue of the file a being newer than the file b. Since the dependency on c is order only, and we've already decided we're not going to make a, there's no reason to make c.

The heart of the issue is that of timing. In this case, 'a', 'b', and 'c' all take a significant amount of actual time to complete (not for the example above of course). If 'a' is already up to date with respect to 'b', then 'c' is a productivity waster.  This is a simplified example. In the actual system, 'a' is a pattern match with hundreds of results, 'b' is unique to each 'a', but 'c' is the same for all. That is, if more than one 'a' needs to be made, 'c' only needs to be made once.

I cannot find any make syntax to make 'c' if and only if any 'a' needs to be done.

Brian Cody <epistax2>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by epistax2 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code