From 197d1b16dbc129b43560d449d7c73a48120205c1 Mon Sep 17 00:00:00 2001 From: Ben Ransford Date: Wed, 19 Mar 2014 11:28:59 -0700 Subject: [PATCH] make snapshot --- Makefile.include | 7 ++++++- README.md | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.include b/Makefile.include index 82261d0..c3e66d4 100644 --- a/Makefile.include +++ b/Makefile.include @@ -88,7 +88,7 @@ else ifneq ($(wildcard .svn/entries),) endif # .PHONY names all targets that aren't filenames -.PHONY: all clean pdf view +.PHONY: all clean pdf view snapshot all: pdf $(AFTERALL) @@ -128,6 +128,11 @@ endif @while grep -q "Rerun to" $*.log; do \ $(PDFLATEX) $* $(ERRFILTER); done +DRAFTS := $(PDFTARGETS:.pdf=-$(REVISION).pdf) +$(DRAFTS): %-$(REVISION).pdf: %.pdf + cp $< $@ +snapshot: $(DRAFTS) + clean: $(RM) $(foreach T,$(PDFTARGETS:.pdf=), \ $(T).out $(T).pdf $(T).blg $(T).bbl \ diff --git a/README.md b/README.md index 3d488a9..a5b7f22 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,5 @@ Features: command you can use in your LaTeX markup to include a current revision identifier. Useful for circulating drafts for comment. * `make view` opens your typeset document. +* To generate a draft with the revision number in its filename (to pass + around), use `make snapshot`.