From d5162f060a7fe3f374759cd056f587ac9b3445ed Mon Sep 17 00:00:00 2001
From: Simon Rose <simon.rose@ess.eu>
Date: Thu, 13 Oct 2022 15:27:22 +0200
Subject: [PATCH] E3-1024: Expand TMPS and SUBS at build time

---
 configure/E3/RULES_E3 |  4 ++--
 require.Makefile      | 13 -------------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/configure/E3/RULES_E3 b/configure/E3/RULES_E3
index 82dda913..1557dc26 100644
--- a/configure/E3/RULES_E3
+++ b/configure/E3/RULES_E3
@@ -39,7 +39,7 @@ err_no_db_rule:
 	$(error The 'db' target has been discontinued. If you have custom database expansion rule to use, please contact the e3 team)
 
 .PHONY: install_module
-install_module: build db_internal
+install_module: build
 	$(QUIET) $(E3_MODULE_MAKE_CMDS) install
 
 .PHONY: check_uninstall
@@ -50,7 +50,7 @@ uninstall: check_uninstall conf
 	$(QUIET) $(E3_MODULE_MAKE_CMDS) uninstall
 
 ## Build current module
-build: conf checkout prebuild
+build: conf checkout prebuild db_internal
 	$(QUIET) $(E3_MODULE_MAKE_CMDS) build
 
 ## Run module-specific commands before building
diff --git a/require.Makefile b/require.Makefile
index 3cf2f10e..d07f4117 100644
--- a/require.Makefile
+++ b/require.Makefile
@@ -85,20 +85,7 @@ dbLoadTemplate.c: dbLoadTemplate_lex.c ../$(APPSRC)/dbLoadTemplate.h
 # So, ESS uses it internally independent upon any IOC
 # variables
 #
-EPICS_BASE_HOST_BIN = $(EPICS_BASE)/bin/$(EPICS_HOST_ARCH)
-MSI =  $(EPICS_BASE_HOST_BIN)/msi
-
 USR_DBFLAGS += -I . -I ..
 USR_DBFLAGS += -I$(EPICS_BASE)/db
 
 TMPS = $(wildcard $(APPDB)/*.template)
-
-.PHONY: db
-db: $(TMPS)
-
-.PHONY: $(TMPS)
-$(TMPS):
-	@printf "Inflating database ... %44s >>> %40s \n" "$@" "$(basename $(@)).db"
-	@rm -f  $(basename $(@)).db.d  $(basename $(@)).db
-	@$(MSI) -D $(USR_DBFLAGS) -o $(basename $(@)).db $@  > $(basename $(@)).db.d
-	@$(MSI)    $(USR_DBFLAGS) -o $(basename $(@)).db $@
-- 
GitLab