make/ModuleWrapper.gmk
author kzhaldyb
Fri, 02 Sep 2016 01:39:47 +0000
changeset 40912 7f19457ea0fc
parent 28356 3b985eeacb08
child 41260 4f71f07b30d1
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     1
#
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     2
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
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
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    48
  $(eval $(call SetupCopyFiles,COPY_LIBS_TO_BIN, \
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)/%, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    53
          $(TARGETS)))))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    54
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    55
  $(eval $(call SetupCopyFiles,COPY_LIBS_TO_LIB, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    56
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    57
      DEST := $(JDK_OUTPUTDIR)/lib, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    58
      FILES := $(filter-out $(TO_BIN_FILTER), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    59
          $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    60
          $(TARGETS)))))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    61
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    62
else
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    63
  $(eval $(call SetupCopyFiles,COPY_LIBS_TO_LIB, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    64
      SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    65
      DEST := $(JDK_OUTPUTDIR)/lib, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    66
      FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    67
          $(TARGETS))))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    68
endif
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    69
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    70
$(eval $(call SetupCopyFiles,COPY_INCLUDE, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    71
    SRC := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    72
    DEST := $(JDK_OUTPUTDIR)/include, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    73
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE)/%, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    74
          $(TARGETS))))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    75
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    76
$(eval $(call SetupCopyFiles,COPY_CMDS, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    77
    SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    78
    DEST := $(JDK_OUTPUTDIR)/bin, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    79
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/%, $(TARGETS))))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    80
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    81
$(eval $(call SetupCopyFiles,COPY_CONF, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    82
    SRC := $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE), \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    83
    DEST := $(JDK_OUTPUTDIR)/conf, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    84
    FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_conf/$(MODULE)/%, \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    85
          $(TARGETS))))
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    86
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    87
all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    88
    $(COPY_INCLUDE) $(COPY_CMDS) $(COPY_CONF)