TARGET = 2ndQPG.pdf

SRC = index.md overview.md merge.md txnrollback.md jdbctxnrollback.md partitioning.md \
	  replication.md operation.md parameters.md

$(TARGET): cache/header.md $(SRC)
	sed -e '$$s/$$/\n/' -s $^ | gpp $(GPPDEF) -T > cache/2ndQPG.md
	2ndq-pandoc cache/2ndQPG.md --filter=tools/single-pdf.py --listings
	cp cache/2ndQPG.pdf $@

cache/header.md: $(IMG)
	bash tools/make-header.sh >$@

clean:
	rm -f cache/* $(TARGET)

all: $(TARGET)

.PHONY: all $(SUBDIRS)
