Last active
August 29, 2015 14:17
-
-
Save rhowardiv/bb19895617fe0487781d to your computer and use it in GitHub Desktop.
generic Makefile for markdown work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SHELL := /bin/bash | |
.PHONY: default pdf html view clean | |
SRC = $(wildcard *.txt) | |
PDFS=$(SRC:.txt=.pdf) | |
HTML=$(SRC:.txt=.html) | |
default: pdf html | |
pdf: $(PDFS) | |
%.pdf : %.txt | |
@pandoc -o $@ $< | |
html : $(HTML) | |
%.html : %.txt | |
@pandoc -o $@ $< | |
view : $(PDFS) | |
@if [[ "$$(uname)" == "Linux" ]]; then \ | |
evince $< & \ | |
else open -a Preview $< & \ | |
fi | |
clean : | |
@rm $(PDFS) $(HTML) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment