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

Load config and rules files from e3 modules

parent 9fd35741
No related branches found
No related tags found
1 merge request!156E3-1412: Load config and rules files from e3 modules
Pipeline #172697 passed with warnings
......@@ -553,7 +553,11 @@ ifneq ($(MODULELIB),)
LIBOBJS += $(addsuffix $(OBJ),$(basename ${VERSIONFILE}))
endif # MODULELIB
MODULE_RULES = ${CFGS:%=../%}
MODULE_CONFIGS = $(foreach cfg,${CFGS},$(if $(filter CONFIG%,$(notdir $(cfg))),$(if $(filter /%,$(cfg)),$(cfg),../$(cfg))))
MODULE_CONFIGS += $(foreach m,$(REQ),$(wildcard $(E3_SITEMODS_PATH)/$m/$($(m)_VERSION)/cfg/CONFIG*))
MODULE_CONFIGS += $(foreach m,$(REQ),$(wildcard $(EPICS_MODULES)/$m/$($(m)_VERSION)/cfg/CONFIG*))
MODULE_RULES = $(foreach cfg,${CFGS},$(if $(filter RULES%,$(notdir $(cfg))),$(if $(filter /%,$(cfg)),$(cfg),../$(cfg))))
MODULE_RULES += $(foreach m,$(REQ),$(wildcard $(E3_SITEMODS_PATH)/$m/$($(m)_VERSION)/cfg/RULES*))
MODULE_RULES += $(foreach m,$(REQ),$(wildcard $(EPICS_MODULES)/$m/$($(m)_VERSION)/cfg/RULES*))
......@@ -580,6 +584,7 @@ debug::
@echo "TEMPLS = ${TEMPLS}"
@echo "LIBVERSION = ${LIBVERSION}"
@echo "MODULE_LOCATION = ${MODULE_LOCATION}"
@echo "MODULE_CONFIGS = ${MODULE_CONFIGS}"
@echo "MODULE_RULES = ${MODULE_RULES}"
build: MODULEINFOS
......@@ -597,6 +602,9 @@ INSTALL_LOADABLE_SHRLIBS=
# We ony want to include ${BASERULES} from EPICS base if we are /not/ in debug
# mode. Including this causes all of the source files to be compiled!
ifeq (,$(findstring debug,${MAKECMDGOALS}))
ifneq ($(strip $(MODULE_CONFIGS)),)
include $(MODULE_CONFIGS)
endif
include ${BASERULES}
ifneq ($(strip $(MODULE_RULES)),)
include $(MODULE_RULES)
......
......@@ -751,3 +751,15 @@ def test_install_license(wrapper: Wrapper):
file_path = wrapper.package_dir / "doc/foo/LICENSE"
assert file_path.exists()
def test_load_custom_config_files(wrapper: Wrapper):
custom_config_file = wrapper.config_dir / "CONFIG_FOO"
custom_config_file.write_text("$(error foobarbaz)")
wrapper.add_file(custom_config_file)
wrapper.add_var_to_module_makefile("CONFIGS", str(custom_config_file))
rc, _, errs = wrapper.run_make("build")
assert rc == 2
assert "foobarbaz" in errs
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