I have problems understanding why one pattern rule in my makefile works fine, but not the other, as they look pretty much similar to me. What I'm trying to do is to compile a LaTeX document using a makefile, including a SVG illustrations exported from Inkscape:
#Program paths
LATEX = latex
BIBTEX = bibtex
PDFLATEX = pdflatex
INKSCAPE_PATH = inkscape
#Options
LATEX_OPS=-interaction=nonstopmode
BIBTEX_OPS=
PDFLATEX_OPS=
INKSCAPE_OPS=-D -z --export-latex
#File paths
LATEX_PATH=.
PICS_PATH=/path/to/user\ name/pics
all: my_illustration.svg my_pdf_file.pdf
#Generate files for including SVG illustration
%.svg: $(PICS_PATH)/%.svg
$(INKSCAPE_PATH) $(INKSCAPE_OPS) --file="$^" --export-pdf="$(subst svg,pdf,$^)"
#Generate PDF
%.pdf: $(LATEX_PATH)/%.tex
-$(LATEX) $(LATEX_OPS) $^
-$(BIBTEX) $(BIBTEX_OPS) $(LATEX_PATH)/$(subst .pdf,,$@).aux
$(PDFLATEX) $(PDFLATEX_OPS) $^
$(PDFLATEX) $(PDFLATEX_OPS) $^
Now, generating my_pdf_file.pdf
alone works fine, but the SVG rule fails:
No rule to make target `my_illustration.svg', needed by `all'. Stop.
What am I doing wrong? Thank you in advance.