make/CopyImportModules.gmk
changeset 54380 e297c7bb6469
parent 53683 48ff68e2fe5c
equal deleted inserted replaced
54379:40a7e2fc9beb 54380:e297c7bb6469
     1 #
     1 #
     2 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     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.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     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
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
    33 
    33 
    34 LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
    34 LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
    35 CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
    35 CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
    36 CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
    36 CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
    37 
    37 
    38 $(eval $(call FillCacheFind, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR)))
    38 $(call FillFindCache, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR))
    39 
    39 
    40 ifneq ($(LIBS_DIR), )
    40 ifneq ($(LIBS_DIR), )
    41   ifeq ($(call isTargetOs, windows), true)
    41   ifeq ($(call isTargetOs, windows), true)
    42     TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
    42     TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
    43 
    43 
    44     $(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \
    44     $(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \
    45         SRC := $(LIBS_DIR), \
    45         SRC := $(LIBS_DIR), \
    46         DEST := $(JDK_OUTPUTDIR)/bin, \
    46         DEST := $(JDK_OUTPUTDIR)/bin, \
    47         FILES := $(filter $(TO_BIN_FILTER), \
    47         FILES := $(filter $(TO_BIN_FILTER), \
    48             $(call CacheFind, $(LIBS_DIR))) \
    48             $(call FindFiles, $(LIBS_DIR))) \
    49     ))
    49     ))
    50 
    50 
    51     $(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
    51     $(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
    52         SRC := $(LIBS_DIR), \
    52         SRC := $(LIBS_DIR), \
    53         DEST := $(JDK_OUTPUTDIR)/lib, \
    53         DEST := $(JDK_OUTPUTDIR)/lib, \
    54         FILES := $(filter-out $(TO_BIN_FILTER), \
    54         FILES := $(filter-out $(TO_BIN_FILTER), \
    55             $(call CacheFind, $(LIBS_DIR))) \
    55             $(call FindFiles, $(LIBS_DIR))) \
    56     ))
    56     ))
    57     TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB)
    57     TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB)
    58   else
    58   else
    59     $(eval $(call SetupCopyFiles, COPY_LIBS, \
    59     $(eval $(call SetupCopyFiles, COPY_LIBS, \
    60         SRC := $(LIBS_DIR), \
    60         SRC := $(LIBS_DIR), \
    61         DEST := $(JDK_OUTPUTDIR)/lib, \
    61         DEST := $(JDK_OUTPUTDIR)/lib, \
    62         FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
    62         FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
    63     ))
    63     ))
    64 
    64 
    65     # Use relative links if the import dir is inside the OUTPUTDIR, otherwise
    65     # Use relative links if the import dir is inside the OUTPUTDIR, otherwise
    66     # copy to avoid having automated systems following symlinks when deleting files,
    66     # copy to avoid having automated systems following symlinks when deleting files,
    67     # or risk invalidating the build output from external changes.
    67     # or risk invalidating the build output from external changes.
    73       LOG_ACTION := Creating symlink
    73       LOG_ACTION := Creating symlink
    74     endif
    74     endif
    75     $(eval $(call SetupCopyFiles, LINK_LIBS, \
    75     $(eval $(call SetupCopyFiles, LINK_LIBS, \
    76         SRC := $(LIBS_DIR), \
    76         SRC := $(LIBS_DIR), \
    77         DEST := $(JDK_OUTPUTDIR)/lib, \
    77         DEST := $(JDK_OUTPUTDIR)/lib, \
    78         FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
    78         FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
    79         MACRO := $(LINK_MACRO), \
    79         MACRO := $(LINK_MACRO), \
    80         LOG_ACTION := $(LOG_ACTION), \
    80         LOG_ACTION := $(LOG_ACTION), \
    81     ))
    81     ))
    82     TARGETS += $(COPY_LIBS) $(LINK_LIBS)
    82     TARGETS += $(COPY_LIBS) $(LINK_LIBS)
    83   endif
    83   endif
    85 
    85 
    86 ifneq ($(CMDS_DIR), )
    86 ifneq ($(CMDS_DIR), )
    87   $(eval $(call SetupCopyFiles, COPY_CMDS, \
    87   $(eval $(call SetupCopyFiles, COPY_CMDS, \
    88       SRC := $(CMDS_DIR), \
    88       SRC := $(CMDS_DIR), \
    89       DEST := $(JDK_OUTPUTDIR)/bin, \
    89       DEST := $(JDK_OUTPUTDIR)/bin, \
    90       FILES := $(call CacheFind, $(CMDS_DIR)), \
    90       FILES := $(call FindFiles, $(CMDS_DIR)), \
    91   ))
    91   ))
    92   TARGETS += $(COPY_CMDS)
    92   TARGETS += $(COPY_CMDS)
    93 endif
    93 endif
    94 
    94 
    95 ifneq ($(CONF_DIR), )
    95 ifneq ($(CONF_DIR), )
    96   $(eval $(call SetupCopyFiles, COPY_CONF, \
    96   $(eval $(call SetupCopyFiles, COPY_CONF, \
    97       SRC := $(CONF_DIR), \
    97       SRC := $(CONF_DIR), \
    98       DEST := $(JDK_OUTPUTDIR)/lib, \
    98       DEST := $(JDK_OUTPUTDIR)/lib, \
    99       FILES := $(call CacheFind, $(CONF_DIR)), \
    99       FILES := $(call FindFiles, $(CONF_DIR)), \
   100   ))
   100   ))
   101   TARGETS += $(COPY_CONF)
   101   TARGETS += $(COPY_CONF)
   102 endif
   102 endif
   103 
   103 
   104 all: $(TARGETS)
   104 all: $(TARGETS)