2
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation. Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
28
LIB_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)
29
CONF_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE)
30
LEGAL_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_legal/$(MODULE)
31
COMMON_LEGAL_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_legal/common
33
################################################################################
35
# Copy exported include headers files to output directory, if present.
38
INCLUDE_TARGET_DIR := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE)
39
INCLUDE_SOURCE_DIR := $(TOPDIR)/src/$(MODULE)/share/native/include
41
ifneq ($(wildcard $(INCLUDE_SOURCE_DIR)/*), )
42
$(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE, \
43
SRC := $(INCLUDE_SOURCE_DIR), \
44
DEST := $(INCLUDE_TARGET_DIR), \
45
FILES := $(filter %.h, $(call FindFiles, $(INCLUDE_SOURCE_DIR))), \
48
TARGETS += $(COPY_EXPORTED_INCLUDE)
51
# Use the most specific of OS and OS_TYPE.
52
INCLUDE_SOURCE_OS_DIR := $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS)/native/include
53
ifeq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), )
54
INCLUDE_SOURCE_OS_DIR := $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/include
57
ifneq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), )
58
$(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE_OS, \
59
SRC := $(INCLUDE_SOURCE_OS_DIR), \
60
DEST := $(INCLUDE_TARGET_DIR)/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR), \
61
FILES := $(filter %.h, $(call FindFiles, $(INCLUDE_SOURCE_OS_DIR))), \
64
TARGETS += $(COPY_EXPORTED_INCLUDE_OS)
67
################################################################################
68
# Setup make rules for copying legal files. This is only needed if the files
69
# need to be filtered due to optional components being enabled/disabled.
70
# Otherwise CreateJmods.gmk will find the legal files in the original src dirs.
71
# If multiple license files with the same name are found, only the first one
72
# found will get copied.
74
# Parameter 1 is the name of the rule.
76
# Remaining parameters are named arguments. These include:
77
# EXCLUDES : List of filenames to exclude from copy
78
SetupCopyLegalFiles = $(NamedParamsMacroTemplate)
79
define SetupCopyLegalFilesBody
80
$$(foreach f, $$(filter-out $$(addprefix %/, $$($1_EXCLUDES)), \
81
$$(wildcard $$(addsuffix /*, $$(call FindModuleLegalSrcDirs, $$(MODULE))))), \
82
$$(if $$(filter $$($1_$$(notdir $$f)), $$($1)), , \
83
$$(eval $$(call SetupCopyFiles, $1_$$(notdir $$f), \
84
DEST := $$(LEGAL_DST_DIR), \
87
$$(eval $1 += $$($1_$$(notdir $$f))) \