8219129: Allow overriding of license files in legal dir

Reviewed-by: ihse
This commit is contained in:
Erik Joelsson 2019-02-19 12:40:44 -08:00
parent c296f4ae0d
commit 4281bf2e38

View File

@ -66,6 +66,8 @@ endif
# Setup make rules for copying legal files. This is only needed if the files # Setup make rules for copying legal files. This is only needed if the files
# need to be filtered due to optional components being enabled/disabled. # need to be filtered due to optional components being enabled/disabled.
# Otherwise CreateJmods.gmk will find the legal files in the original src dirs. # Otherwise CreateJmods.gmk will find the legal files in the original src dirs.
# If multiple license files with the same name are found, only the first one
# found will get copied.
# #
# Parameter 1 is the name of the rule. # Parameter 1 is the name of the rule.
# #
@ -75,10 +77,12 @@ SetupCopyLegalFiles = $(NamedParamsMacroTemplate)
define SetupCopyLegalFilesBody define SetupCopyLegalFilesBody
$$(foreach f, $$(filter-out $$(addprefix %/, $$($1_EXCLUDES)), \ $$(foreach f, $$(filter-out $$(addprefix %/, $$($1_EXCLUDES)), \
$$(wildcard $$(addsuffix /*, $$(call FindModuleLegalSrcDirs, $$(MODULE))))), \ $$(wildcard $$(addsuffix /*, $$(call FindModuleLegalSrcDirs, $$(MODULE))))), \
$$(eval $$(call SetupCopyFiles, $1_$$(notdir $$f), \ $$(if $$(filter $$($1_$$(notdir $$f)), $$($1)), , \
DEST := $$(LEGAL_DST_DIR), \ $$(eval $$(call SetupCopyFiles, $1_$$(notdir $$f), \
FILES := $$f, \ DEST := $$(LEGAL_DST_DIR), \
)) \ FILES := $$f, \
$$(eval $1 += $$($1_$$(notdir $$f))) \ )) \
$$(eval $1 += $$($1_$$(notdir $$f))) \
) \
) )
endef endef