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

Rewrote comments and refactored

parent 68da54a4
No related branches found
No related tags found
No related merge requests found
......@@ -533,39 +533,28 @@ INSTALL_INCLUDES =
EPICS_INCLUDES =
# Add include directory of foreign modules to include file search path.
# Default is to use latest version of any module.
# The user can overwrite the version by defining <module>_VERSION=<version>.
# For each foreign module look for include/ for the EPICS base version in use.
# The user can overwrite (or add) by defining <module>_INC=<relative/path> (not recommended!).
# Only really existing directories are added to the search path.
# The tricky part is to sort versions numerically. Make can't but ls -v can.
# Only accept numerical versions (needs extended glob).
# define ADD_FOREIGN_INCLUDES
# $(eval $(1)_VERSION := $(patsubst ${EPICS_MODULES}/$(1)/%/include,%,$(firstword $(shell ls -dvr ${EPICS_MODULES}/$(1)/$(VERSIONGLOB)/include 2>/dev/null))))
# INSTALL_INCLUDES += $$(patsubst %,-I${EPICS_MODULES}/$(1)/%/include,$$($(1)_VERSION))
# endef
# $(eval $(foreach m,$(filter-out $(PRJ),$(notdir $(wildcard ${EPICS_MODULES}/*))),$(call ADD_FOREIGN_INCLUDES,$m)))
#
# The default behaviour is to start with <module>_VERSION and to select the highest
# available build number, unless otherwise specified. This is determined with the
# shell script build_number.sh included with require.
#
# Note that we do not perform this search when building require as
# 1. require has no dependencies
# 2. build_number.sh is not installed yet, so ADD_OTHER_INCLUDES complains
# when searching EPICS_MODULES (= $(EPICS_BASE))
ifneq ($(strip $(PRJ)),require)
define FETCH_BUILD_NUMBER
$(shell $(E3_REQUIRE_TOOLS)/build_number.sh $(1) $(2) $($(2)_VERSION))
endef
define ADD_SITEMODS_INCLUDES
INSTALL_INCLUDES += $$(patsubst %,-I${E3_SITEMODS_PATH}/$(1)/%/include,$$(call FETCH_BUILD_NUMBER,$(E3_SITEMODS_PATH),$(1)))
endef
$(foreach m,$(filter-out $(PRJ),$(notdir $(wildcard ${E3_SITEMODS_PATH}/*))),$(eval $(call ADD_SITEMODS_INCLUDES,$m)))
define ADD_SITEAPPS_INCLUDES
INSTALL_INCLUDES += $$(patsubst %,-I${E3_SITEAPPS_PATH}/$(1)/%/include,$$(call FETCH_BUILD_NUMBER,$(E3_SITEAPPS_PATH),$(1)))
endef
$(foreach m,$(filter-out $(PRJ),$(notdir $(wildcard ${E3_SITEAPPS_PATH}/*))),$(eval $(call ADD_SITEAPPS_INCLUDES,$m)))
define ADD_OTHER_INCLUDES
INSTALL_INCLUDES += $$(patsubst %,-I${EPICS_MODULES}/$(1)/%/include,$$(call FETCH_BUILD_NUMBER,$(EPICS_MODULES),$(1)))
define ADD_INCLUDES_TEMPLATE
INSTALL_INCLUDES += $$(patsubst %,-I${2}/$(1)/%/include,$$(call FETCH_BUILD_NUMBER,$(2),$(1)))
endef
$(foreach m,$(filter-out $(PRJ),$(notdir $(wildcard ${EPICS_MODULES}/*))),$(eval $(call ADD_OTHER_INCLUDES,$m)))
$(foreach m,$(filter-out $(PRJ),$(notdir $(wildcard ${E3_SITEMODS_PATH}/*))),$(eval $(call ADD_INCLUDES_TEMPLATE,$m,$(E3_SITEMODS_PATH))))
$(foreach m,$(filter-out $(PRJ),$(notdir $(wildcard ${E3_SITEAPPS_PATH}/*))),$(eval $(call ADD_INCLUDES_TEMPLATE,$m,$(E3_SITEAPPS_PATH))))
$(foreach m,$(filter-out $(PRJ),$(notdir $(wildcard ${EPICS_MODULES}/*))),$(eval $(call ADD_INCLUDES_TEMPLATE,$m,$(EPICS_MODULES))))
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