From a77bcd2180bd887eb3023fa8beacdba286ff2ee7 Mon Sep 17 00:00:00 2001
From: Simon Rose <simon.rose@ess.eu>
Date: Thu, 22 Oct 2020 14:30:15 +0200
Subject: [PATCH] Fixes bug where 'make debug' would cause a recompilation of
 the module

---
 App/tools/driver.makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/App/tools/driver.makefile b/App/tools/driver.makefile
index b52f7ebd..4c06c979 100644
--- a/App/tools/driver.makefile
+++ b/App/tools/driver.makefile
@@ -750,7 +750,12 @@ build: ${DEPFILE}
 INSTALL_LOADABLE_SHRLIBS=
 # Avoid installing *.munch to bin directory.
 INSTALL_MUNCHS=
-include ${BASERULES}
+
+# We ony want to include ${BASERULES} from EPICS base if we are /not/ in debug
+# mode. Including this causes all of the source files to be compiled!
+ifeq (,$(findstring debug,${MAKECMDGOALS}))
+include ${BASERULES} 
+endif
 
 # Fix incompatible release rules.
 RELEASE_DBDFLAGS = -I ${EPICS_BASE}/dbd
-- 
GitLab