SRC=double.tex single.tex
BBL=$(SRC:%.tex=%.bbl)
PDF=$(SRC:%.tex=%.pdf)
MDWN=response2.mdwn
REPLY=$(MDWN:%.mdwn=%.pdf)

pdf: $(PDF) $(REPLY)

%.pdf: %.tex %.bbl 
	pdflatex $<
	pdflatex $<
	make clean

%.bbl: %.aux refs.bib 
	bibtex $<

%.aux: %.tex 
	pdflatex $<

$(REPLY): $(MDWN)
	pandoc --from markdown --biblio refs.bib --csl chicago-author-date.csl \
		--standalone --normalize --smart --parse-raw \
		$< -o $@
	  
clean:
	$(RM) *.aux *.log *.bbl *.blg *.spl

sub:
	rar a -r submission.rar submission
