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

Added check that RULES_SITEMODS is loaded correctly

parent 02dfce1a
No related branches found
No related tags found
1 merge request!42E3-311: Check that wrappers have the correct RULES file
.PHONY: consistency_checks
consistency_checks: module_name_check sitemods_check loc-check
# Check that the module name satisfies a few conditions before we go on.
module_name_check:
ifneq ($(shell echo $(E3_MODULE_NAME) | grep -q '^[a-z_][a-z0-9_]*$$' ; echo $$?),0)
$(error E3_MODULE_NAME '$(E3_MODULE_NAME)' is not valid. It should consist only of lowercase letters, numbers, and underscores.)
endif
# Check that a module is including RULES_SITEMODS instead of RULES_SITEAPPS or manually including RULES_E3
.PHONY: sitemods_check
sitemods_check:
ifeq ($(filter RULES_SITEMODS,$(notdir $(MAKEFILE_LIST))),)
$(error RULES_E3 should only be loaded from RULES_SITEMODS)
endif
# Check that e3 wrappers are using EPICS_MODULE_TAG to manage local source mode
.PHONU: loc-check
loc-check:
ifneq (,$(findstring -loc,$(E3_MODULE_SRC_PATH)))
$(error DEPRECATED: Local source mode "-loc" has being deprecated. Please comment out the EPICS_MODULE_TAG to use local source mode.)
endif
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
default: help default: help
# # help is defined in # # help is defined in
# # https://gist.github.com/rcmachado/af3db315e31383502660 # # https://gist.github.com/rcmachado/af3db315e31383502660
help: help:
$(info --------------------------------------- ) $(info --------------------------------------- )
$(info Available targets) $(info Available targets)
$(info --------------------------------------- ) $(info --------------------------------------- )
$(QUIET) awk '/^[a-zA-Z\-\_0-9]+:/ { \ $(QUIET) awk '/^[a-zA-Z\-\_0-9]+:/ { \
...@@ -23,7 +23,7 @@ help: ...@@ -23,7 +23,7 @@ help:
print $$1 "\t" helpMsg; \ print $$1 "\t" helpMsg; \
} \ } \
{ helpMsg = $$0 }' \ { helpMsg = $$0 }' \
$(MAKEFILE_LIST) | column -ts: $(MAKEFILE_LIST) | column -ts:
...@@ -63,7 +63,7 @@ db_internal: conf ...@@ -63,7 +63,7 @@ db_internal: conf
$(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: conf
...@@ -73,34 +73,25 @@ clean: conf ...@@ -73,34 +73,25 @@ clean: conf
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: module_name_check include $(REQUIRE_CONFIG)/RULES_CHECKS
conf: consistency_checks
$(QUIET) install -p -m 644 $(TOP)/$(E3_MODULE_MAKEFILE) $(E3_MODULE_SRC_PATH)/ $(QUIET) install -p -m 644 $(TOP)/$(E3_MODULE_MAKEFILE) $(E3_MODULE_SRC_PATH)/
# We should check that the module name satisfies a few conditions before we go on.
module_name_check:
ifneq ($(shell echo $(E3_MODULE_NAME) | grep -q '^[a-z_][a-z0-9_]*$$' ; echo $$?),0)
$(error E3_MODULE_NAME '$(E3_MODULE_NAME)' is not valid. It should consist only of lowercase letters, numbers, and underscores.)
endif
.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)))
E3_LOCAL_SOURCE:=1 E3_LOCAL_SOURCE:=1
endif endif
ifneq (,$(findstring -loc,$(E3_MODULE_SRC_PATH)))
$(warning DEPRECATED: Local source mode "-loc" is being deprecated. Please comment out the EPICS_MODULE_TAG to use local source mode.)
E3_LOCAL_SOURCE:=1
endif
ifeq ($(E3_LOCAL_SOURCE),1) ifeq ($(E3_LOCAL_SOURCE),1)
init: init:
$(QUIET) echo ">> You are in the local source mode." $(QUIET) echo ">> You are in the local source mode."
$(QUIET) echo ">> Nothing happens." $(QUIET) echo ">> Nothing happens."
checkout: checkout:
else else
## Syncs and checks out the tag $(EPICS_MODULE_TAG) for the submodule ## Syncs and checks out the tag $(EPICS_MODULE_TAG) for the submodule
init: git-submodule-sync $(E3_MODULE_SRC_PATH) checkout init: git-submodule-sync $(E3_MODULE_SRC_PATH) checkout
...@@ -108,13 +99,12 @@ git-submodule-sync: ...@@ -108,13 +99,12 @@ git-submodule-sync:
$(QUIET) git submodule sync $(QUIET) git submodule sync
$(E3_MODULE_SRC_PATH): $(E3_MODULE_SRC_PATH):
$(QUIET) $(git_update) $(QUIET) $(git_update)
checkout: checkout:
cd $(E3_MODULE_SRC_PATH) && git checkout $(EPICS_MODULE_TAG) cd $(E3_MODULE_SRC_PATH) && git checkout $(EPICS_MODULE_TAG)
endif endif
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