BIBLIOGRAPHY := bibliography.bib LOG_MARKDOWN := log.md SCRAPBOOK_MARKDOWN := scrapbook.md LOG_PDF := log.pdf SCRAPBOOK_PDF := scrapbook.pdf all: log scrapbook watch: ifdef TARGET while true; do \ $(MAKE) $(TARGET); \ inotifywait -qre close_write .; \ done else while true; do \ $(MAKE) all; \ inotifywait -qre close_write .; \ done endif log: $(LOG_MARKDOWN) $(BIBLIOGRAPHY) pandoc \ --standalone \ --from markdown \ --to pdf \ --pdf-engine pdflatex \ --citeproc \ --output $(LOG_PDF) \ $(LOG_MARKDOWN) scrapbook: $(SCRAPBOOK_MARKDOWN) $(BIBLIOGRAPHY) pandoc \ --standalone \ --from markdown \ --to pdf \ --pdf-engine pdflatex \ --citeproc \ --output $(SCRAPBOOK_PDF) \ $(SCRAPBOOK_MARKDOWN) clean: rm $(LOG_PDF) $(SCRAPBOOK_PDF)