help-make
[Top][All Lists]
Advanced

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

Recursive implicit rule chain sometimes works


From: Luke Goodsell
Subject: Recursive implicit rule chain sometimes works
Date: Wed, 19 Nov 2014 13:51:44 +0000

$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-pc-linux-gnu

Hi,

Using the above version of make, I'm encountering an issue whereby a 
pattern-based implicit target works when called as part of several other 
targets, but not when called on it's own. Specifically, I receive 'No rule to 
make target' when I call error-prone target alone. I would very much appreciate 
your assistance to avoid this problem.

The simplest form of the Makefile that demonstrates this issue is as follows:

all: \
        dirA/dirB/loop1/file2 \
        dirA/dirB/loop2/file1 \
        dirA/dirB/loop2/file3 \
        dirA/dirB/loop2/file2

dirA/%/file2: \
        dirA/%/file1 \
        
        echo "$@";

dirA/%/loop1/file1: \
        
        echo "$@";

dirA/%/loop2/file1: \
        dirA/%/loop2/file3 \
        
        echo "$@";

dirA/%/loop2/file3: \
        dirA/%/loop1/file2 \
        
        echo "$@";

/ End of Makefile

`make all` succeeds, as does make'ing any of the first three prerequisites of 
'all'. However, `make dirA/dirB/loop2/file2` on it's own yields

make: *** No rule to make target `dirA/dirB/loop2/file2'.  Stop.

Thanks in advance for your help,
Luke




reply via email to

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