RST2PDF := rst2pdf RST2PDFFLAGS := --compressed --smart-quotes=1 RST2HTML := rst2html RST2HTMLFLAGS := --section-subtitles # Transform reST documents to PDF $(VD)/%.pdf: $T/%.rst $G/rst2pdf-flags $(call exec,$(RST2PDF) $(RST2PDFFLAGS) -o $@ $<) # Transform reST documents to HTML $(VD)/%.html: $T/%.rst $G/rst2html-flags $(call exec,$(RST2HTML) $(RST2HTMLFLAGS) $< $@) # The real targets $(VD)/resume.pdf: RST2PDFFLAGS += -l en_US $(VD)/resume.html: RST2HTMLFLAGS += -l en .PHONY: pdf pdf: $(VD)/resume.pdf .PHONY: html html: $(VD)/resume.html all += pdf # Create files containing the current flags to trigger a rebuild if they change setup_flag_files__ := $(call gen_rebuild_flags,$G/rst2pdf-flags,\ $(RST2PDFFLAGS) $(RST2PDF),rst2pdf) setup_flag_files__ := $(setup_flag_files__)$(call gen_rebuild_flags,\ $G/rst2html-flags,$(RST2HTMLFLAGS) $(RST2HTML),rst2html) # Print any generated message (if verbose) $(if $V,$(if $(setup_flag_files__), \ $(info !! Flags or commands changed:$(setup_flag_files__) re-building \ affected files...)))