help-gnu-utils
[Top][All Lists]
Advanced

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

Make: Missing prerequisites on implicit rules


From: Peer Georgi
Subject: Make: Missing prerequisites on implicit rules
Date: Sat, 20 Jan 2007 03:29:51 +0100 (MET)
User-agent: KMail/1.9.5

Hi all,

I have a problem with the behavior of implicit rules if one or more 
prerequisites are not exists.

The following works (explicit rule for test.out):

--
all: test.out

test.out: test.in
        @cat test.in >> test.out

%.in:
        @echo "Missing file $@!"
        @exit 1

.PHONY: all
--

If test.in not exists the implicit target %.in will trigger and shows the 
message. This even happens if test.out already exists!


The following does not work:

--
all: test.out

# Implicit rule for test.out
%.out: test.in
        cat test.in >> test.out


%.in:
        @echo "Missing file $@!"
        @exit 1

.PHONY: all
--

Here %.in will only trigger if test.out does not exists. If I remove test.in 
(while test.out exists) the %.in target will never trigger...

Now my question:
  Is this a bug or well defined behavior.
  I need a mechanism to find out missing prerequisites like above.

Many thanks and Best Regards,
  Peer Georgi.




reply via email to

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