Skip to content

Commit e3afd91

Browse files
committed
build: Improve error messages and make updating Make.depends optional
1 parent 8aec0ee commit e3afd91

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

update-colvars-code.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ check_target_makefile() {
240240
local file=$1
241241
if [ -n "${GIT}" ] ; then
242242
if ! git -C $(dirname ${file}) diff --quiet ${file} ; then
243+
echo "File ${file} was modified"
243244
updated_makefile=$((${updated_makefile} || 1))
244245
fi
245246
else
@@ -363,8 +364,11 @@ then
363364
> "${target}/colvars/src/Makefile.namd"
364365
check_target_makefile "${target}/colvars/src/Makefile.namd"
365366

366-
# TODO automatically generate the file below as well
367-
condcopy "${source}/namd/colvars/Make.depends" "${target}/colvars/Make.depends"
367+
# Optionally copy over the Colvars library's Make.depends
368+
if [ -s "${source}/namd/colvars/Make.depends" ] ; then
369+
condcopy "${source}/namd/colvars/Make.depends" "${target}/colvars/Make.depends"
370+
check_target_makefile "${target}/colvars/Make.depends"
371+
fi
368372

369373
# Update NAMD interface files
370374
for src in \
@@ -425,7 +429,8 @@ then
425429

426430
# One last check that each file is correctly included in the dependencies
427431
for file in ${target}/colvars/src/*.{cpp,h} ; do
428-
if ! grep -q ${file} ${target}/colvars/Make.depends ; then
432+
if ! grep -q ${file#${target}/} ${target}/colvars/Make.depends ; then
433+
echo "File ${file#${target}/} is missing from the Colvars library's Make.depends"
429434
updated_makefile=1
430435
fi
431436
done

0 commit comments

Comments
 (0)