SHELL := /bin/bash .SUFFIXES: .SUFFIXES: .md PROJECT = $(shell basename $(CURDIR)) PROJECT_NAME_UPPERCASE = $(shell echo $(PROJECT) | tr a-z A-Z | tr - _) OUTPUT_FOLDER = target TEMPLATE_NOTE_PDF = --template=../_templates/delivery-note-template-ihe.tex TEMPLATE_REPORT_PDF = --template=../_templates/ihedev-report-template.tex DELIVERY_NOTES_MD = $(notdir $(wildcard delivery-notes/*.md)) DELIVERY_NOTES_NAME = PVL-$(PROJECT_NAME_UPPERCASE)- DELIVERY_NOTES_PDF += $(addprefix $(DELIVERY_NOTES_NAME), $(DELIVERY_NOTES_MD:.md=.pdf)) TEST_REPORTS_MD = $(notdir $(wildcard test-reports/*.md)) TEST_REPORTS_NAME = RDT-$(PROJECT_NAME_UPPERCASE)- TEST_REPORTS_PDF += $(addprefix $(TEST_REPORTS_NAME), $(TEST_REPORTS_MD:.md=.pdf)) MAINTENANCE_REPORTS_MD = $(notdir $(wildcard maintenance-reports/*.md)) MAINTENANCE_REPORTS_NAME = RDM-$(PROJECT_NAME_UPPERCASE)- MAINTENANCE_REPORTS_PDF += $(addprefix $(MAINTENANCE_REPORTS_NAME), $(MAINTENANCE_REPORTS_MD:.md=.pdf)) DELIVERY_DOC_MD = $(notdir $(wildcard delivery-documents/*.md)) DELIVERY_DOC_NAME = FDL-$(PROJECT_NAME_UPPERCASE)- DELIVERY_DOC_PDF += $(addprefix $(DELIVERY_DOC_NAME), $(DELIVERY_DOC_MD:.md=.pdf)) test-reports: $(TEST_REPORTS_PDF) delivery-notes: $(DELIVERY_NOTES_PDF) maintenance-reports: $(MAINTENANCE_REPORTS_PDF) delivery-documents: $(DELIVERY_DOC_PDF) $(TEST_REPORTS_NAME)%.pdf: test-reports/%.md | $(OUTPUT_FOLDER) @echo "Create" $@ pandoc $< $(TEMPLATE_REPORT_PDF) -N -s --toc --latex-engine=xelatex -o $(OUTPUT_FOLDER)/$@ $(DELIVERY_NOTES_NAME)%.pdf: delivery-notes/%.md | $(OUTPUT_FOLDER) @echo "Create" $@ @pandoc $< $(TEMPLATE_NOTE_PDF) -N -s --latex-engine=xelatex -o $(OUTPUT_FOLDER)/$@ $(MAINTENANCE_REPORTS_NAME)%.pdf: maintenance-reports/%.md | $(OUTPUT_FOLDER) @echo "Create" $@ pandoc $< $(TEMPLATE_REPORT_PDF) -N -s --toc --latex-engine=xelatex -o $(OUTPUT_FOLDER)/$@ $(DELIVERY_DOC_NAME)%.pdf: delivery-documents/%.md | $(OUTPUT_FOLDER) @echo "Create" $@ pandoc $< $(TEMPLATE_REPORT_PDF) -N -s --toc --latex-engine=xelatex -o $(OUTPUT_FOLDER)/$@