From ab446beb6620abba84dc5cb27a9bdbb47f025f46 Mon Sep 17 00:00:00 2001
From: Jeong Han Lee <jeonghan.lee@gmail.com>
Date: Mon, 2 Oct 2017 17:54:17 +0200
Subject: [PATCH] workaround for notouch in require module

---
 Makefile                           | 21 +++++++++++++-------
 configure/CONFIG                   |  4 ++--
 config => configure/require_config |  2 --
 require.Makefile                   | 32 ++++++++++++++++++++++++++++++
 4 files changed, 48 insertions(+), 11 deletions(-)
 rename config => configure/require_config (99%)
 create mode 100644 require.Makefile

diff --git a/Makefile b/Makefile
index 064c1099..4b8d6b11 100644
--- a/Makefile
+++ b/Makefile
@@ -51,22 +51,22 @@ default: help
 #
 ## Install  "Require" EPICS Module in order to use it
 install:
-	sudo -E bash -c 'make -C $(EPICS_MODULE_SRC_PATH) LIBVERSION=$(LIBVERSION) PROJECT=$(EPICS_MODULE_NAME) install'
+	sudo -E bash -c 'make -C $(EPICS_MODULE_SRC_PATH) -f $(ESS_MODULE_MAKEFILE) LIBVERSION=$(LIBVERSION) PROJECT=$(EPICS_MODULE_NAME) install'
 
 
 
 ## Build     EPICS Module in order to use it with EEE
-build: 
-	make -C $(EPICS_MODULE_SRC_PATH) LIBVERSION=$(LIBVERSION) PROJECT=$(EPICS_MODULE_NAME)
+build: conf
+	make -C $(EPICS_MODULE_SRC_PATH) -f $(ESS_MODULE_MAKEFILE) LIBVERSION=$(LIBVERSION) PROJECT=$(EPICS_MODULE_NAME)
 
 ## Clean     EPICS Module in terms of EEE Makefile (module.Makefile)
 clean:
-	make -C $(EPICS_MODULE_SRC_PATH) LIBVERSION=$(LIBVERSION) PROJECT=$(EPICS_MODULE_NAME) clean
+	make -C $(EPICS_MODULE_SRC_PATH) -f $(ESS_MODULE_MAKEFILE) LIBVERSION=$(LIBVERSION) PROJECT=$(EPICS_MODULE_NAME) clean
 
 
 ## Distclean EPICS Module in terms of EEE Makefile (module.Makefile)
 distclean:
-	make -C $(EPICS_MODULE_SRC_PATH) LIBVERSION=$(LIBVERSION) PROJECT=$(EPICS_MODULE_NAME) distclean
+	make -C $(EPICS_MODULE_SRC_PATH) -f $(ESS_MODULE_MAKEFILE) LIBVERSION=$(LIBVERSION) PROJECT=$(EPICS_MODULE_NAME) distclean
 
 
 ## Get      EPICS Module, and change its $(EPICS_MODULE_TAG)
@@ -75,7 +75,7 @@ init:
 	git submodule deinit -f $(EPICS_MODULE_NAME)/	
 	git submodule init $(EPICS_MODULE_NAME)/
 	git submodule update --init --remote --recursive $(EPICS_MODULE_NAME)/.
-#	cd $(EPICS_MODULE_NAME) && git checkout tags/$(EPICS_MODULE_TAG)
+	cd $(EPICS_MODULE_NAME) && git checkout tags/$(EPICS_MODULE_TAG)
 
 
 ## Print ENV variables
@@ -102,5 +102,12 @@ env:
 dirs:
 	@echo $(M_DIRS) || true
 
+conf:
 
-.PHONY: install build clean distclean init env dirs
+	@install -m 664 $(TOP)/configure/require_config $(EPICS_MODULE_SRC_PATH)/App/tools/config
+	@install -m 644 $(TOP)/$(ESS_MODULE_MAKEFILE)   $(EPICS_MODULE_SRC_PATH)/
+#	@sudo install -d -m 755 /ioc/tools/
+#	@sudo install -m 755 $(TOP)/App/tools/* /ioc/tools/*
+#	@sudo install -m 664 $(TOP)/configure/require_config  /ioc/tools/config
+
+.PHONY: install build clean distclean init env dirs conf
diff --git a/configure/CONFIG b/configure/CONFIG
index 2eaf49ab..32b1e322 100644
--- a/configure/CONFIG
+++ b/configure/CONFIG
@@ -9,7 +9,7 @@ EPICS_MODULE_NAME:=require
 # The EPICS community tag number, which we would like to install
 # within ESS EPICS Environment (ESS)
 
-# export EPICS_MODULE_TAG:=2.9
+export EPICS_MODULE_TAG:=require_2_5_3
 
 # (LOCAL) EPICS_MODULE_PATH
 # Usually, it is the directory in $(TOP), after cloning the repository
@@ -39,7 +39,7 @@ export PROJECT:=$(EPICS_MODULE_NAME)
 # as the epics module version, and it will be used in the iocsh script 
 # with the require commands, for example
 # require $(PROJECT),$(LIBVERSION)
-export LIBVERSION:=2.5.3-pre0
+export LIBVERSION:=2.5.3
 
 
 # It may be the sole reason why we have so many troubles related with
diff --git a/config b/configure/require_config
similarity index 99%
rename from config
rename to configure/require_config
index caab0563..45f74d22 100644
--- a/config
+++ b/configure/require_config
@@ -9,5 +9,3 @@ BUILDCLASSES =
 EPICS_MODULES = /eee/modules
 MODULE_LOCATION = ${EPICS_MODULES}/$(or ${PRJ},$(error PRJ not defined))/$(or ${LIBVERSION},$(error LIBVERSION not defined))
 EPICS_LOCATION = /eee/bases
-
-
diff --git a/require.Makefile b/require.Makefile
new file mode 100644
index 00000000..097cc120
--- /dev/null
+++ b/require.Makefile
@@ -0,0 +1,32 @@
+
+where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
+
+include ${where_am_I}/App/tools/driver.makefile
+
+BUILDCLASSES += Linux
+
+SOURCES += require.c
+DBDS    += require.dbd
+SOURCES += runScript.c
+DBDS    += runScript.dbd
+
+SOURCES += dbLoadTemplate.y
+DBDS    += dbLoadTemplate.dbd
+
+SOURCES_T2 += strdup.c
+SOURCES_vxWorks   += asprintf.c
+HEADERS += strdup.h asprintf.h
+HEADERS += require.h
+
+# We need to find the Linux link.h before the EPICS link.h
+USR_INCLUDES_Linux=-idirafter ${EPICS_BASE}/include 
+
+# Pass T_A to the code
+USR_CFLAGS += -DT_A=${T_A}
+
+# This should really go into some global WIN32 config file
+USR_CFLAGS_WIN32 += /D_WIN32_WINNT=0x501
+
+dbLoadTemplate.c: dbLoadTemplate_lex.c ../dbLoadTemplate.h
+
+
-- 
GitLab