make-w32
[Top][All Lists]
Advanced

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

Re: Rule formulation


From: Rob Walker
Subject: Re: Rule formulation
Date: Thu, 10 Jan 2008 10:51:03 -0800
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Just add an empty rule for fileB, like so:

fileB:

-Rob

haues1 wrote:
Hi,

I am trying to formulate a rule for the following task:

The target "fileA" is created by executing the command
"Cmd_to_create_fileA", which does NOT require the "fileB". There is no rule
in GnuMake to create "fileB". Still, I would like to make the creation of
"fileA" dependent on "fileB", according to the conditons:

Execute "Cmd_to_create_fileA"
        1) if fileA exists and fileB exists and fileB is younger than fileA;
        2) if fileA exists and fileB does not exist;
        3) if fileA does not exist and fileB exists;
        4) if fileA does not exist and fileB does not exist;
or, formulated the other way round, do NOT execute "Cmd_to_create_fileA":
        if fileA exists and fileB exists and fileB is older than fileA;

The conditions 1) and 3) are covered by the standard rule:

     fileA: fileB
            Cmd_to_create_fileA

In cases 2) and 4) gnumake doesn't find a rule to create fileB, and aborts
with an error like "Don't now how to make fileB". How can I formulate the
rule, so no error occurs?

Can somebody please help me?

Cheers
Haues





reply via email to

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