I'm having trouble with vpath and implicit rules
Code:
INCLUDE_DIR = inc
INKSCAPE ?= inkscape
CONVERT ?= convert
vpath %.png $(INCLUDE_DIR)
vpath %.svg $(INCLUDE_DIR)
.PHONY: all clean allclean
clean:
$(RM) *.aux *.bbl *.blg *.dvi *.log *.out *.nav *.snm *.toc *.vrb *~
$(RM) $(INCLUDE_DIR)/*.png
# figures
%.png: %.svg
$(INKSCAPE) -e $(INCLUDE_DIR)/$@ $<
%-g.png: %.png
$(CONVERT) -colorspace gray $< $(INCLUDE_DIR)/$@
I have a folder called "inc" with a bunch of .svg files. I have a rule for converting the .svg into a .png and a rule for converting the .png into a grayscale -g.png.
The problem is that making the grayscale PNGs won't always work because make seems to expand all of the recipes at once.
so in a clean working directory
Code:
$ make example-g.png
will expand the implicit targets to
Code:
example.png: inc/example.svg
example-g.png: example.png
but if I first do
then making the grayscale png will result in the following make rule
Code:
example-g.png: inc/example.png
Is there a fix for this?