From e0c94ac47a4ec4378f1341158d82a6af3ffe4c96 Mon Sep 17 00:00:00 2001 From: jahoti Date: Wed, 13 Oct 2021 00:00:00 +0000 Subject: Add VPATH and Haketilo version to the makefile as part of configure. --- write_makefile.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'write_makefile.sh') diff --git a/write_makefile.sh b/write_makefile.sh index 118635b..6aca660 100755 --- a/write_makefile.sh +++ b/write_makefile.sh @@ -14,8 +14,17 @@ # CC0 1.0 Universal License for more details. if [ ! -e record.conf ]; then - echo "Record of configuration 'record.conf' does not exist." >&2 + echo Record of configuration "'record.conf'" does not exist. >&2 exit 1 +elif [ "$(head -n 1 record.conf | cut -c -9)x" != "srcdir = x" ]; then + echo Record of configuration "'record.conf'" is invalid. >&2 + exit 2 fi -sed '/^# Configuration goes here$/r record.conf' < Makefile.in > Makefile +SRCDIR="$(head -n 1 record.conf | cut -c 10-)" +. "$SRCDIR"/shell_utils.sh +VERSION=$(get_json_key version "$(cat "$SRCDIR"/manifest.json)") + +sed '/^# Configuration goes here$/r record.conf +s|<>|'"$SRCDIR"'| +s/<>/'$VERSION/ < "$SRCDIR"/Makefile.in > Makefile -- cgit v1.2.3