make/ModuleWrapper.gmk
author coffeys
Wed, 28 Feb 2018 18:28:17 +0000
changeset 49069 e37b804ae0b1
parent 42983 7bf4468cdbc4
child 52022 804792ce736f
permissions -rw-r--r--
8193892: Impact of noncloneable MessageDigest implementation Reviewed-by: wetmore, valeriep, xuelei
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     1
#
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
     2
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     4
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    10
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    15
# accompanied this code).
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    16
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    20
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    23
# questions.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    24
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    25
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    26
################################################################################
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    27
# This makefile is called from Main.gmk, through a macro in MakeHelpers.gmk
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    28
# and wraps calls to makefiles for specific modules and build phases. Having
28356
3b985eeacb08 8066769: Fix merge errors following JDK-8049367
ihse
parents: 27560
diff changeset
    29
# this wrapper reduces the need for boilerplate code. It also provides
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    30
# opportunity for automatic copying of files to an interim exploded runnable
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    31
# image.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    32
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    33
default: all
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    34
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    35
include $(SPEC)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    36
include MakeBase.gmk
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    37
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    38
# All makefiles should add the targets to be built to this variable.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    39
TARGETS :=
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    40
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    41
# Include the file being wrapped.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    42
include $(MAKEFILE_PREFIX)-$(MODULE).gmk
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    43
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    44
# Setup copy rules from the modules directories to the jdk image directory.
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    45
ifeq ($(OPENJDK_TARGET_OS), windows)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    46
  TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    47
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    48
  $(eval $(call SetupCopyFiles, COPY_LIBS_TO_BIN, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    49
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    50
      DEST := $(JDK_OUTPUTDIR)/bin, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    51
      FILES := $(filter $(TO_BIN_FILTER), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    52
          $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    53
          $(TARGETS))), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    54
  ))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    55
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    56
  $(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    57
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    58
      DEST := $(JDK_OUTPUTDIR)/lib, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    59
      FILES := $(filter-out $(TO_BIN_FILTER), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    60
          $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    61
          $(TARGETS))), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    62
  ))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    63
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    64
else
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    65
  $(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    66
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    67
      DEST := $(JDK_OUTPUTDIR)/lib, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    68
      FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    69
          $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    70
          $(TARGETS))), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    71
  ))
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    72
  $(eval $(call SetupCopyFiles, LINK_LIBS_TO_LIB, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    73
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    74
      DEST := $(JDK_OUTPUTDIR)/lib, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    75
      FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    76
          $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    77
          $(TARGETS))), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    78
      MACRO := link-file-relative, \
42983
7bf4468cdbc4 8172037: Change log message of SetupCopyFiles
erikj
parents: 41260
diff changeset
    79
      LOG_ACTION := Creating symlink, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    80
  ))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    81
endif
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    82
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    83
$(eval $(call SetupCopyFiles, COPY_INCLUDE, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    84
    SRC := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    85
    DEST := $(JDK_OUTPUTDIR)/include, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    86
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE)/%, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    87
        $(TARGETS)), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    88
))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    89
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    90
$(eval $(call SetupCopyFiles, COPY_CMDS, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    91
    SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    92
    DEST := $(JDK_OUTPUTDIR)/bin, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    93
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/%, $(TARGETS)), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    94
))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    95
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
    96
$(eval $(call SetupCopyFiles, COPY_CONF, \
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    97
    SRC := $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    98
    DEST := $(JDK_OUTPUTDIR)/conf, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    99
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE)/%, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
   100
        $(TARGETS)), \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
   101
))
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   102
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   103
all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 28356
diff changeset
   104
    $(COPY_INCLUDE) $(COPY_CMDS) $(COPY_CONF) $(LINK_LIBS_TO_LIB)