make/common/Modules.gmk
changeset 42505 11439b0c0792
parent 42427 2c48c5ffb581
child 42514 d5c5e07498ef
--- a/make/common/Modules.gmk	Wed Jul 05 22:34:05 2017 +0200
+++ b/make/common/Modules.gmk	Mon Dec 12 18:56:32 2016 -0800
@@ -286,6 +286,21 @@
 
 ################################################################################
 
+LEGAL_SUBDIRS += $(OPENJDK_TARGET_OS)/legal
+ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
+  LEGAL_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/legal
+endif
+LEGAL_SUBDIRS += share/legal
+
+# Find all legal dirs for a particular module
+# $1 - Module to find legal dirs for
+FindModuleLegalDirs = \
+    $(strip $(wildcard \
+        $(addsuffix /$(strip $1), $(IMPORT_MODULES_LEGAL)) \
+        $(foreach sub, $(LEGAL_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
+
+################################################################################
+
 # Param 1 - Name of module
 define ReadSingleImportMetaData
     ifneq ($$(wildcard $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties), )