make/CopyImportModules.gmk
author coffeys
Wed, 13 Nov 2019 11:27:50 +0000
changeset 59055 57ad70bcf06c
parent 54380 e297c7bb6469
permissions -rw-r--r--
8233731: repeated typo "fro" for "for" Reviewed-by: dfuchs Contributed-by: kiran.sidhartha.ravikumar@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
     1
#
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53683
diff changeset
     2
# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
     4
#
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    10
#
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    15
# accompanied this code).
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    16
#
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    20
#
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    23
# questions.
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    24
#
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    25
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    26
# This makefile is called for every imported module to copy the non class
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    27
# contents into the exploded jdk image.
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    28
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    29
default: all
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    30
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    31
include $(SPEC)
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    32
include MakeBase.gmk
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    33
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    34
LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    35
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    36
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    37
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53683
diff changeset
    38
$(call FillFindCache, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR))
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    39
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    40
ifneq ($(LIBS_DIR), )
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 47253
diff changeset
    41
  ifeq ($(call isTargetOs, windows), true)
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    42
    TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    43
41458
f285e333e8db 8167424: Various trivial fixes in build system
ihse
parents: 41260
diff changeset
    44
    $(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    45
        SRC := $(LIBS_DIR), \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    46
        DEST := $(JDK_OUTPUTDIR)/bin, \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    47
        FILES := $(filter $(TO_BIN_FILTER), \
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53683
diff changeset
    48
            $(call FindFiles, $(LIBS_DIR))) \
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    49
    ))
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    50
41458
f285e333e8db 8167424: Various trivial fixes in build system
ihse
parents: 41260
diff changeset
    51
    $(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    52
        SRC := $(LIBS_DIR), \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    53
        DEST := $(JDK_OUTPUTDIR)/lib, \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    54
        FILES := $(filter-out $(TO_BIN_FILTER), \
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53683
diff changeset
    55
            $(call FindFiles, $(LIBS_DIR))) \
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    56
    ))
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    57
    TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB)
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    58
  else
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    59
    $(eval $(call SetupCopyFiles, COPY_LIBS, \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    60
        SRC := $(LIBS_DIR), \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    61
        DEST := $(JDK_OUTPUTDIR)/lib, \
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53683
diff changeset
    62
        FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    63
    ))
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    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
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    66
    # copy to avoid having automated systems following symlinks when deleting files,
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    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
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    69
      LINK_MACRO := install-file
42983
7bf4468cdbc4 8172037: Change log message of SetupCopyFiles
erikj
parents: 41458
diff changeset
    70
      LOG_ACTION := Copying
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    71
    else
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    72
      LINK_MACRO := link-file-relative
42983
7bf4468cdbc4 8172037: Change log message of SetupCopyFiles
erikj
parents: 41458
diff changeset
    73
      LOG_ACTION := Creating symlink
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    74
    endif
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    75
    $(eval $(call SetupCopyFiles, LINK_LIBS, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    76
        SRC := $(LIBS_DIR), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    77
        DEST := $(JDK_OUTPUTDIR)/lib, \
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53683
diff changeset
    78
        FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    79
        MACRO := $(LINK_MACRO), \
42983
7bf4468cdbc4 8172037: Change log message of SetupCopyFiles
erikj
parents: 41458
diff changeset
    80
        LOG_ACTION := $(LOG_ACTION), \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    81
    ))
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 36506
diff changeset
    82
    TARGETS += $(COPY_LIBS) $(LINK_LIBS)
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    83
  endif
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    84
endif
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    85
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    86
ifneq ($(CMDS_DIR), )
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    87
  $(eval $(call SetupCopyFiles, COPY_CMDS, \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    88
      SRC := $(CMDS_DIR), \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    89
      DEST := $(JDK_OUTPUTDIR)/bin, \
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53683
diff changeset
    90
      FILES := $(call FindFiles, $(CMDS_DIR)), \
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    91
  ))
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    92
  TARGETS += $(COPY_CMDS)
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    93
endif
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    94
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    95
ifneq ($(CONF_DIR), )
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    96
  $(eval $(call SetupCopyFiles, COPY_CONF, \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    97
      SRC := $(CONF_DIR), \
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
    98
      DEST := $(JDK_OUTPUTDIR)/lib, \
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53683
diff changeset
    99
      FILES := $(call FindFiles, $(CONF_DIR)), \
36506
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
   100
  ))
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
   101
  TARGETS += $(COPY_CONF)
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
   102
endif
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
   103
17612cee3530 8142968: Module System implementation
alanb
parents:
diff changeset
   104
all: $(TARGETS)