Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • e3/wrappers/e3-require
  • waynelewis/e3-require
  • krisztianloki/e3-require
  • timokorhonen/e3-require
  • juntongliu/e3-require
  • roryclarke/e3-require
  • alfiorizzo/e3-require
  • lucasmagalhaes/e3-require
  • lucas-module-testgroup/e3-require
  • grzegorzkowalski/e3-require
  • anderslindh1/e3-require
11 results
Show changes
Commits on Source (260)
Showing
with 793 additions and 137 deletions
...@@ -17,6 +17,9 @@ core.* ...@@ -17,6 +17,9 @@ core.*
cellMods cellMods
*.log *.log
__pycache__ __pycache__
.iocsh_history
.gdb_history
venv
require-ess/require.Makefile require-ess/require.Makefile
require-ess/O.* require-ess/O.*
......
--- ---
variables:
E3_CI_MODIFIED_BASE_VERSION: "7.0.8.1-68332f4-20240917T140931" # strip the first part of the tag name - see E3-1529
stages: stages:
- check - check
- build - build
...@@ -9,15 +12,9 @@ default: ...@@ -9,15 +12,9 @@ default:
- docker - docker
image: registry.esss.lu.se/ics-docker/centos-e3:latest image: registry.esss.lu.se/ics-docker/centos-e3:latest
include:
### stage: check - project: "ics-infrastructure/gitlab-ci-yml"
file: "PreCommit.gitlab-ci.yml"
run pre-commit:
stage: check
image: registry.esss.lu.se/ics-docker/pre-commit:latest
script:
- pre-commit run --all-files
allow_failure: true
shellcheck: shellcheck:
image: pipelinecomponents/shellcheck:latest image: pipelinecomponents/shellcheck:latest
...@@ -40,12 +37,12 @@ shfmt: ...@@ -40,12 +37,12 @@ shfmt:
before_script: before_script:
- shfmt -version - shfmt -version
script: script:
- shfmt -i 2 -ci -d . # 2 spaces indent, indent switch-case statements, show diff (don't apply change) - shfmt -i 2 -ci -d . # 2 spaces indent, indent switch-case statements, show diff (don't apply change)
build require: build require:
stage: build stage: build
before_script: before_script:
- curl -L -o epics.tar.gz https://artifactory.esss.lu.se/artifactory/e3/epics-base-$E3_CI_BASE_VERSION.tar.gz - curl -L -o epics.tar.gz https://artifactory.esss.lu.se/artifactory/e3/epics-base-$E3_CI_MODIFIED_BASE_VERSION.tar.gz
- tar -zxvf epics.tar.gz - tar -zxvf epics.tar.gz
- export BASE_PATH=$(ls -d $(pwd)/epics/base-*) - export BASE_PATH=$(ls -d $(pwd)/epics/base-*)
- echo "EPICS_BASE:=${BASE_PATH}" >> configure/RELEASE.local - echo "EPICS_BASE:=${BASE_PATH}" >> configure/RELEASE.local
...@@ -66,6 +63,8 @@ test require: ...@@ -66,6 +63,8 @@ test require:
stage: test stage: test
before_script: before_script:
- source $(pwd)/epics/base-*/require/*/bin/activate - source $(pwd)/epics/base-*/require/*/bin/activate
# We need to allow file:// protocol for all of the tests to work
- git config --global procotol.file.allow always
script: script:
- make test - make test
needs: needs:
......
...@@ -17,3 +17,7 @@ repos: ...@@ -17,3 +17,7 @@ repos:
- id: end-of-file-fixer - id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
- id: check-yaml - id: check-yaml
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.0
hooks:
- id: clang-format
# CHANGELOG # CHANGELOG
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
...@@ -8,16 +9,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -8,16 +9,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### New Features ### New Features
* Remove `--realtime` option from `iocsh`
* Add timestamp for `LoadedModules`
* Deprecate `IOCNAME` environment variable in favour of `--iocname` argument for `iocsh`
* Add environment variable `E3_STRICT_CC`: if set to `YES` then driver.Makefile will
fail if a cross-compiler is missing
* Support for e3 on Mac OS (both intel and apple silicon)
### Bugfixes
* Decouple `build` and `install` targets
* Exit `iocsh` if file to run does not exist
* Add trigger mapping on `LoadedModules` to silence QSRV2 warning
* Silence warnings on submodule initialisation
* Automatically use cell path with `test` target (no longer any need to activate an environment as part of the test rule)
## [5.1.1]
### Bugfixes
* Fix memory leaks on IOC exit
* Fix dirty terminal after IOC exit for some distributions
* Fix crash when running `make test` without having activated an environment
* Resolve `E3_CMD_TOP` when a startup script is being run with `iocsh` (previously expanded to just `.`)
* Fix truncated errorlog messages
## [5.1.0]
### New Features
* Allow for module-specific build rules (see: sequencer) to be installed and used
within e3
* Automatically install LICENSE files with modules
* `afterInit` can now run commands of arbitrary length. Note: The syntax has changed from
```
afterInit foo bar baz
```
to
```
afterInit 'foo bar baz'
```
* Add NTTable PV for module and version information as `LoadedModules`
### Bugfixes ### Bugfixes
* Fixed an issue where .template and .substitutions files with the same name would build incorrectly * Fixed an issue where .template and .substitutions files with the same name would build incorrectly
* Fixed an issue where filenames with spaces in them that had been modified * Fixed an issue where filenames with spaces in them that had been modified
in the wrapper would cause all of the module `make` commands to fail. in the wrapper would cause all of the module `make` commands to fail.
* Removed a number of memory leaks found by valgrind
* Fixed issue where failure of one of the patches to apply wouldn't stop the build
* Fixed memory leak in `afterInit`
### Other changes ### Other changes
* Replaced `tclx` script to expand .dbd files with a python script * Rewrite `iocsh` converting it from being a shell script to a python (3.6) script
* Remove support for file extensions: `.so`, `.dbd`, `.db`, `.substitutions`, `.template`, `.iocsh`
* Remove support for `nice`
* Remove support for sequencer programs
* Remove optional argument passing to `gdb`
* Change the IOC shell to use both stdout and stderr (previously only stdout)
* Change default prompt
* Change fallback IOC-name (used when `IOCNAME` is not set)
* Multiple argument changes; e.g.
* Shortened argument for printing version and exit changed from `-v` to `-V`
* Make running IOC as realtime or with debuggers mutually exclusive
* Change how arguments are passed to `gdb` and `valgrind` (see help: `--help`)
* Removed `tclx` script to expand .dbd in favour of `dbdExpand.pl` from EPICS base
* Removed `hdrs` target. Note that this has been entirely replaced by the automatic db expansion. * Removed `hdrs` target. Note that this has been entirely replaced by the automatic db expansion.
* Removed ability to pass `args` to require (which have not been used within e3)
* Removed `require module,ifexists` option
* Stop require from looking in legacy locations for various files
* Rewrite internal linked list to have better memory safety
* Removed enabling of core dump generation and max file size limit to allow developers more flexibility (enable and set limit by calling `ulimit -S -c x` where x is max size in blocks before IOC startup)
* Remove `ARCH_FILTER` support; from now on, only `EXCLUDE_ARCHS` is used.
* Remove `setE3Env.bash` alias (for `activate`)
* Remove custom `dbLoadTemplate` in favour of the one supplied by EPICS base
* Note that this amounts to a change where double quotes (`"`) must be used in substitutions files when using macros in patterns
## [5.0.0] ## [5.0.0]
...@@ -199,7 +266,9 @@ of course pin a specific module version. If they do not, then the highest numeri ...@@ -199,7 +266,9 @@ of course pin a specific module version. If they do not, then the highest numeri
startup script startup script
[Unreleased]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/5.0.0...master [Unreleased]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/5.1.1...master
[5.1.1]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/5.1.0...5.1.1
[5.1.0]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/5.0.0...5.1.0
[5.0.0]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/4.0.0...5.0.0 [5.0.0]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/4.0.0...5.0.0
[4.0.0]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/3.4.1...4.0.0 [4.0.0]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/3.4.1...4.0.0
[3.4.1]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/3.4.0...3.4.1 [3.4.1]: https://gitlab.esss.lu.se/e3/e3-require/-/compare/3.4.0...3.4.1
......
Copyright (C) 2024 European Spallation Source ERIC
This 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 3 of the License, or
(at your option) any later 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 <http://www.gnu.org/licenses/>.
This diff is collapsed.
...@@ -26,8 +26,8 @@ include $(E3_REQUIRE_CONFIG)/CONFIG_REQUIRE ...@@ -26,8 +26,8 @@ include $(E3_REQUIRE_CONFIG)/CONFIG_REQUIRE
include $(E3_REQUIRE_CONFIG)/CONFIG_SHELL include $(E3_REQUIRE_CONFIG)/CONFIG_SHELL
include $(E3_REQUIRE_CONFIG)/CONFIG_E3_PATH include $(E3_REQUIRE_CONFIG)/CONFIG_E3_PATH
include $(E3_REQUIRE_CONFIG)/CONFIG_E3_MAKEFILE include $(E3_REQUIRE_CONFIG)/CONFIG_E3_MAKEFILE
include $(E3_REQUIRE_CONFIG)/CONFIG_E3_META
include $(E3_REQUIRE_CONFIG)/CONFIG_TEST include $(E3_REQUIRE_CONFIG)/CONFIG_TEST
include $(E3_REQUIRE_CONFIG)/CONFIG_EPICS
include $(E3_REQUIRE_CONFIG)/CONFIG_EXPORT include $(E3_REQUIRE_CONFIG)/CONFIG_EXPORT
# Exclude generated EPICS base variables from make vars report. # Exclude generated EPICS base variables from make vars report.
......
...@@ -10,10 +10,11 @@ include $(EPICS_BASE)/configure/CONFIG_BASE_VERSION ...@@ -10,10 +10,11 @@ include $(EPICS_BASE)/configure/CONFIG_BASE_VERSION
include $(E3_REQUIRE_CONFIG)/CONFIG_REQUIRE include $(E3_REQUIRE_CONFIG)/CONFIG_REQUIRE
include $(E3_REQUIRE_CONFIG)/CONFIG_SHELL include $(E3_REQUIRE_CONFIG)/CONFIG_SHELL
include $(E3_REQUIRE_CONFIG)/CONFIG_CELL include $(E3_REQUIRE_CONFIG)/CONFIG_CELL
include $(E3_REQUIRE_CONFIG)/CONFIG_PATCH
include $(E3_REQUIRE_CONFIG)/CONFIG_TEST include $(E3_REQUIRE_CONFIG)/CONFIG_TEST
include $(E3_REQUIRE_CONFIG)/CONFIG_E3_PATH include $(E3_REQUIRE_CONFIG)/CONFIG_E3_PATH
include $(E3_REQUIRE_CONFIG)/CONFIG_E3_MAKEFILE include $(E3_REQUIRE_CONFIG)/CONFIG_E3_MAKEFILE
include $(E3_REQUIRE_CONFIG)/CONFIG_EPICS include $(E3_REQUIRE_CONFIG)/CONFIG_E3_META
include $(E3_REQUIRE_CONFIG)/CONFIG_DKMS include $(E3_REQUIRE_CONFIG)/CONFIG_DKMS
include $(E3_REQUIRE_CONFIG)/CONFIG_EXPORT include $(E3_REQUIRE_CONFIG)/CONFIG_EXPORT
......
...@@ -2,24 +2,25 @@ ...@@ -2,24 +2,25 @@
# #
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS := -C $(E3_MODULE_SRC_PATH) E3_REQUIRE_MAKEFILE_INPUT_OPTIONS := -C $(E3_MODULE_SRC_PATH)
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += -f $(E3_MODULE_MAKEFILE) E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += -f ../$(E3_MODULE_MAKEFILE)
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += LIBVERSION="$(E3_MODULE_VERSION)" E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += LIBVERSION="$(E3_MODULE_VERSION)"
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += PROJECT="$(E3_MODULE_NAME)" E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += PROJECT="$(E3_MODULE_NAME)"
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += EPICS_MODULES="$(E3_MODULES_PATH)" E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += EPICS_MODULES="$(E3_MODULES_PATH)"
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += EPICS_LOCATION="$(EPICS_BASE)" E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += EPICS_LOCATION="$(EPICS_BASE)"
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += BUILDCLASSES="Linux"
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += E3_SITEMODS_PATH="$(E3_SITEMODS_PATH)" E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += E3_SITEMODS_PATH="$(E3_SITEMODS_PATH)"
ifeq ($(shell git status > /dev/null 2>&1; echo $$?),0) ifeq ($(shell git status > /dev/null 2>&1; echo $$?),0)
GIT_REMOTE_NAME := $(shell git remote | head -n 1) GIT_REMOTE_NAME := $(shell git remote | head -n 1)
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_DESC="$(shell git rev-parse HEAD 2> /dev/null || echo 'Not a git repository')" $(E3_MODULE_NAME)_E3_GIT_DESC="$(shell git rev-parse HEAD 2> /dev/null || echo 'Not a git repository')"
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_URL="$(shell git config --get remote.$(GIT_REMOTE_NAME).url 2> /dev/null | sed 's%^https://[^@]*@%https://%')" $(E3_MODULE_NAME)_E3_GIT_URL="$(shell git config --get remote.$(GIT_REMOTE_NAME).url 2> /dev/null | sed 's%^https://[^@]*@%https://%')"
else else
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_DESC= $(E3_MODULE_NAME)_E3_GIT_DESC=
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_URL= $(E3_MODULE_NAME)_E3_GIT_URL=
endif endif
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_DESC=$($(E3_MODULE_NAME)_E3_GIT_DESC)
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_URL=$($(E3_MODULE_NAME)_E3_GIT_URL)
E3_MODULE_MAKE_CMDS:=make $(E3_REQUIRE_MAKEFILE_INPUT_OPTIONS) E3_MODULE_MAKE_CMDS:=make $(E3_REQUIRE_MAKEFILE_INPUT_OPTIONS)
...@@ -28,3 +29,5 @@ E3_MODULE_MAKE_CMDS:=make $(E3_REQUIRE_MAKEFILE_INPUT_OPTIONS) ...@@ -28,3 +29,5 @@ E3_MODULE_MAKE_CMDS:=make $(E3_REQUIRE_MAKEFILE_INPUT_OPTIONS)
VARS_EXCLUDES+=E3_REQUIRE_MAKEFILE_INPUT_OPTIONS VARS_EXCLUDES+=E3_REQUIRE_MAKEFILE_INPUT_OPTIONS
VARS_EXCLUDES+=GIT_REMOTE_NAME VARS_EXCLUDES+=GIT_REMOTE_NAME
VARS_EXCLUDES+=$(E3_MODULE_NAME)_E3_GIT_URL
VARS_EXCLUDES+=$(E3_MODULE_NAME)_E3_GIT_DESC
EPICSVERSION = $(patsubst base-%,%,$(notdir $(EPICS_BASE)))
COMMON_DIR = $(TOP)/$(E3_MODULE_SRC_PATH)/O.$(EPICSVERSION)_Common
METAFILE = $(E3_MODULE_NAME)_meta.yaml
MODULE_INSTALL_LOCATION = $(E3_MODULES_PATH)/$(E3_MODULE_NAME)/$(E3_MODULE_VERSION)
COMMUNITY_EPICS_MODULES:=$(EPICS_BASE)/epics-modules
M_AUTOSAVE:=$(COMMUNITY_EPICS_MODULES)/autosave
M_DEVLIB2:=$(COMMUNITY_EPICS_MODULES)/devlib2
M_IOCSTATS:=$(COMMUNITY_EPICS_MODULES)/iocStats
M_ASYN:=$(COMMUNITY_EPICS_MODULES)/asyn
M_BUSY:=$(COMMUNITY_EPICS_MODULES)/busy
M_MODBUS:=$(COMMUNITY_EPICS_MODULES)/modbus
M_MRFIOC2:=$(COMMUNITY_EPICS_MODULES)/mrfioc2
M_LUA:=$(COMMUNITY_EPICS_MODULES)/lua
M_IPMICOMM:=$(COMMUNITY_EPICS_MODULES)/ipmiComm
M_STREAM:=$(COMMUNITY_EPICS_MODULES)/stream
M_CALC:=$(COMMUNITY_EPICS_MODULES)/calc
M_MOTOR:=$(COMMUNITY_EPICS_MODULES)/motor
M_SSCAN:=$(COMMUNITY_EPICS_MODULES)/sscan
M_SNCSEQ:=$(COMMUNITY_EPICS_MODULES)/seq
M_IP:=$(COMMUNITY_EPICS_MODULES)/ip
M_IPAC:=$(COMMUNITY_EPICS_MODULES)/ipac
M_ADSUPPORT:=$(COMMUNITY_EPICS_MODULES)/adsupport
M_ADCORE:=$(COMMUNITY_EPICS_MODULES)/adcore
M_OPCUA:=$(COMMUNITY_EPICS_MODULES)/opcua
export M_AUTOSAVE
export M_DEVLIB2
export M_IOCSTATS
export M_ASYN
export M_BUSY
export M_MODBUS
export M_MRFIOC2
export M_LUA
export M_IPMICOMM
export M_STREAM
export M_CALC
export M_MOTOR
export M_SSCAN
export M_SNCSEQ
export M_IP
export M_IPAC
export M_ADSUPPORT
export M_ADCORE
export M_OPCUA
## This is needed since the target "epics" (in configure/RULES_MODULE in most modules)
## uses SUDOBASH to run the make process
SUDOBASH := bash -c
### Exclude the following variables to display
VARS_EXCLUDES+=COMMUNITY_EPICS_MODULES
VARS_EXCLUDES+=M_AUTOSAVE
VARS_EXCLUDES+=M_DEVLIB2
VARS_EXCLUDES+=M_IOCSTATS
VARS_EXCLUDES+=M_ASYN
VARS_EXCLUDES+=M_BUSY
VARS_EXCLUDES+=M_MODBUS
VARS_EXCLUDES+=M_MRFIOC2
VARS_EXCLUDES+=M_LUA
VARS_EXCLUDES+=M_IPMICOMM
VARS_EXCLUDES+=M_STREAM
VARS_EXCLUDES+=M_CALC
VARS_EXCLUDES+=M_MOTOR
VARS_EXCLUDES+=M_SSCAN
VARS_EXCLUDES+=M_SNCSEQ
VARS_EXCLUDES+=M_IP
VARS_EXCLUDES+=M_IPAC
VARS_EXCLUDES+=M_ADSUPPORT
VARS_EXCLUDES+=M_ADCORE
VARS_EXCLUDES+=M_OPCUA
VARS_EXCLUDES+=SUDOBASH
...@@ -10,6 +10,7 @@ EXPORT_VARS+=MSI ...@@ -10,6 +10,7 @@ EXPORT_VARS+=MSI
EXPORT_VARS+=E3_MODULE_NAME EXPORT_VARS+=E3_MODULE_NAME
EXPORT_VARS+=E3_MODULE_VERSION EXPORT_VARS+=E3_MODULE_VERSION
EXPORT_VARS+=E3_SITEMODS_PATH EXPORT_VARS+=E3_SITEMODS_PATH
EXPORT_VARS+=E3_MODULES_PATH
EXPORT_VARS+=$(filter E3_REQUIRE_%,$(.VARIABLES)) EXPORT_VARS+=$(filter E3_REQUIRE_%,$(.VARIABLES))
EXPORT_VARS+=QUIET EXPORT_VARS+=QUIET
......
# We want to sort these alphabetically to allow for defined ordering of application of patches.
# Note that make 4.3 onwards sorts correctly, but not necessarily the version we use.
PATCHES:=$(shell ls $(TOP)/patch/*.p0.patch 2> /dev/null)
TEST_DIR:=$(TOP)/tests TEST_DIR:=$(TOP)/tests
RUN_IOCSH_TEST_COMMAND = run-iocsh --name "${EPICS_BASE}/require/${E3_REQUIRE_VERSION}/bin/iocsh" -r "$(E3_MODULE_NAME),$(E3_MODULE_VERSION)" -l $(TEMP_CELL_PATH) RUN_IOCSH_TEST_COMMAND = run-iocsh -r "$(E3_MODULE_NAME),$(E3_MODULE_VERSION)"
TEMP_CELL_PATH := $(TOP)/testMods-$(shell date +"%y%m%d%H%M%S") TEMP_CELL_PATH := $(TOP)/testMods-$(shell date +"%y%m%d%H%M%S")
RMDIR = $(RM) -rf RMDIR = $(RM) -rf
...@@ -11,8 +11,8 @@ VARS_EXCLUDES+=RMDIR ...@@ -11,8 +11,8 @@ VARS_EXCLUDES+=RMDIR
VARS_EXCLUDES+=TEMP_CELL_PATH VARS_EXCLUDES+=TEMP_CELL_PATH
ifneq (,$(findstring test,$(MAKECMDGOALS))) ifneq (,$(findstring test,$(MAKECMDGOALS)))
TEST_DEBUG_ARCH:=$(if $(and $(findstring debug,$(EPICS_HOST_ARCH)),$(wildcard $(EPICS_BASE)/bin/$(EPICS_HOST_ARCH)/softIocPVA)),$(EPICS_HOST_ARCH))
EXPORT_VARS+=TEST_DEBUG_ARCH
E3_MODULES_PATH=$(TEMP_CELL_PATH)/$(notdir $(EPICS_BASE))/require-$(E3_REQUIRE_VERSION) E3_MODULES_PATH=$(TEMP_CELL_PATH)/$(notdir $(EPICS_BASE))/require-$(E3_REQUIRE_VERSION)
# We have to do the export here since the sub-processes - like run-iocsh - otherwise would not inherit the variable
export EPICS_DRIVER_PATH:=$(E3_MODULES_PATH):$(EPICS_DRIVER_PATH)
PATH:=$(EPICS_BASE)/require/$(E3_REQUIRE_VERSION)/bin:$(PATH)
endif endif
# Keep always the module up-to-date # Keep always the module up-to-date
define git_update = define git_update
git submodule deinit -f $@/ rm -rf $(TOP)/$@
rm -rf $(TOP)/.git/modules/$@
git submodule init $@/ git submodule init $@/
git submodule update --init --recursive $@/. git submodule update --init --recursive $@/.
git submodule update --remote --merge $@/ git submodule update --remote --merge $@/
endef endef
define git_module_init_update =
git submodule update --init --recursive $@/.
git submodule update --remote --merge $@/
endef
define patch_site define patch_site
patches=$$(ls $(TOP)/patch/*.p0.patch 2> /dev/null); \ patches=$$(ls $(TOP)/patch/*.p0.patch 2> /dev/null); \
if [ -n "$$patches" ]; then \ if [ -n "$$patches" ]; then \
...@@ -42,7 +36,6 @@ endif ...@@ -42,7 +36,6 @@ endif
### Exclude the following variables to display ### Exclude the following variables to display
VARS_EXCLUDES+=git_update VARS_EXCLUDES+=git_update
VARS_EXCLUDES+=git_module_init_update
VARS_EXCLUDES+=patch_site VARS_EXCLUDES+=patch_site
VARS_EXCLUDES+=patch_revert_site VARS_EXCLUDES+=patch_revert_site
VARS_EXCLUDES+=QUIET VARS_EXCLUDES+=QUIET
......
.PHONY: cellbuild .PHONY: cellbuild
## Builds the module while also searching in $(E3_CELL_PATH) for dependencies ## Builds the module while also searching in $(E3_CELL_PATH) for dependencies
cellbuild: build cellbuild: ${COMMON_DIR}/${METAFILE}
.PHONY: cellinstall .PHONY: cellinstall
## Installs the module in a local directory $(E3_CELL_PATH) ## Installs the module in a local directory $(E3_CELL_PATH)
......
# -*- mode: Makefile;-*- # -*- mode: Makefile;-*-
ifneq ($(E3_LOCAL_SOURCE),1) ifneq ($(E3_LOCAL_SOURCE),1)
.PHONY: devvars devenv devinit devbuild devclean devinstall devrebuild devuninstall devdistclean devconf devepics devepics-clean devepics-distclean devpatch devpatchrevert devexistent devdep devvers .PHONY: devvars devenv devinit devbuild devclean devinstall devrebuild devuninstall devdistclean devconf devepics devepics-clean devepics-distclean devpatch devexistent devdep devvers
devvars: vars devvars: vars
...@@ -30,7 +30,6 @@ devepics: nonexists ...@@ -30,7 +30,6 @@ devepics: nonexists
devepics-clean: nonexists devepics-clean: nonexists
devepics-distclean: nonexists devepics-distclean: nonexists
devpatch: nonexists devpatch: nonexists
devpatchrevert: nonexists
devexistent: nonexists devexistent: nonexists
devdep: nonexists devdep: nonexists
devvers: nonexists devvers: nonexists
...@@ -66,7 +65,6 @@ devepics: epics ...@@ -66,7 +65,6 @@ devepics: epics
devepics-clean: epics-clean devepics-clean: epics-clean
devepics-distclean: epics-distclean devepics-distclean: epics-distclean
devpatch: patch devpatch: patch
devpatchrevert: patchrevert
devexistent: existent devexistent: existent
devdep: dep devdep: dep
devvers: vers devvers: vers
......
...@@ -3,10 +3,13 @@ ...@@ -3,10 +3,13 @@
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
.PHONY: help default install uninstall build rebuild clean conf all prebuild .PHONY: help default install uninstall build rebuild clean all prebuild
default: help default: help
# Include some checks before build happens
include $(E3_REQUIRE_CONFIG)/RULES_CHECKS
# # help is defined in # # help is defined in
# # https://gist.github.com/rcmachado/af3db315e31383502660 # # https://gist.github.com/rcmachado/af3db315e31383502660
help: help:
...@@ -35,48 +38,57 @@ db: err_no_db_rule ...@@ -35,48 +38,57 @@ db: err_no_db_rule
err_no_db_rule: 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) $(error The 'db' target has been discontinued. If you have custom database expansion rule to use, please contact the e3 team)
# Decouple build and install targets by using metadata file generated during
# build as install prerequisite.
# The metadata file target cannot depend on build, since its phony nature will
# trigger the rebuild anyway. Instead, the metadata file is created as a side
# effect of running the build target in separate make process.
${COMMON_DIR}/${METAFILE}:
$(QUIET) $(MAKE) build
## Install module to $(E3_MODULES_INSTALL_LOCATION) ## Install module to $(E3_MODULES_INSTALL_LOCATION)
install: build install: ${COMMON_DIR}/${METAFILE}
$(QUIET) $(E3_MODULE_MAKE_CMDS) install $(QUIET) $(E3_MODULE_MAKE_CMDS) install
@echo "Installing metadata file $(MODULE_INSTALL_LOCATION)/${METAFILE}"
$(QUIET) install -m444 ${COMMON_DIR}/${METAFILE} ${MODULE_INSTALL_LOCATION}
.PHONY: check_uninstall .PHONY: check_uninstall
check_uninstall: check_uninstall:
## Uninstall the current module ## Uninstall the current module
uninstall: check_uninstall conf uninstall: check_uninstall
$(QUIET) $(E3_MODULE_MAKE_CMDS) uninstall $(QUIET) $(E3_MODULE_MAKE_CMDS) uninstall
## Build current module ## Build current module
build: conf checkout prebuild db_internal build: consistency_checks checkout prebuild db_internal
$(QUIET) $(E3_MODULE_MAKE_CMDS) build $(QUIET) $(E3_MODULE_MAKE_CMDS) build
@echo "Populating metadata file ${COMMON_DIR}/${METAFILE}"
@echo "wrapper_url: '$(${E3_MODULE_NAME}_E3_GIT_URL)'" > ${COMMON_DIR}/${METAFILE}
@echo "wrapper_git_desc: '$(${E3_MODULE_NAME}_E3_GIT_DESC)'" >> ${COMMON_DIR}/${METAFILE}
@echo "module_git_desc: '$(shell git rev-parse HEAD 2> /dev/null)'" >> ${COMMON_DIR}/${METAFILE}
## Run module-specific commands before building ## Run module-specific commands before building
prebuild: conf prebuild: consistency_checks
$(QUIET) $(E3_MODULE_MAKE_CMDS) prebuild $(QUIET) $(E3_MODULE_MAKE_CMDS) prebuild
## Displays information about the build process ## Displays information about the build process
debug: conf debug:
$(QUIET) $(E3_MODULE_MAKE_CMDS) debug $(QUIET) $(E3_MODULE_MAKE_CMDS) debug
.PHONY: db_internal .PHONY: db_internal
db_internal: conf db_internal: consistency_checks
$(QUIET) $(E3_MODULE_MAKE_CMDS) db_internal $(QUIET) $(E3_MODULE_MAKE_CMDS) db_internal
## Clean, build, and install the current module ## Clean, build, and install the current module
rebuild: clean build install rebuild: clean build install
## Deletes temporary build files ## Deletes temporary build files
clean: conf clean:
$(QUIET) $(E3_MODULE_MAKE_CMDS) clean $(QUIET) $(E3_MODULE_MAKE_CMDS) clean
## Initializes, patches, builds, and installs ## Initializes, patches, builds, and installs
all: init patch rebuild all: init patch rebuild
# Copy $(E3_MODULE_MAKEFILE) into $(E3_MODULE_SRC_PATH)
include $(E3_REQUIRE_CONFIG)/RULES_CHECKS
conf: consistency_checks
$(QUIET) install -p -m 644 $(TOP)/$(E3_MODULE_MAKEFILE) $(E3_MODULE_SRC_PATH)/
.PHONY: init git-submodule-sync $(E3_MODULE_SRC_PATH) checkout .PHONY: init git-submodule-sync $(E3_MODULE_SRC_PATH) checkout
ifeq (,$(strip $(EPICS_MODULE_TAG))) ifeq (,$(strip $(EPICS_MODULE_TAG)))
......
# One should define the any dependency modules and EPICS base path
# in the following directory
.PHONY: epics-clean epics-distclean
epics-clean:
$(MAKE) -C $(E3_MODULE_SRC_PATH) clean
epics-distclean:
$(MAKE) -C $(E3_MODULE_SRC_PATH) distclean
.PHONY: patch patchrevert .PHONY: patch
## Apply Patch Files ## Apply Patch Files
patch: patch:
$(QUIET) $(call patch_site)
## Revert Patch Files define PATCH_TEMPLATE
patchrevert: patch: $1
$(QUIET) $(call patch_revert_site) .PHONY: $1
$1:
@echo "Applying patch $$@"
git apply --directory=$$(E3_MODULE_SRC_PATH) --ignore-whitespace -p0 $$@
endef
ifneq ($(strip $(PATCHES)),)
$(foreach patch,$(PATCHES),$(eval $(call PATCH_TEMPLATE,$(patch))))
else
patch:
@echo "No patches to apply"
endif