From 603e5fd3941ebeb858a3e09e71d2339c679b7dcd Mon Sep 17 00:00:00 2001 From: Lyberta Date: Thu, 28 Sep 2017 09:49:16 +0300 Subject: [PATCH] Fixed genmod.sh --- qcsrc/tools/genmod.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qcsrc/tools/genmod.sh b/qcsrc/tools/genmod.sh index 1c0eadcbe..a8ac4a0e8 100755 --- a/qcsrc/tools/genmod.sh +++ b/qcsrc/tools/genmod.sh @@ -13,10 +13,14 @@ function hash() { function genmod() { # use context to work around cmake issue #12619 CTX="${PWD#$ROOT}/" - oldHashC=$(hash ${MOD}.inc) - oldTimeC=$(stat -c "%Y" ${MOD}.inc) - oldHashH=$(hash ${MOD}.qh) - oldTimeH=$(stat -c "%Y" ${MOD}.qh) + if [ -f ${MOD}.inc ]; then + oldHashC=$(hash ${MOD}.inc) + oldTimeC=$(stat -c "%Y" ${MOD}.inc) + fi + if [ -f ${MOD}.qh ]; then + oldHashH=$(hash ${MOD}.qh) + oldTimeH=$(stat -c "%Y" ${MOD}.qh) + fi echo '// generated file; do not modify' > ${MOD}.inc echo '// generated file; do not modify' > ${MOD}.qh for f in $(ls | sort -k 1,1 -t .); do -- 2.39.2