--- old/make/copy/CopyCommon.gmk 2019-02-15 10:58:28.019298952 -0800 +++ new/make/copy/CopyCommon.gmk 2019-02-15 10:58:27.587284284 -0800 @@ -75,10 +75,12 @@ define SetupCopyLegalFilesBody $$(foreach f, $$(filter-out $$(addprefix %/, $$($1_EXCLUDES)), \ $$(wildcard $$(addsuffix /*, $$(call FindModuleLegalSrcDirs, $$(MODULE))))), \ - $$(eval $$(call SetupCopyFiles, $1_$$(notdir $$f), \ - DEST := $$(LEGAL_DST_DIR), \ - FILES := $$f, \ - )) \ - $$(eval $1 += $$($1_$$(notdir $$f))) \ + $$(if $$(filter $$($1_$$(notdir $$f)), $$($1)), , \ + $$(eval $$(call SetupCopyFiles, $1_$$(notdir $$f), \ + DEST := $$(LEGAL_DST_DIR), \ + FILES := $$f, \ + )) \ + $$(eval $1 += $$($1_$$(notdir $$f))) \ + ) \ ) endef