diff --git a/manuscrit/00_opening/05_version.tex b/manuscrit/00_opening/05_version.tex new file mode 100644 index 0000000..3ab55c2 --- /dev/null +++ b/manuscrit/00_opening/05_version.tex @@ -0,0 +1,7 @@ +%\input{../build/version} +\vspace*{\fill} +\begin{center} + Version \texttt{\input{../build/version}} +\end{center} +\vspace*{\fill} +\newpage{} diff --git a/manuscrit/00_opening/main.tex b/manuscrit/00_opening/main.tex index f1b839f..c9733e6 100644 --- a/manuscrit/00_opening/main.tex +++ b/manuscrit/00_opening/main.tex @@ -1,3 +1,5 @@ +\input{05_version.tex} + \input{10_abstract.tex} \setcounter{page}{4} diff --git a/manuscrit/Makefile b/manuscrit/Makefile index 42e8869..474803d 100644 --- a/manuscrit/Makefile +++ b/manuscrit/Makefile @@ -4,6 +4,7 @@ AUX_DIR=$(BUILD_DIR)/aux CLEANED_PDF=$(BUILD_DIR)/these.pdf MAIN_PDF=$(BUILD_DIR)/main.pdf ALL=$(CLEANED_PDF) +REV_FILE=$(BUILD_DIR)/version all: _setup $(ALL) @@ -16,19 +17,27 @@ _setup: $(CLEANED_PDF): $(MAIN_PDF) qpdf "$<" --linearize "$@" - exiftool -all:all= "$@" + exiftool -all:all= \ + -Version="$(shell bin/version.sh)" \ + -Author="Théophile Bastian" \ + -Title="Performance study: identifying bottlenecks by means of sensitivity analysis" \ + "$@" @ pdffonts "$@" | grep -q ' no' && echo -e "\033[0;1;31mSOME FONTS NOT EMBEDDED\033[0m" || true @ !(pdffonts "$@" | grep -q ' no') .PHONY: $(MAIN_PDF) # hack-ish: latexmk knows better when to run. -$(MAIN_PDF): assets +$(MAIN_PDF): assets $(REV_FILE) latexmk $($(notdir $@):.pdf=.tex) .PHONY: assets assets: $(MAKE) -C "$@" +.PHONY: $(REV_FILE) # not costly: just always run it. +$(REV_FILE): + ./bin/version.sh > "$@" + clean: latexmk -C diff --git a/manuscrit/bin/version.sh b/manuscrit/bin/version.sh new file mode 100755 index 0000000..1ebc70a --- /dev/null +++ b/manuscrit/bin/version.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo -n "$(git rev-parse --short HEAD)" +if [ -n "$(git status --porcelain --untracked-files=no)" ] ; then + echo -n "-dirty" +fi +echo ""