help-make
[Top][All Lists]
Advanced

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

Re: behavior on Win depends on whether \ or / is used??


From: Paul Smith
Subject: Re: behavior on Win depends on whether \ or / is used??
Date: Sun, 03 Jan 2010 16:01:42 -0500

On Sat, 2010-01-02 at 10:43 +0200, Eli Zaretskii wrote:
> > 
> > vpath %.s foobar0 foobar1
> > %.o: %.s
> >             echo $<
> > foobar0/foobar.s:
> > 
> > (and as always, foobar.s only in foobar1, not in foobar0).  
> > 
> > 
> > Here, the current behavior of make is 
> > 
> > C:\tmp>make foobar.o
> > echo foobar0/foobar.s
> > 
> > How can this possibly be "correct"??  GNU make manual only states
> that for the rule with no commands or prerequisites, make "imagines"
> the target has been updated, even if it does not exist.

I guess I'm not sure what comment I should make... you have described
the answer yourself.  If there is a target with no prerequisites or
recipe, make treats it as if it was created when make runs (so it's new,
every time).

This is the traditional behavior of make since make was first invented,
as far as I know; it's the driving principle behind the "FORCE:" target
which is used by thousands of makefiles and variants of make, just for
one use.  It's even codified in the POSIX spec for make, as follows:

        [...] A target is considered out-of-date [...] if it does not
        exist. [...]
        
        [...] if the target is out-of-date, the commands associated with
        the target entry shall be executed. If there are no commands
        listed for the target, the target shall be treated as
        up-to-date.

So... what exactly is the question?

And, how does this relate to the subject of the email (slash vs.
backslash)?

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist





reply via email to

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