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

Merge branch 'license_later' into 'master'

Install the license file in the third build stage

See merge request !155
parents 9fd35741 41906a12
No related branches found
No related tags found
1 merge request!155Install the license file in the third build stage
Pipeline #173028 passed with warnings
......@@ -302,7 +302,6 @@ CFGS = ${CONFIGS}
CFGS += ${CONFIGS_${EPICSVERSION}}
export CFGS
INSTALL_LICENSE = ${MODULE_LOCATION}/doc
# Find all license files to distribute with binaries
LICENSES = $(shell find -not -path '*/.*' -type f -iname LICENSE)
LICENSES += $(shell find -not -path '*/.*' -type f -iname Copyright)
......@@ -367,20 +366,6 @@ build:: ${COMMON_DIR}/${METAFILE}
install:: ${INSTALL_META}
# The licenses should be installed after everything
define license_install =
$1: $2
@echo "Installing license file $$^"
$$(INSTALL) -d -m444 $$^ $$(@D)
install:: $1
endef
# Creates a target for every license file to be installed. Some modules have
# more than one license file that needs distribution. For them we add the
# previous directory so we have them separate by projects inside /doc.
$(foreach d, $(LICENSES), $(eval $(call license_install, $(INSTALL_LICENSE)/$(filter-out ., $(lastword $(subst /, , $(dir $(d))))/$(notdir $(d))), $(d))))
else # T_A
ifeq ($(filter O.%,$(notdir ${CURDIR})),)
......@@ -676,6 +661,7 @@ INSTALL_DBS = $(addprefix ${INSTALL_DB}/,$(notdir ${TEMPLS}))
INSTALL_SCRS = $(addprefix ${INSTALL_SCR}/,$(notdir ${SCR}))
INSTALL_BINS = $(addprefix ${INSTALL_BIN}/,$(notdir ${BINS}))
INSTALL_CONFIGS = $(addprefix ${INSTALL_CONFIG}/,$(notdir ${CFGS}))
INSTALL_LICENSES = $(addprefix ${INSTALL_DOC}/,${LICENSES})
debug::
@echo "INSTALL_LIB = $(INSTALL_LIB)"
......@@ -694,6 +680,7 @@ debug::
@echo "INSTALL_CONFIGS = $(INSTALL_CONFIGS)"
@echo "INSTALL_BIN = $(INSTALL_BIN)"
@echo "INSTALL_BINS = $(INSTALL_BINS)"
@echo "INSTALL_LICENSES = $(INSTALL_LICENSES)"
@echo "HDR_SUBDIRS = $(HDR_SUBDIRS)"
define install_subdirs
......@@ -708,7 +695,8 @@ debug::
endef
$(foreach d,$(HDR_SUBDIRS),$(eval $(call install_subdirs,$d)))
INSTALLS += ${INSTALL_CONFIGS} ${INSTALL_SCRS} ${INSTALL_HDRS} ${INSTALL_DBDS} ${INSTALL_DBS} ${INSTALL_LIBS} ${INSTALL_VLIBS} ${INSTALL_BINS} ${INSTALL_DEPS}
INSTALLS += ${INSTALL_CONFIGS} ${INSTALL_SCRS} ${INSTALL_HDRS} ${INSTALL_DBDS} ${INSTALL_DBS} \
${INSTALL_LIBS} ${INSTALL_VLIBS} ${INSTALL_BINS} ${INSTALL_DEPS} ${INSTALL_LICENSES}
install: ${INSTALLS}
......@@ -744,6 +732,13 @@ ${INSTALL_BINS}: $(addprefix ../,$(filter-out /%,${BINS})) $(filter /%,${BINS})
@echo "Installing binaries $^ to $(@D)"
$(INSTALL) -d -m$(BIN_PERMISSIONS) $^ $(@D)
define license_install =
$1: $2
@echo "Installing license file $$^"
$$(INSTALL) -d -m444 $$^ $$(@D)
endef
$(foreach l,$(LICENSES),$(eval $(call license_install,$(INSTALL_DOC)/$l,../$l)))
# Create GPIB code from *.gt file.
%.c %.dbd %.list: %.gt
@echo "Converting $*.gt"
......
......@@ -743,8 +743,8 @@ def test_install_license(wrapper: Wrapper):
rc, out, _ = wrapper.run_make("install")
assert rc == 0
assert re.search("Installing license file LICENSE", out)
assert re.search("Installing license file foo/LICENSE", out)
assert re.search("Installing license file .././LICENSE", out)
assert re.search("Installing license file .././foo/LICENSE", out)
file_path = wrapper.package_dir / "doc/LICENSE"
assert file_path.exists()
......
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