Skip to content
Snippets Groups Projects
Commit 34e53bef authored by Simon Rose's avatar Simon Rose
Browse files

Merge branch 'e3_186' into 'master'

E3-186: Combine configure/E3 and configure/modules

See merge request e3/e3-require!56
parents f791e51c 49e1b87a
No related branches found
No related tags found
No related merge requests found
Showing
with 152 additions and 63 deletions
...@@ -18,15 +18,17 @@ include $(TOP)/configure/CONFIG_MODULE ...@@ -18,15 +18,17 @@ include $(TOP)/configure/CONFIG_MODULE
endif endif
E3_MODULES_PATH:=$(EPICS_BASE)
REQUIRE_CONFIG:=$(TOP)/configure/E3
include $(EPICS_BASE)/configure/CONFIG_BASE_VERSION include $(EPICS_BASE)/configure/CONFIG_BASE_VERSION
include $(TOP)/configure/E3/CONFIG_REQUIRE include $(REQUIRE_CONFIG)/CONFIG_REQUIRE
include $(TOP)/configure/E3/CONFIG_SHELL include $(REQUIRE_CONFIG)/CONFIG_SHELL
include $(TOP)/configure/E3/CONFIG_E3_PATH include $(REQUIRE_CONFIG)/CONFIG_E3_PATH
include $(TOP)/configure/E3/CONFIG_E3_MAKEFILE include $(REQUIRE_CONFIG)/CONFIG_E3_MAKEFILE
include $(TOP)/configure/E3/CONFIG_EPICS include $(REQUIRE_CONFIG)/CONFIG_TEST
include $(TOP)/configure/E3/CONFIG_EXPORT include $(REQUIRE_CONFIG)/CONFIG_EPICS
include $(TOP)/configure/E3/CONFIG_TEST include $(REQUIRE_CONFIG)/CONFIG_EXPORT
VARS_EXCLUDES+=BASE_3_14 VARS_EXCLUDES+=BASE_3_14
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
# Update the module version (for numeric versions) with a build number of 0 if none is specified # Update the module version (for numeric versions) with a build number of 0 if none is specified
E3_MODULE_VERSION:=$(E3_MODULE_VERSION)$(shell [[ "$(E3_MODULE_VERSION)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$$ ]] && echo +0) E3_MODULE_VERSION:=$(E3_MODULE_VERSION)$(shell [[ "$(E3_MODULE_VERSION)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$$ ]] && echo +0)
E3_MODULES_PATH?=$(E3_REQUIRE_LOCATION)/siteMods
include $(EPICS_BASE)/configure/CONFIG_BASE_VERSION include $(EPICS_BASE)/configure/CONFIG_BASE_VERSION
include $(REQUIRE_CONFIG)/CONFIG_REQUIRE include $(REQUIRE_CONFIG)/CONFIG_REQUIRE
include $(REQUIRE_CONFIG)/CONFIG_SHELL include $(REQUIRE_CONFIG)/CONFIG_SHELL
......
File moved
File moved
# Pass necessary driver.makefile variables through makefile options # Pass necessary driver.makefile variables through makefile options
# #
# Here, E3_MODULES_PATH is the same as E3_REQUIRE_LOCATION
E3_MODULES_PATH:=$(EPICS_BASE)
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)"
......
...@@ -3,3 +3,12 @@ ...@@ -3,3 +3,12 @@
E3_SITEMODS_PATH:=$(E3_REQUIRE_LOCATION)/siteMods E3_SITEMODS_PATH:=$(E3_REQUIRE_LOCATION)/siteMods
E3_SITELIBS_PATH:=$(E3_REQUIRE_LOCATION)/siteLibs E3_SITELIBS_PATH:=$(E3_REQUIRE_LOCATION)/siteLibs
E3_SITEAPPS_PATH:=$(E3_REQUIRE_LOCATION)/siteApps E3_SITEAPPS_PATH:=$(E3_REQUIRE_LOCATION)/siteApps
E3_MODULES_INSTALL_LOCATION:=$(E3_MODULES_PATH)/$(E3_MODULE_NAME)/$(E3_MODULE_VERSION)
E3_MODULES_INSTALL_LOCATION_INC:=$(E3_MODULES_INSTALL_LOCATION)/include
E3_MODULES_INSTALL_LOCATION_DB:=$(E3_MODULES_INSTALL_LOCATION)/db
E3_MODULES_INSTALL_LOCATION_BIN:=$(E3_MODULES_INSTALL_LOCATION)/bin
E3_MODULES_INSTALL_LOCATION_LIB:=$(E3_MODULES_INSTALL_LOCATION)/lib
EXPORT_VARS+=E3_MODULES_INSTALL_LOCATION_LIB
...@@ -42,6 +42,10 @@ export M_ADSUPPORT ...@@ -42,6 +42,10 @@ export M_ADSUPPORT
export M_ADCORE export M_ADCORE
export M_OPCUA 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 ### Exclude the following variables to display
VARS_EXCLUDES+=COMMUNITY_EPICS_MODULES VARS_EXCLUDES+=COMMUNITY_EPICS_MODULES
VARS_EXCLUDES+=M_AUTOSAVE VARS_EXCLUDES+=M_AUTOSAVE
...@@ -63,3 +67,5 @@ VARS_EXCLUDES+=M_IPAC ...@@ -63,3 +67,5 @@ VARS_EXCLUDES+=M_IPAC
VARS_EXCLUDES+=M_ADSUPPORT VARS_EXCLUDES+=M_ADSUPPORT
VARS_EXCLUDES+=M_ADCORE VARS_EXCLUDES+=M_ADCORE
VARS_EXCLUDES+=M_OPCUA VARS_EXCLUDES+=M_OPCUA
VARS_EXCLUDES+=SUDOBASH
...@@ -7,6 +7,7 @@ MSI:=$(EPICS_BASE)/bin/$(EPICS_HOST_ARCH)/msi ...@@ -7,6 +7,7 @@ MSI:=$(EPICS_BASE)/bin/$(EPICS_HOST_ARCH)/msi
EXPORT_VARS+=EPICS_HOST_ARCH EXPORT_VARS+=EPICS_HOST_ARCH
EXPORT_VARS+=EPICS_BASE EXPORT_VARS+=EPICS_BASE
EXPORT_VARS+=MSI EXPORT_VARS+=MSI
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_SITEAPPS_PATH EXPORT_VARS+=E3_SITEAPPS_PATH
...@@ -16,6 +17,7 @@ EXPORT_VARS+=$(filter E3_REQUIRE_%,$(.VARIABLES)) ...@@ -16,6 +17,7 @@ EXPORT_VARS+=$(filter E3_REQUIRE_%,$(.VARIABLES))
EXPORT_VARS+=QUIET EXPORT_VARS+=QUIET
EXPORT_VARS+=$(filter %_DEP_VERSION,$(.VARIABLES)) EXPORT_VARS+=$(filter %_DEP_VERSION,$(.VARIABLES))
EXPORT_VARS+=$(filter WITH_%,$(.VARIABLES)) EXPORT_VARS+=$(filter WITH_%,$(.VARIABLES))
EXPORT_VARS+=$(filter %_EXTERNAL,$(.VARIABLES))
export_version=$(eval export $1) export_version=$(eval export $1)
$(eval $(foreach v,$(EXPORT_VARS),$(call export_version,$v))) $(eval $(foreach v,$(EXPORT_VARS),$(call export_version,$v)))
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
E3_REQUIRE_LOCATION:=$(EPICS_BASE)/$(E3_REQUIRE_NAME)/$(E3_REQUIRE_VERSION) E3_REQUIRE_LOCATION:=$(EPICS_BASE)/$(E3_REQUIRE_NAME)/$(E3_REQUIRE_VERSION)
E3_REQUIRE_TOOLS:=$(E3_REQUIRE_LOCATION)/tools E3_REQUIRE_TOOLS:=$(E3_REQUIRE_LOCATION)/tools
E3_REQUIRE_BIN:=$(E3_REQUIRE_LOCATION)/bin E3_REQUIRE_BIN:=$(E3_REQUIRE_LOCATION)/bin
E3_REQUIRE_LIB:=$(E3_REQUIRE_LOCATION)/lib E3_REQUIRE_LIB:=$(E3_REQUIRE_LOCATION)/lib
...@@ -12,6 +11,3 @@ E3_REQUIRE_DB:=$(E3_REQUIRE_LOCATION)/db ...@@ -12,6 +11,3 @@ E3_REQUIRE_DB:=$(E3_REQUIRE_LOCATION)/db
E3_REQUIRE_DBD:=$(E3_REQUIRE_LOCATION)/dbd E3_REQUIRE_DBD:=$(E3_REQUIRE_LOCATION)/dbd
E3_REQUIRE_INC:=$(E3_REQUIRE_LOCATION)/include E3_REQUIRE_INC:=$(E3_REQUIRE_LOCATION)/include
E3_REQUIRE_CONFIG:=$(E3_REQUIRE_LOCATION)/configure E3_REQUIRE_CONFIG:=$(E3_REQUIRE_LOCATION)/configure
EXPORT_VARS+=$(filter E3_REQUIRE_%,$(.VARIABLES))
...@@ -5,4 +5,4 @@ else ...@@ -5,4 +5,4 @@ else
SHELL = /usr/bin/bash SHELL = /usr/bin/bash
endif endif
VARS_EXCLUDES += SHELL VARS_EXCLUDES+=SHELL
TEST_DIR:=$(TOP)/tests TEST_DIR:=$(TOP)/tests
RUN_IOCSH_TEST_COMMAND = run-iocsh --name "${EPICS_BASE}/require/${E3_REQUIRE_VERSION}/bin/iocsh.bash" -r "$(E3_MODULE_NAME),$(E3_MODULE_VERSION)" -l $(TEMP_CELL_PATH)
TEMP_CELL_PATH := $(TOP)/testMods-$(shell date +"%y%m%d%H%M%S")
RMDIR = $(RM) -rf
EXPORT_VARS+=TEMP_CELL_PATH
VARS_EXCLUDES+=TEST_DIR VARS_EXCLUDES+=TEST_DIR
VARS_EXCLUDES+=RMDIR
VARS_EXCLUDES+=TEMP_CELL_PATH
# Legacy file. Needed since <module>.Makefiles include this.
...@@ -13,17 +13,27 @@ git submodule update --remote --merge $@/ ...@@ -13,17 +13,27 @@ git submodule update --remote --merge $@/
endef endef
define patch_site define patch_site
for i in $(wildcard $(TOP)/patch/Site/$(E3_MODULE_VERSION)-*.p0.patch); do\ patches=$$(ls $(TOP)/patch/Site/$(E3_MODULE_VERSION)/*.p0.patch 2> /dev/null); \
printf "\nPatching %s with the file : %s\n" "$(E3_MODULE_SRC_PATH)" "$$i"; \ if [ -n "$$patches" ]; then \
git apply --directory=$(E3_MODULE_SRC_PATH) --ignore-whitespace -p0 $$i;\ for i in $$patches; do \
done printf "\nPatching %s with the file : %s\n" "$(E3_MODULE_SRC_PATH)" "$$i"; \
git apply --directory=$(E3_MODULE_SRC_PATH) --ignore-whitespace -p0 $$i; \
done; \
else \
echo ">>> No patches to apply" >&2; \
fi
endef endef
define patch_revert_site define patch_revert_site
for i in $(wildcard $(TOP)/patch/Site/$(E3_MODULE_VERSION)-*.p0.patch); do\ patches=$$(ls $(TOP)/patch/Site/$(E3_MODULE_VERSION)/*.p0.patch 2> /dev/null); \
printf "\nReverting applied patch %s with the file : %s\n" "$(E3_MODULE_SRC_PATH)" "$$i"; \ if [ -n "$$patches" ]; then \
git apply -R --directory=$(E3_MODULE_SRC_PATH) --ignore-whitespace -p0 $$i;\ for i in $$patches; do\
done printf "\nReverting applied patch %s with the file : %s\n" "$(E3_MODULE_SRC_PATH)" "$$i"; \
git apply -R --directory=$(E3_MODULE_SRC_PATH) --ignore-whitespace -p0 $$i;\
done \
else \
echo ">>> No patches to revert" >&2; \
fi
endef endef
ifndef VERBOSE ifndef VERBOSE
......
File moved
.PHONY: consistency_checks .PHONY: consistency_checks
consistency_checks: module_name_check sitemods_check loc-check consistency_checks: module_name_check loc-check
ifneq (require,$(E3_MODULE_NAME))
consistency_checks: sitemods_check
endif
# Check that the module name satisfies a few conditions before we go on. # Check that the module name satisfies a few conditions before we go on.
module_name_check: module_name_check:
......
# -*- mode: Makefile;-*-
## This RULE should be used in case of inflating DB files
##
.PHONY: db
db: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) db
# -*- mode: Makefile;-*- # -*- mode: Makefile;-*-
.PHONY: devvars devenv devinit devbuild devclean devinstall devrebuild devuninstall devdistclean devconf devrequireconf .PHONY: devvars devenv devinit devbuild devclean devinstall devrebuild devuninstall devdistclean devconf devepics devepics-clean devepics-distclean devpatch devpatchrevert devexistent devdep devvers
devvars: vars devvars: vars
devenv: devvars devenv: devvars
## Initializes a dev setup, defined with configure/CONFIG_MODULE_DEV and configure/RELEASE_DEV
devinit: git-submodule-sync devinit: git-submodule-sync
git clone $(E3_MODULE_DEV_GITURL) $(E3_MODULE_SRC_PATH) git clone $(E3_MODULE_DEV_GITURL) $(E3_MODULE_SRC_PATH)
cd $(E3_MODULE_SRC_PATH) && git checkout $(EPICS_MODULE_TAG) cd $(E3_MODULE_SRC_PATH) && git checkout $(EPICS_MODULE_TAG)
...@@ -24,8 +25,14 @@ devrebuild: nonexists ...@@ -24,8 +25,14 @@ devrebuild: nonexists
devuninstall: nonexists devuninstall: nonexists
devdistclean: nonexists devdistclean: nonexists
devconf: nonexists devconf: nonexists
devrequireconf: nonexists devepics: nonexists
devepics-clean: nonexists
devepics-distclean: nonexists
devpatch: nonexists
devpatchrevert: nonexists
devexistent: nonexists devexistent: nonexists
devdep: nonexists
devvers: nonexists
nonexists: nonexists:
$(QUIET)echo "" $(QUIET)echo ""
$(QUIET)echo "------------------------------------------------------------" $(QUIET)echo "------------------------------------------------------------"
...@@ -35,15 +42,31 @@ nonexists: ...@@ -35,15 +42,31 @@ nonexists:
$(QUIET)echo "" $(QUIET)echo ""
else else
## Displays information about the build process (development mode)
devdebug: debug
## Build current module (development mode)
devbuild: build devbuild: build
## Deletes temporary build files (development mode)
devclean: clean devclean: clean
## Install the current module (development mode)
devinstall: install devinstall: install
devrebuild: rebuild devrebuild: rebuild
## Uninstall the current module (development mode)
devuninstall: uninstall devuninstall: uninstall
devconf: conf devconf: conf
devrequireconf: requireconf
devdistclean: clean devdistclean: clean
$(QUIET)echo "Removing $(E3_MODULE_SRC_PATH) ......... " $(QUIET)echo "Removing $(E3_MODULE_SRC_PATH) ......... "
rm -rf $(E3_MODULE_SRC_PATH) rm -rf $(E3_MODULE_SRC_PATH)
devepics: epics
devepics-clean: epics-clean
devepics-distclean: epics-distclean
devpatch: patch
devpatchrevert: patchrevert
devexistent: existent devexistent: existent
devdep: dep
devvers: vers
endif endif
File moved
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
.PHONY: help default install uninstall build rebuild clean conf all .PHONY: help default install uninstall build rebuild clean conf all prebuild
default: help default: help
...@@ -28,33 +28,43 @@ help: ...@@ -28,33 +28,43 @@ help:
## Install require to $(EPICS_BASE)/require/$(E3_MODULE_VERSION) ## Install module to $(E3_MODULES_INSTALL_LOCATION)
install: requireconf install_module install: install_module hdrs
install_module: build db .PHONY: db
db: err_no_db_rule
.PHONY: 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)
.PHONY: install_module
install_module: build db_internal
$(QUIET) $(E3_MODULE_MAKE_CMDS) install $(QUIET) $(E3_MODULE_MAKE_CMDS) install
## Uninstall the current module .PHONY: check_uninstall
uninstall: conf check_uninstall:
ifeq (,$(strip $(wildcard $(E3_SITEMODS_PATH)/*)))
$(QUIET) $(E3_MODULE_MAKE_CMDS) uninstall
else
$(error Cannot run 'make uninstall': please manually uninstall everything in $(E3_SITEMODS_PATH))
endif
# We should be able to force an uninstall of require if we need to; this should not be done without some care and thought, however! ## Uninstall the current module
## Uninstall, including deleting siteMods directory. uninstall: check_uninstall conf
forceuninstall: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) uninstall $(QUIET) $(E3_MODULE_MAKE_CMDS) uninstall
## Build current module. ## Build current module
build: conf build: conf checkout prebuild
$(QUIET) $(E3_MODULE_MAKE_CMDS) build $(QUIET) $(E3_MODULE_MAKE_CMDS) build
## Run module-specific commands before building
prebuild: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) prebuild
## Displays information about the build process ## Displays information about the build process
debug: conf debug: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) debug $(QUIET) $(E3_MODULE_MAKE_CMDS) debug
.PHONY: db_internal
db_internal: conf
$(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
...@@ -62,10 +72,42 @@ rebuild: clean build install ...@@ -62,10 +72,42 @@ rebuild: clean build install
clean: conf clean: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) clean $(QUIET) $(E3_MODULE_MAKE_CMDS) clean
## Initializes, patches, builds, and installs
all: init patch rebuild all: init patch rebuild
# Copy $(E3_MODULE_MAKEFILE) into $(E3_MODULE_SRC_PATH) # Copy $(E3_MODULE_MAKEFILE) into $(E3_MODULE_SRC_PATH)
conf: include $(REQUIRE_CONFIG)/RULES_CHECKS
$(QUIET) install -m 644 $(TOP)/$(E3_MODULE_MAKEFILE) $(E3_MODULE_SRC_PATH)/ 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
ifeq (,$(strip $(EPICS_MODULE_TAG)))
E3_LOCAL_SOURCE:=1
endif
ifeq ($(E3_LOCAL_SOURCE),1)
init: init:
$(QUIET) echo ">> You are in the local source mode."
$(QUIET) echo ">> Nothing happens."
checkout:
else
## Syncs and checks out the tag $(EPICS_MODULE_TAG) for the submodule
init: git-submodule-sync $(E3_MODULE_SRC_PATH) checkout
git-submodule-sync:
$(QUIET) git submodule sync
$(E3_MODULE_SRC_PATH):
$(QUIET) $(git_update)
checkout:
cd $(E3_MODULE_SRC_PATH) && git checkout $(EPICS_MODULE_TAG)
endif
# -*- mode: Makefile;-*-
# One should define the any dependency modules and EPICS base path # One should define the any dependency modules and EPICS base path
# in the following directory # in the following directory
# .PHONY: epics epics-clean .PHONY: epics-clean epics-distclean
# epics: epics-clean:
# $(QUIET)echo "EPICS_BASE=$(EPICS_BASE)" > $(TOP)/$(E3_MODULE_SRC_PATH)/configure/RELEASE $(MAKE) -C $(E3_MODULE_SRC_PATH) clean
# $(QUIET)echo "INSTALL_LOCATION=$(M_IOCSTATS)" > $(TOP)/$(E3_MODULE_SRC_PATH)/configure/CONFIG_SITE
# $(MAKE) -C $(E3_MODULE_SRC_PATH)
#epics-clean: epics-distclean:
# $(MAKE) -C $(E3_MODULE_SRC_PATH) clean $(MAKE) -C $(E3_MODULE_SRC_PATH) distclean
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment