Commit 72d9e07a authored by Tobias Dussa's avatar Tobias Dussa
Browse files

Updated Makefile.

parent 0b101fcb
......@@ -2,16 +2,34 @@ FILESTOBEFIXED=$(wildcard written_statement*.tex)
INPUTFILES=$(wildcard written_statement*.tex)
TESTFILES=$(subst .tex,.pdf,$(INPUTFILES))
default: fix
default: $(TESTFILES)
.PHONY: $(FILESTOBEFIXED)
$(FILESTOBEFIXED):
@if ! git status "$@" | fgrep -q "working directory clean"; then TAGLINE=$$(git log -1 --date=short --pretty=format:"$$(basename ""$@"") $$(git log --oneline --abbrev-commit --all | wc -l) %ci %ae" | sed "s/ +/+/"); echo Fixing Id keyword in "$@".; sed -e "s|\\\\svnInfo \(\\$$\)Id.*$$|\\\\svnInfo \1Id: $${TAGLINE} \1|" -i "$@"; fi
@if ! git status "$@" | fgrep -q "working directory clean"; then \
TAGLINE=$$(git log -1 --date=short --pretty=format:"$$(basename ""$@"") $$(git log --oneline --abbrev-commit --all | wc -l) %ci %ae" | sed "s/ +/+/"); \
REVISION=$$(git log -1 --date=short --pretty=format:"r$$(git log --oneline --abbrev-commit --all | wc -l)\/%h~(%ci)" | sed -e "s/ .*)/)/"); \
echo Fixing Id keyword in "$@".; \
sed -e "s|\\\\svnInfo \(\\$$\)Id.*$$|\\\\svnInfo \1Id: $${TAGLINE} \1|" -i "$@"; \
echo Fixing revision in "$@".; \
sed -e "s|\\\\setgitrevision{.*}|\\\\setgitrevision{$${REVISION}}|" -i "$@"; \
fi
@git add "$@"
%.pdf: %.tex
@sed -r -e '/^[A-Z_]*_(START|END)/d' -e 's/REQUEST_SERIAL_VALUE/12345678/' -e 's/([A-Z])_([A-Z])/\1\\_\2/g' -e 's/@text_directory@\///' "$<" > "$<.test"
forcefix:
for item in $(FILESTOBEFIXED); do \
TAGLINE=$$(git log -1 --date=short --pretty=format:"$$(basename ""$${item}"") $$(git log --oneline --abbrev-commit --all | wc -l) %ci %ae" | sed "s/ +/+/"); \
REVISION=$$(git log -1 --date=short --pretty=format:"r$$(git log --oneline --abbrev-commit --all | wc -l)\/%h~(%ci)" | sed -e "s/ .*)/)/"); \
echo Fixing Id keyword in "$${item}".; \
sed -e "s|\\\\svnInfo \(\\$$\)Id.*$$|\\\\svnInfo \1Id: $${TAGLINE} \1|" -i "$${item}"; \
echo Fixing revision in "$${item}".; \
sed -e "s|\\\\setgitrevision{.*}|\\\\setgitrevision{$${REVISION}}|" -i "$${item}"; \
git add "$${item}"; \
done
%.pdf: %.tex fix
@sed -r -e '/^[A-Z_]*_(START|END)/d' -e 's/REQUEST_SERIAL_VALUE/12345678/' -e 's/FINGERPRINT_VALUE/00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:01:23:45:67/' -e 's/([A-Z])_([A-Z])/\1\\_\2/g' -e 's/@text_directory@\///' "$<" > "$<.test"
@if pdflatex $<.test; then mv "$<.pdf" "$@"; git add "$@"; fi
@rm $<.*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment