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-en.pdf: RST2PDFFLAGS += -l en_US $(VD)/resume-en.html: RST2HTMLFLAGS += -l en $(VD)/resume-es.pdf: RST2PDFFLAGS += -l es_AR $(VD)/resume-es.html: RST2HTMLFLAGS += -l es .PHONY: en en: $(VD)/resume-en.pdf $(VD)/resume-en.html .PHONY: es es: $(VD)/resume-es.pdf $(VD)/resume-es.html .PHONY: pdf pdf: $(VD)/resume-en.pdf $(VD)/resume-es.pdf .PHONY: html html: $(VD)/resume-en.html $(VD)/resume-es.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...)))