author | prr |
Tue, 14 Nov 2017 12:07:55 -0800 | |
changeset 47839 | 314ac2e2db63 |
parent 47253 | 92fd0e04e0e1 |
child 53683 | 48ff68e2fe5c |
permissions | -rw-r--r-- |
36506 | 1 |
# |
41260 | 2 |
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
36506 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
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. |
|
10 |
# |
|
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). |
|
16 |
# |
|
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. |
|
20 |
# |
|
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 |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
# This makefile is called for every imported module to copy the non class |
|
27 |
# contents into the exploded jdk image. |
|
28 |
||
29 |
default: all |
|
30 |
||
31 |
include $(SPEC) |
|
32 |
include MakeBase.gmk |
|
33 |
||
34 |
LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS))) |
|
35 |
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS))) |
|
36 |
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF))) |
|
37 |
||
38 |
$(eval $(call FillCacheFind, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR))) |
|
39 |
||
40 |
ifneq ($(LIBS_DIR), ) |
|
41 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
42 |
TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map |
|
43 |
||
41458 | 44 |
$(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \ |
36506 | 45 |
SRC := $(LIBS_DIR), \ |
46 |
DEST := $(JDK_OUTPUTDIR)/bin, \ |
|
47 |
FILES := $(filter $(TO_BIN_FILTER), \ |
|
48 |
$(call CacheFind, $(LIBS_DIR))) \ |
|
49 |
)) |
|
50 |
||
41458 | 51 |
$(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \ |
36506 | 52 |
SRC := $(LIBS_DIR), \ |
53 |
DEST := $(JDK_OUTPUTDIR)/lib, \ |
|
54 |
FILES := $(filter-out $(TO_BIN_FILTER), \ |
|
55 |
$(call CacheFind, $(LIBS_DIR))) \ |
|
56 |
)) |
|
57 |
TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) |
|
58 |
else |
|
59 |
$(eval $(call SetupCopyFiles, COPY_LIBS, \ |
|
60 |
SRC := $(LIBS_DIR), \ |
|
61 |
DEST := $(JDK_OUTPUTDIR)/lib, \ |
|
41260 | 62 |
FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \ |
36506 | 63 |
)) |
41260 | 64 |
|
47253
92fd0e04e0e1
8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents:
42983
diff
changeset
|
65 |
# Use relative links if the import dir is inside the OUTPUTDIR, otherwise |
41260 | 66 |
# copy to avoid having automated systems following symlinks when deleting files, |
67 |
# or risk invalidating the build output from external changes. |
|
47253
92fd0e04e0e1
8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents:
42983
diff
changeset
|
68 |
ifeq ($(filter $(OUTPUTDIR)/%, $(LIBS_DIR)), ) |
41260 | 69 |
LINK_MACRO := install-file |
42983 | 70 |
LOG_ACTION := Copying |
41260 | 71 |
else |
72 |
LINK_MACRO := link-file-relative |
|
42983 | 73 |
LOG_ACTION := Creating symlink |
41260 | 74 |
endif |
75 |
$(eval $(call SetupCopyFiles, LINK_LIBS, \ |
|
76 |
SRC := $(LIBS_DIR), \ |
|
77 |
DEST := $(JDK_OUTPUTDIR)/lib, \ |
|
78 |
FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \ |
|
79 |
MACRO := $(LINK_MACRO), \ |
|
42983 | 80 |
LOG_ACTION := $(LOG_ACTION), \ |
41260 | 81 |
)) |
82 |
TARGETS += $(COPY_LIBS) $(LINK_LIBS) |
|
36506 | 83 |
endif |
84 |
endif |
|
85 |
||
86 |
ifneq ($(CMDS_DIR), ) |
|
87 |
$(eval $(call SetupCopyFiles, COPY_CMDS, \ |
|
88 |
SRC := $(CMDS_DIR), \ |
|
89 |
DEST := $(JDK_OUTPUTDIR)/bin, \ |
|
90 |
FILES := $(call CacheFind, $(CMDS_DIR)), \ |
|
91 |
)) |
|
92 |
TARGETS += $(COPY_CMDS) |
|
93 |
endif |
|
94 |
||
95 |
ifneq ($(CONF_DIR), ) |
|
96 |
$(eval $(call SetupCopyFiles, COPY_CONF, \ |
|
97 |
SRC := $(CONF_DIR), \ |
|
98 |
DEST := $(JDK_OUTPUTDIR)/lib, \ |
|
99 |
FILES := $(call CacheFind, $(CONF_DIR)), \ |
|
100 |
)) |
|
101 |
TARGETS += $(COPY_CONF) |
|
102 |
endif |
|
103 |
||
104 |
all: $(TARGETS) |