From: Michael Wagner Date: Tue, 21 Jun 2016 13:19:22 +0000 (+0200) Subject: posaune X-Git-Tag: sysd2sysv_0.1-1~16^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7f51ac61113edf0e868cdeb4a73a159c6cb775e0;p=projects.git posaune --- 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 $<