Question: I thought this is quite simple

```
%.png: ../figs/%.png
        convert $? -resize '40%' $@

```

That is, I want to generate an image in this directory from the corresponding image in "../figs/" .

But, the above leads to an infinite chain of dependencies because `../figs/foo.png` matches `%.png` and therefore make tries to check `../figs/../figs/foo.png`, which matches `%.png` and therefore make tries to . . .
Eventually, make stops with "File name too long".

I must be missing something. What is a clean solution?

Answer: 
Kill the chain with an empty rule

```
%.png: ../figs/%.png
    convert $? -resize '40%' $@

../figs/%.png: ;

```
All the answers above are quite interesting. However, I'll like to mention the terminal rule solution:

```
%.png:: ../figs/%.png
    convert $? -resize '40%' $@

```

By changing to a double colon `::`, we then mark the prerequisites [terminal](https://www.gnu.org/software/make/manual/html_node/Match_002dAnything-Rules.html):

> 
> One choice is to mark the *match-anything rule* as terminal by defining it with a double colon. **When a rule is terminal, it does not apply unless its prerequisites actually exist.** Prerequisites that could be made with other implicit rules are not good enough. In other words, no further chaining is allowed beyond a terminal rule.
> 
> 
> 

*Note: only suitable for match-anything rules.*

* [What are double-colon rules in a Makefile for?](https://stackoverflow.com/questions/7891097/what-are-double-colon-rules-in-a-makefile-for)
* [GNU make seems to ignore non-terminal match-anything rules for intermediate files](https://stackoverflow.com/questions/37481042/gnu-make-seems-to-ignore-non-terminal-match-anything-rules-for-intermediate-file)