diff --git a/configure/modules/RULES_E3 b/configure/modules/RULES_E3 index 0c59a4fdccab0e29ea10c80b8dfda654dc51b7cd..80775fc25f7e461462f79b0205ae1d415e505aa2 100644 --- a/configure/modules/RULES_E3 +++ b/configure/modules/RULES_E3 @@ -66,7 +66,7 @@ conf: module_name_check # 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) +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 diff --git a/require-ess/tools/driver.makefile b/require-ess/tools/driver.makefile index d7f048885488dfe905c18258cc5802a2031a64e2..427996eee80a9abad955be542734f3613047c19e 100644 --- a/require-ess/tools/driver.makefile +++ b/require-ess/tools/driver.makefile @@ -1002,17 +1002,28 @@ ${METAFILE}: @echo "module_git_desc: '$(${PRJ}_GIT_DESC)'" >> $@ @echo "module_diffs: $(${PRJ}_GIT_STATUS)" >> $@ +define DEP_PARSER +s%$(E3_SITEMODS_PATH)/*\([^/]*\)/\($(VERSIONREGEX2)\)/.*%\1 \2%p; \ +s%$(E3_SITEMODS_PATH)/*\([^/]*\)/\([^/]*\)/.*%\1 \2%p; \ +s%$(E3_SITEAPPS_PATH)/*\([^/]*\)/\($(VERSIONREGEX2)\)/.*%\1 \2%p; \ +s%$(E3_SITEAPPS_PATH)/*\([^/]*\)/\([^/]*\)/.*%\1 \2%p; \ +s%$(EPICS_MODULES)/*\([^/]*\)/\($(VERSIONREGEX2)\)/.*%\1 \2%p; \ +s%$(EPICS_MODULES)/*\([^/]*\)/\([^/]*\)/.*%\1 \2%p +endef + # Create dependency file for recursive requires. ${DEPFILE}: ${LIBOBJS} $(USERMAKEFILE) @echo "Collecting dependencies" $(RM) $@ @echo "# Generated file. Do not edit." > $@ # Check dependencies on other module headers. - cat *.d 2>/dev/null | sed 's/ /\n/g' | sed -n 's%$(E3_SITEMODS_PATH)/*\([^/]*\)/\($(VERSIONREGEX2)\)/.*%\1 \2%p;s%$(E3_SITEMODS_PATH)/*\([^/]*\)/\([^/]*\)/.*%\1 \2%p;s%$(E3_SITEAPPS_PATH)/*\([^/]*\)/\($(VERSIONREGEX2)\)/.*%\1 \2%p;s%$(E3_SITEAPPS_PATH)/*\([^/]*\)/\([^/]*\)/.*%\1 \2%p;s%$(EPICS_MODULES)/*\([^/]*\)/\($(VERSIONREGEX2)\)/.*%\1 \2%p;s%$(EPICS_MODULES)/*\([^/]*\)/\([^/]*\)/.*%\1 \2%p'| grep -v "include" | sort -u >> $@ + cat *.d 2>/dev/null | sed 's/ /\n/g' | sed -n '$(DEP_PARSER)' | grep -v "include" | sort -u >> $@ ifneq ($(strip ${REQ}),) # Manully added dependencies: ${REQ} @$(foreach m,${REQ},echo "$m $(or ${$m_VERSION},$(and $(wildcard ${E3_SITEMODS_PATH}/$m),$(error REQUIRED module $m has no numbered version. Set $m_VERSION)),$(warning REQUIRED module $m not found for ${T_A}.))" >> $@;) endif +# Update the version numbers to ensure that the build number is included + sed -i 's/^\([a-z_][a-z0-9_]*\) \([0-9]\+\.[0-9]\+\.[0-9]\+\)$$/\1 \2-0/' $@ # Remove MakefileInclude after we are done because it interfers with our way to build. build: