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

Build numbers are now added to the .dep file if they are not specified

parent fe6fcdef
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,7 @@ conf: module_name_check ...@@ -66,7 +66,7 @@ conf: module_name_check
# We should check that the module name satisfies a few conditions before we go on. # We should check that the module name satisfies a few conditions before we go on.
module_name_check: 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.) $(error E3_MODULE_NAME '$(E3_MODULE_NAME)' is not valid. It should consist only of lowercase letters, numbers, and underscores.)
endif endif
......
...@@ -1002,17 +1002,28 @@ ${METAFILE}: ...@@ -1002,17 +1002,28 @@ ${METAFILE}:
@echo "module_git_desc: '$(${PRJ}_GIT_DESC)'" >> $@ @echo "module_git_desc: '$(${PRJ}_GIT_DESC)'" >> $@
@echo "module_diffs: $(${PRJ}_GIT_STATUS)" >> $@ @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. # Create dependency file for recursive requires.
${DEPFILE}: ${LIBOBJS} $(USERMAKEFILE) ${DEPFILE}: ${LIBOBJS} $(USERMAKEFILE)
@echo "Collecting dependencies" @echo "Collecting dependencies"
$(RM) $@ $(RM) $@
@echo "# Generated file. Do not edit." > $@ @echo "# Generated file. Do not edit." > $@
# Check dependencies on other module headers. # 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}),) ifneq ($(strip ${REQ}),)
# Manully added dependencies: ${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}.))" >> $@;) @$(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 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. # Remove MakefileInclude after we are done because it interfers with our way to build.
build: build:
......
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