changeset 15:c8bdae60fcb1

changed the generation of *_version.c files to not break on make clean
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 27 Sep 2016 04:34:05 +0000
parents 86e83045be37
children c15047b3d00d
files components/aci-classic scripts/mk-component.sh
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/components/aci-classic	Tue Sep 27 04:23:46 2016 +0000
+++ b/components/aci-classic	Tue Sep 27 04:34:05 2016 +0000
@@ -1,10 +1,9 @@
 # Building the classic TCS211 version of aci.lib
 
-scripts/make-version.sh aci > $BUILD_DIR/$LIBNAME/aci_version.c
-
 CFLAGS="-me -mt -o -pw2 -x -mw"
 CPPFLAGS=
 
+make_version aci
 cfile_plain aci_version.c
 
 # Defines
--- a/scripts/mk-component.sh	Tue Sep 27 04:23:46 2016 +0000
+++ b/scripts/mk-component.sh	Tue Sep 27 04:34:05 2016 +0000
@@ -37,6 +37,18 @@
 
 # shell functions to be used in the recipes
 
+make_version() {
+	if [ $# != 1 ]
+	then
+		echo "Error: make_version takes 1 argument" 1>&2
+		exit 1
+	fi
+	echo "$1_version.c:" >> $BUILD_DIR/$LIBNAME/Makefile
+	echo "	../../scripts/make-version.sh $1 > $1_version.c" \
+		>> $BUILD_DIR/$LIBNAME/Makefile
+	echo >> $BUILD_DIR/$LIBNAME/Makefile
+}
+
 cfile_plain() {
 	if [ $# != 1 ]
 	then