So, I have a Makefile with 2 pattern rules, one of them is a terminal Match-Anything; the target is about.html
(for example):
vpath %.md $(SOURCE_DIR)
HEADER := assets/navbar.part
%.html : %.md $(HEADER)
pandoc [...] $< -o $@
%::
cp $(SOURCE_DIR)/$@ $@
If I execute make assets/navbar.part
, and then make about.html
(for example), everything works fine (navbar.part
uses the match anything, and about.html uses the first rule). But if I try to make about.html
without having navbar.part
present, make
does:
- Find the prerequisite about.md
- ?? Gives up on fulfilling $(HEADER)
- Tries to use the match anything rule to generate about.html
I was expecting that make
would:
- Find the prerequisite about.md
- Make the prerequisite $(HEADER) using the match-anything rule
- With all the prerequisites fulfilled, finally execute the first rule
From reading the debug trace, it seems like Make never really tries to fulfill the $(HEADER)
prerequisite:
Considering target file 'about.html'.
File 'about.html' does not exist.
Looking for an implicit rule for 'about.html'.
Trying pattern rule with stem 'about'.
Trying implicit prerequisite 'about.md'.
Found prerequisite 'about.md' as VPATH '../website/about.md'
Trying rule prerequisite 'assets/navbar.part'.
Trying pattern rule with stem 'about.html'.
Found an implicit rule for 'about.html'.
Considering target file 'about.md'.
Finished prerequisites of target file 'about.md'.
No need to remake target 'about.md'; using VPATH name '../website/about.md'.
Finished prerequisites of target file 'about.html'.
Must remake target 'about.html'.
cp -f ../website/about.html about.html
Any ideas?