I have a (GNU) make file with two-levelled dependencies like this:
INP ?= main
DEPS ?= bibliography.bib
# md-->tex rule
%.tex: %.md $(DEPS)
panzer -o $@ $<
# tex-->pdf rule
%.pdf: %.tex
latexmk $<
.PHONY: show
show: $(INP).pdf
showpdf $<
This works as expected: make show
creates and displays a PDF from main.md
(or any other markdown file I specify) when the markdown file has changed by invoking first the md-->tex rule, then the tex-->pdf and finally the showpdf rule.
Now I want to add a target force
which triggers the rules md-->tex, tex-->pdf and showpdf regardless of the state of main.md
.
From this answer I tried
force:
rm $(INP).pdf
make show
but this is not very elegant and rather fragile. - I suspect there must be a way to create a target inside the current make invocation to say:
Pretend the dependencies for rule X (here
show
) is out of date and trigger everything accordingly.
What the best way to achieve this?