jdk

Форк
0
/
CopyImportModules.gmk 
106 строк · 3.7 Кб
1
#
2
# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
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
include CopyFiles.gmk
35

36
LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
37
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
38
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
39

40
$(call FillFindCache, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR))
41

42
ifneq ($(LIBS_DIR), )
43
  ifeq ($(call isTargetOs, windows), true)
44
    TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
45

46
    $(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \
47
        SRC := $(LIBS_DIR), \
48
        DEST := $(JDK_OUTPUTDIR)/bin, \
49
        FILES := $(filter $(TO_BIN_FILTER), \
50
            $(call FindFiles, $(LIBS_DIR))) \
51
    ))
52

53
    $(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
54
        SRC := $(LIBS_DIR), \
55
        DEST := $(JDK_OUTPUTDIR)/lib, \
56
        FILES := $(filter-out $(TO_BIN_FILTER), \
57
            $(call FindFiles, $(LIBS_DIR))) \
58
    ))
59
    TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB)
60
  else
61
    $(eval $(call SetupCopyFiles, COPY_LIBS, \
62
        SRC := $(LIBS_DIR), \
63
        DEST := $(JDK_OUTPUTDIR)/lib, \
64
        FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
65
    ))
66

67
    # Use relative links if the import dir is inside the OUTPUTDIR, otherwise
68
    # copy to avoid having automated systems following symlinks when deleting files,
69
    # or risk invalidating the build output from external changes.
70
    ifeq ($(filter $(OUTPUTDIR)/%, $(LIBS_DIR)), )
71
      LINK_MACRO := install-file
72
      LOG_ACTION := Copying
73
    else
74
      LINK_MACRO := link-file-relative
75
      LOG_ACTION := Creating symlink
76
    endif
77
    $(eval $(call SetupCopyFiles, LINK_LIBS, \
78
        SRC := $(LIBS_DIR), \
79
        DEST := $(JDK_OUTPUTDIR)/lib, \
80
        FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
81
        MACRO := $(LINK_MACRO), \
82
        LOG_ACTION := $(LOG_ACTION), \
83
    ))
84
    TARGETS += $(COPY_LIBS) $(LINK_LIBS)
85
  endif
86
endif
87

88
ifneq ($(CMDS_DIR), )
89
  $(eval $(call SetupCopyFiles, COPY_CMDS, \
90
      SRC := $(CMDS_DIR), \
91
      DEST := $(JDK_OUTPUTDIR)/bin, \
92
      FILES := $(call FindFiles, $(CMDS_DIR)), \
93
  ))
94
  TARGETS += $(COPY_CMDS)
95
endif
96

97
ifneq ($(CONF_DIR), )
98
  $(eval $(call SetupCopyFiles, COPY_CONF, \
99
      SRC := $(CONF_DIR), \
100
      DEST := $(JDK_OUTPUTDIR)/lib, \
101
      FILES := $(call FindFiles, $(CONF_DIR)), \
102
  ))
103
  TARGETS += $(COPY_CONF)
104
endif
105

106
all: $(TARGETS)
107

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.