git » nmdb » commit 230452e

Build the tests only when needed

author Alberto Bertogli
2008-07-25 23:48:27 UTC
committer Alberto Bertogli
2008-07-25 23:48:27 UTC
parent b5fb96ff5887fd67652f4f9933f2e9684dddc84d

Build the tests only when needed

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

tests/c/make.sh +4 -1

diff --git a/tests/c/make.sh b/tests/c/make.sh
index 3b07957..f8dda75 100755
--- a/tests/c/make.sh
+++ b/tests/c/make.sh
@@ -43,7 +43,10 @@ for p in TIPC TCP UDP SCTP MULT; do
 			if [ "$CLEAN" == 1 ]; then
 				rm -f $t-$OP
 			else
-				cc -lnmdb $ALLCF $TF -o $t-$OP $t.c
+				# build only if src is newer than the binary
+				if [ "$t.c" -nt "$t-$OP" ]; then
+					cc -lnmdb $ALLCF $TF -o $t-$OP $t.c
+				fi
 			fi
 		done
 	done