diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..d33a28e104b27f174a4e2414b1ee7f2651d98bf5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "require"] + path = require + url = https://github.com/paulscherrerinstitute/require + ignore = all diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..064c10990e62424575ef9f809076ef201074a310 --- /dev/null +++ b/Makefile @@ -0,0 +1,106 @@ +# +# Copyright (c) 2017 - Present European Spallation Source ERIC +# +# The program is free software: you can redistribute +# it and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 2 of the +# License, or any newer version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt +# +# Author : Jeong Han Lee +# email : han.lee@esss.se +# Date : Tuesday, September 26 17:17:47 CEST 2017 +# version : 0.0.1 +# + + +TOP = $(CURDIR) + + +include $(TOP)/configure/CONFIG + +M_DIRS:=$(sort $(dir $(wildcard $(TOP)/*/.))) + +# help is defined in +# https://gist.github.com/rcmachado/af3db315e31383502660 +help: + $(info --------------------------------------- ) + $(info Available targets) + $(info --------------------------------------- ) + @awk '/^[a-zA-Z\-\_0-9]+:/ { \ + nb = sub( /^## /, "", helpMsg ); \ + if(nb == 0) { \ + helpMsg = $$0; \ + nb = sub( /^[^:]*:.* ## /, "", helpMsg ); \ + } \ + if (nb) \ + print $$1 "\t" helpMsg; \ + } \ + { helpMsg = $$0 }' \ + $(MAKEFILE_LIST) | column -ts: + +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' + + + +## Build EPICS Module in order to use it with EEE +build: + make -C $(EPICS_MODULE_SRC_PATH) 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 + + +## Distclean EPICS Module in terms of EEE Makefile (module.Makefile) +distclean: + make -C $(EPICS_MODULE_SRC_PATH) LIBVERSION=$(LIBVERSION) PROJECT=$(EPICS_MODULE_NAME) distclean + + +## Get EPICS Module, and change its $(EPICS_MODULE_TAG) +init: + @git submodule deinit -f $(EPICS_MODULE_NAME)/ + 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) + + +## Print ENV variables +env: + @echo "" + @echo "EPICS_BASE : "$(EPICS_BASE) + + @echo "EPICS_MODULE_NAME : "$(EPICS_MODULE_NAME) + @echo "EPICS_MODULE_TAG : "$(EPICS_MODULE_TAG) + @echo "EPICS_MODULE_SRC_PATH : "$(EPICS_MODULE_SRC_PATH) + @echo "ESS_MODULE_MAKEFILE : "$(ESS_MODULE_MAKEFILE) + @echo "PROJECT : "$(PROJECT) + @echo "LIBVERSION : "$(LIBVERSION) + + @echo "" + @echo "EPICS_BASES_PATH : "$(EPICS_BASES_PATH) + @echo "EPICS_MODULES_PATH : "$(EPICS_MODULES_PATH) + @echo "EPICS_HOST_ARCH : "$(EPICS_HOST_ARCH) + @echo "EPICS_ENV_PATH : "$(EPICS_ENV_PATH) + @echo "" + + + +dirs: + @echo $(M_DIRS) || true + + +.PHONY: install build clean distclean init env dirs diff --git a/config b/config new file mode 100644 index 0000000000000000000000000000000000000000..caab056372f29281cd60f86e6f309a090846208c --- /dev/null +++ b/config @@ -0,0 +1,13 @@ +# PROJECT and LIBVERSION should be defined in the makefile arguments +# * this conf file should be in require/App/tools in order to override the default envs for driver.makefile +# * selected EPICS VERSIONS should be defined +# * each BASE should has startup dir and EpicsHostArch.pl +# * EPICS_MODULES is the target location of the epics modules (dynamically updated) +# * EPICS_LOCATION is the target location of the epics bases (dynamically updated) +DEFAULT_EPICS_VERSIONS = 3.15.4 3.15.5 +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/configure/CONFIG b/configure/CONFIG new file mode 100644 index 0000000000000000000000000000000000000000..2eaf49abe962e990440562ff60717ea8602273a8 --- /dev/null +++ b/configure/CONFIG @@ -0,0 +1,51 @@ +# (EPICS) EPICS_MODULE_NAME +# The EPICS community MODULE name. +# For example, https://github.com/epics-module/devlib2 +# devlib2 is EPICS_MODULE_NAME +# +EPICS_MODULE_NAME:=require + +# (EPICS) EPICS_MODULE_TAG +# The EPICS community tag number, which we would like to install +# within ESS EPICS Environment (ESS) + +# export EPICS_MODULE_TAG:=2.9 + +# (LOCAL) EPICS_MODULE_PATH +# Usually, it is the directory in $(TOP), after cloning the repository +# However, some modules from ESS have the weird directory structure. +# If one use the cloned directory, one should define the proper source +# directory path in $(ESS_MODULE_MAKEFILE) +export EPICS_MODULE_SRC_PATH:=$(EPICS_MODULE_NAME) + + + +# (LOCAL) ESS_MODULE_MAKEFILE +# The very strange and additional Makefile for EPICS_MODULE_NAME, which +# should be maintained according to main repository evolving. +# some export variables in CONFIG file +# in order to build and install for EEE +ESS_MODULE_MAKEFILE:=$(EPICS_MODULE_NAME).Makefile + +# (EEE) PROJECT +# it is the jargon of EEE, the EEE generic makefile uses it +# as the installation directory, and it will be used in the iocsh script +# with the require commands, for example +# require $(PROJECT),$(LIBVERSION) +export PROJECT:=$(EPICS_MODULE_NAME) + +# (EEE) LIBVERSION +# it is the jargon of EEE, the EEE generic makefile uses it +# 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 + + +# It may be the sole reason why we have so many troubles related with +# module version mismatch within the current EEE +# +# export USR_DEPENDENCIES += devlib2,2.9.0 + + + diff --git a/require b/require new file mode 160000 index 0000000000000000000000000000000000000000..ab1def76f99992d9723725c28a8c3c4eacbee459 --- /dev/null +++ b/require @@ -0,0 +1 @@ +Subproject commit ab1def76f99992d9723725c28a8c3c4eacbee459