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: ;

```
[user657267](https://stackoverflow.com/users/657267/user657267)'s solution is perfect. Another option is to use static pattern rules:

```
PNGS    := $(patsubst ../figs/%.png,%.png,$(wildcard ../figs/*.png))

all: $(PNGS)

$(PNGS): %.png: ../figs/%.png
    convert $< -resize '40%' $@

clean:
    rm -f $(PNGS)

```

Computing the list of all targets from the list of all prerequisites has several nice side effects, like the prossibility of adding the `all` and `clean` targets, for instance.