bug-make
[Top][All Lists]
Advanced

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

[bug #52017] Multiple intermediate pattern targets badly managed


From: Paul D. Smith
Subject: [bug #52017] Multiple intermediate pattern targets badly managed
Date: Sat, 23 Sep 2017 14:20:46 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #52017 (project make):

                  Status:                    None => Not A Bug              
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

Your example makefile contains:


all: my.res my.draft.res

%.res %.int: %.src
        cp $< $*.int
        cp $< $*.res

%.draft.res: %.d %.int
        cat $^ >$@


You are assuming that %.int will always be considered intermediate.  But,
that's not the case.

If you run "make my.draft.res" then indeed, my.int will be considered
intermediate because it needs to be created as an intermediate file between
the source (my.src) and the target (my.draft.res).  And, make will treat it as
such.

But if you run "make my.res" then "my.int" is NOT an intermediate file; it's
created as a side-effect of creating the target "my.res", not as an
intermediate file (a prerequisite of "my.res").  And make doesn't treat it as
such.

If you want the file to be considered intermediate always you can declare it
to be such:


$ echo '.INTERMEDIATE: my.int' >> Makefile

$ make
cp my.src my.int
cp my.src my.res
cat my.d my.int >my.draft.res
rm my.int

$ ls -al my.int
ls: cannot access 'my.int': No such file or directory

$ make
make: Nothing to be done for 'all'.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52017>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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