Make: Missing prerequisites on implicit rules

Peer Georgi <[email protected]>
Newsgroups gmane.comp.gnu.utils
Organization private
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.