From 7f51ac61113edf0e868cdeb4a73a159c6cb775e0 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Tue, 21 Jun 2016 15:19:22 +0200 Subject: [PATCH] posaune --- tools/make/configure | 1 + tools/make/insert_build.sh | 18 ++++++++++++++++++ tools/make/makefile | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 tools/make/insert_build.sh diff --git a/tools/make/configure b/tools/make/configure index f4541ba..e27e9e2 100755 --- a/tools/make/configure +++ b/tools/make/configure @@ -127,4 +127,5 @@ fi # append version to make.pre echo "version = $version" >> make.pre +echo "build = $build" >> make.pre diff --git a/tools/make/insert_build.sh b/tools/make/insert_build.sh new file mode 100755 index 0000000..00a90b0 --- /dev/null +++ b/tools/make/insert_build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +usage="insert_build.sh " + +# inserts _ before last dot of filename +# example: "insert_build.sh 45 foo.pdf" leads to "foo_45.pdf" + +if [ $# -ne 2 ]; then + echo $usage + exit 1 +fi + +stem=${1%.*} +ext=${1##*.} + +cp $1 ${stem}_$2.$ext + diff --git a/tools/make/makefile b/tools/make/makefile index 6513f24..b2f4944 100644 --- a/tools/make/makefile +++ b/tools/make/makefile @@ -8,6 +8,7 @@ COMPILE_TARGET = compile.stamp COPY = $(NOP) ZIP = zip -r $(project).zip $(project) DEB = fakeroot dpkg-deb --build $(project) +INSERT_BUILD = projects/tools/make/insert_build.sh #default parameters project = default @@ -38,6 +39,9 @@ zip: $(project).zip deb: $(project).deb # Debian package ready +version: $(COMPILE_TARGET) + $(INSERT_BUILD) $(COMPILE_TARGET) $(build) + #----------------------------------------------------------------- # compile steps #----------------------------------------------------------------- @@ -78,5 +82,5 @@ clean: # Build-Regeln #----------------------------------------------------------------- %.pdf : %.tex $(SOURCES) - pdflatex $< + pdflatex $< && pdflatex $< -- 2.20.1