From 1288e61f45b08fb01cd8b6b780d3c74d20d96c57 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Wed, 19 Aug 2020 17:53:42 +0100
Subject: [PATCH] MNT: Expand wildcard patterns in _x_install to absorb
 non-existent default values (e.g. HFILES = *.h)

---
 config/common/rules.mk |  2 +-
 config/common/vars.mk  | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/config/common/rules.mk b/config/common/rules.mk
index c4d88af..1ff53fb 100644
--- a/config/common/rules.mk
+++ b/config/common/rules.mk
@@ -57,7 +57,7 @@ master-install-script:
 #  - $3: Permission mask to apply to all installed files (e.g. 0755)
 #  - $4: Space-separated list of target files/directories to install
 define _x_install =
-	if [ ! -d $(2) ] && echo $(4) | grep -e "^ *$$"; then \
+	if ! echo $(wildcard $(4)) | grep -q -e "^ *$$"; then \
 		echo Installing $(1) ; \
 		${MKDIR} -p -m 0755 $(2) ; \
 	fi
diff --git a/config/common/vars.mk b/config/common/vars.mk
index ebe67f4..afd77a7 100644
--- a/config/common/vars.mk
+++ b/config/common/vars.mk
@@ -22,8 +22,7 @@ CUDALIBS        = # Project-specific libraries to link against for CUDA
                   # CUDALDFLAGS, below.
 
 # Project outputs - these variables control
-# what gets installed from a project. The
-# values given below are the defaults - they
+# what gets installed from a project. They
 # may be customised/overridden in project
 # Makefiles.
 HFILES       = *.h    # installed into $FSLDIR/include/$PROJNAME/
@@ -38,10 +37,10 @@ FSCRIPTS     =        # installed into $FSLDIR/bin/, only for internal builds
 RUNTCLS      =        # link to Runtcl created in $FSLDIR/bin/ which assumes
                       # that <file>.tcl has been installed into
                       # $FSLDIR/tcl/
-PYFILES   = *.py      # installed into $FSLDIR/etc/fsl/python/$PROJNAME/
-TCLFILES  = *.tcl     # installed into $FSLDIR/tcl/
-DATAFILES =           # installed into $FSLDIR/data/$PROJNAME/
-TESTXILES =           # not currently used
+PYFILES      = *.py   # installed into $FSLDIR/etc/fsl/python/$PROJNAME/
+TCLFILES     = *.tcl  # installed into $FSLDIR/tcl/
+DATAFILES    =        # installed into $FSLDIR/data/$PROJNAME/
+TESTXILES    =        # not currently used
 
 # Final install destinations
 # for project outputs
-- 
GitLab