make/common/Modules.gmk
author ssadetsky
Tue, 07 Jun 2016 11:40:28 +0300
changeset 39033 d61135c3795c
parent 38626 68d286c03952
child 39612 00cf8f38916f
permissions -rw-r--r--
8156121: "Fail forward" fails for GTK3 if no GTK2 available Reviewed-by: prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
     1
#
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
     2
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
     4
#
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    10
#
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    15
# accompanied this code).
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    16
#
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    20
#
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    23
# questions.
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    24
#
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    25
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    26
ifndef _MODULES_GMK
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    27
_MODULES_GMK := 1
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    28
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    29
################################################################################
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    30
#
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    31
# BOOT_MODULES are modules defined by the boot loader
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    32
# PLATFORM_MODULES are modules defined by the platform loader
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    33
# JRE_TOOL_MODULES are tools included in JRE and defined by the application loader
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    34
#
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    35
# All other modules not declared below are defined by the application loader
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    36
# and are not included in JRE.
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    37
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    38
BOOT_MODULES :=
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    39
PLATFORM_MODULES :=
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    40
JRE_TOOL_MODULES :=
37764
63e0379dd186 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37030
diff changeset
    41
UPGRADEABLE_MODULES :=
63e0379dd186 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37030
diff changeset
    42
AGGREGATOR_MODULES :=
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    43
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
    44
# Hook to include the corresponding custom file, if present.
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
    45
$(eval $(call IncludeCustomExtension, , common/Modules.gmk))
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
    46
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    47
BOOT_MODULES += \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    48
    java.base \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    49
    java.datatransfer \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    50
    java.desktop \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    51
    java.httpclient \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    52
    java.instrument \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    53
    java.logging \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    54
    java.management \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    55
    java.naming \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    56
    java.prefs \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    57
    java.rmi \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    58
    java.security.jgss \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    59
    java.security.sasl \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    60
    java.xml \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    61
    java.xml.crypto \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    62
    jdk.httpserver \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    63
    jdk.management \
37650
ef6c24163cb2 8044773: Refactor jdk.net API so that it can be moved out of the base module
chegar
parents: 37030
diff changeset
    64
    jdk.net \
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    65
    jdk.sctp \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    66
    jdk.security.auth \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    67
    jdk.security.jgss \
36793
8b116f192318 8153737: Unsupported Module
chegar
parents: 36790
diff changeset
    68
    jdk.unsupported \
36545
91a564aa5e89 8152697: JVMCI tests fail with UnsatisfiedLinkError as jdk.vm.ci not defined by boot loader
mchung
parents: 36543
diff changeset
    69
    jdk.vm.ci \
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    70
    #
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    71
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    72
# to be deprivileged
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    73
BOOT_MODULES += \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    74
    java.smartcardio \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    75
    jdk.naming.rmi \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    76
    #
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    77
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    78
UPGRADEABLE_MODULES += \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    79
    java.activation \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    80
    java.annotations.common \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    81
    java.corba \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    82
    java.transaction \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    83
    java.xml.bind \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    84
    java.xml.ws \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    85
    #
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    86
37975
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
    87
# Modules explicitly declared as not being upgradeable even though they require
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
    88
# an upgradeable module.
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
    89
NON_UPGRADEABLE_MODULES +=
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
    90
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    91
AGGREGATOR_MODULES += \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    92
    java.compact1 \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    93
    java.compact2 \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    94
    java.compact3 \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    95
    java.se \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    96
    java.se.ee \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    97
    #
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    98
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
    99
PLATFORM_MODULES += \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   100
    $(UPGRADEABLE_MODULES) \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   101
    $(AGGREGATOR_MODULES)
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   102
    #
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   103
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   104
PLATFORM_MODULES += \
37768
bdaea1ebd0ea 8154190: Deprivilege java.compiler module
mchung
parents: 37765
diff changeset
   105
    java.compiler \
37973
922326ad0c94 8154192: Deprivilege java.scripting module
sundar
parents: 37770
diff changeset
   106
    java.scripting \
38626
68d286c03952 8154189: Deprivilege java.sql and java.sql.rowset module
lancea
parents: 37975
diff changeset
   107
    java.sql \
68d286c03952 8154189: Deprivilege java.sql and java.sql.rowset module
lancea
parents: 37975
diff changeset
   108
    java.sql.rowset \
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   109
    jdk.accessibility \
37769
96f9a38fb70e 8155513: Deprivilege jdk.charsets
mchung
parents: 37768
diff changeset
   110
    jdk.charsets \
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   111
    jdk.crypto.ec \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   112
    jdk.crypto.pkcs11 \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   113
    jdk.dynalink \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   114
    jdk.jsobject \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   115
    jdk.xml.dom \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   116
    jdk.localedata \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   117
    jdk.naming.dns \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   118
    jdk.scripting.nashorn \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   119
    jdk.zipfs \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   120
    #
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   121
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   122
JRE_TOOL_MODULES += \
36790
7191e0b1537e 8153660: jwdp.so/dll missing from JRE image
erikj
parents: 36725
diff changeset
   123
    jdk.jdwp.agent \
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   124
    jdk.pack200 \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   125
    jdk.scripting.nashorn.shell \
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   126
    #
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   127
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   128
ifeq ($(OPENJDK_TARGET_OS), windows)
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   129
  PLATFORM_MODULES += jdk.crypto.mscapi
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   130
endif
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   131
ifeq ($(OPENJDK_TARGET_OS), solaris)
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   132
  PLATFORM_MODULES += jdk.crypto.ucrypto
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   133
endif
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   134
37770
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents: 37769
diff changeset
   135
# These modules are included in the interim image which is used to run profiling
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents: 37769
diff changeset
   136
# before building the real images.
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents: 37769
diff changeset
   137
INTERIM_IMAGE_MODULES := java.base java.logging
9f040cf69078 8150044: Generate classlists at build-time
redestad
parents: 37769
diff changeset
   138
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   139
################################################################################
34116
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
   140
# Some platforms don't have the serviceability agent
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   141
34116
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
   142
ifeq ($(INCLUDE_SA), false)
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
   143
  MODULES_FILTER += jdk.hotspot.agent
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
   144
endif
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
   145
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
   146
################################################################################
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   147
# Module list macros
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   148
37030
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   149
# Use append so that the custom extension may add to these variables
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   150
37030
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   151
GENERATED_SRC_DIRS += \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   152
    $(SUPPORT_OUTPUTDIR)/gensrc \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   153
    #
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   154
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   155
TOP_SRC_DIRS += \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   156
    $(CORBA_TOPDIR)/src \
33045
00f484891bcf 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 30095
diff changeset
   157
    $(HOTSPOT_TOPDIR)/src \
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   158
    $(JDK_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   159
    $(LANGTOOLS_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   160
    $(JAXP_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   161
    $(JAXWS_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   162
    $(NASHORN_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   163
    #
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   164
37030
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   165
SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   166
ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   167
  SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   168
endif
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   169
SRC_SUBDIRS += share/classes
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   170
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   171
# Find all module-info.java files for the current build target platform and
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   172
# configuration.
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   173
# Param 1 - Module to find for, set to * for finding all
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   174
FindAllModuleInfos = \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   175
    $(wildcard \
37030
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   176
        $(foreach sub, $(SRC_SUBDIRS), \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   177
          $(patsubst %,%/$(strip $1)/$(sub)/module-info.java, $(TOP_SRC_DIRS))) \
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   178
        $(patsubst %,%/$(strip $1)/module-info.java, $(IMPORT_MODULES_SRC)))
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   179
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   180
# Extract the module names from the paths of module-info.java files. The
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   181
# position of the module directory differs depending on if this is an imported
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   182
# src dir or not.
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   183
GetModuleNameFromModuleInfo = \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   184
    $(strip $(foreach mi, $1, \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   185
      $(if $(filter $(addsuffix %, $(IMPORT_MODULES_SRC)), $(mi)), \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   186
        $(notdir $(patsubst %/,%, $(dir $(mi)))), \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   187
        $(notdir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(mi)))))))))))
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   188
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   189
# Find all modules by looking for module-info.java files and looking at parent
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   190
# directories.
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   191
FindAllModules = \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   192
    $(sort $(filter-out $(MODULES_FILTER), \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   193
    $(call GetModuleNameFromModuleInfo, $(MODULE_INFOS))))
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   194
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   195
FindImportedModules = \
37652
67e98335455c 8155629: MODULES_FILTER should apply to imported modules
erikj
parents: 37650
diff changeset
   196
    $(filter-out $(MODULES_FILTER), \
67e98335455c 8155629: MODULES_FILTER should apply to imported modules
erikj
parents: 37650
diff changeset
   197
    $(if $(IMPORT_MODULES_CLASSES), $(notdir $(wildcard $(IMPORT_MODULES_CLASSES)/*))))
26548
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
   198
37030
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   199
# Find all source dirs for a particular module
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   200
# $1 - Module to find source dirs for
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   201
FindModuleSrcDirs = \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   202
    $(strip $(wildcard \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   203
        $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   204
        $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   205
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   206
# Construct the complete module source path
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   207
GetModuleSrcPath = \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   208
    $(call PathList, \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   209
        $(addsuffix /*, $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   210
        $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
e047c2f3f510 8153969: Clean up module src dir logic
erikj
parents: 36793
diff changeset
   211
26548
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
   212
################################################################################
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   213
# Extract module dependencies from module-info.java files.
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   214
26548
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
   215
MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   216
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   217
MODULE_INFOS := $(call FindAllModuleInfos, *)
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   218
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   219
$(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   220
    $(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps)
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   221
	$(MKDIR) -p $(@D)
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   222
	$(RM) $@
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   223
	$(foreach m, $(MODULE_INFOS), \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   224
	    ( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) :=" && \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   225
	      $(NAWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   226
	          BEGIN      { if (MODULE != "java.base") printf(" java.base"); } \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   227
	          /requires/ { sub(/;/, ""); \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   228
	                       sub(/requires/, ""); \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   229
	                       sub(/public/, ""); \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   230
	                       sub(/\/\/.*/, ""); \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   231
	                       sub(/\/\*.*\*\//, ""); \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   232
	                       gsub(/ /, ""); \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   233
	                       printf(" %s", $$0) } \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   234
	          END        { printf("\n") }' $m \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   235
	    ) >> $@ $(NEWLINE))
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   236
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   237
-include $(MODULE_DEPS_MAKEFILE)
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   238
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   239
# Param 1: Module to find deps for
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   240
FindDepsForModule = \
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   241
  $(DEPS_$(strip $1))
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   242
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   243
# Finds transitive dependencies in 3 levels.
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   244
# Param 1: Module to find transitive deps for
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   245
FindTransitiveDepsForModule = \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   246
    $(sort $(call FindDepsForModule, $1) \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   247
        $(foreach m, $(call FindDepsForModule, $1), \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   248
            $(call FindDepsForModule, $m) \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   249
            $(foreach n, $(call FindDepsForModule, $m), \
17612cee3530 8142968: Module System implementation
alanb
parents: 35030
diff changeset
   250
                 $(call FindDepsForModule, $n))))
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   251
37975
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   252
# Upgradeable modules are those that are either defined as upgradeable or that
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   253
# require an upradeable module.
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   254
FindAllUpgradeableModules = \
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   255
    $(filter-out $(MODULES_FILTER) $(NON_UPGRADEABLE_MODULES), \
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   256
        $(sort $(UPGRADEABLE_MODULES) $(foreach m, \
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   257
            $(filter-out $(UPGRADEABLE_MODULES), $(call FindAllModules)), \
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   258
          $(if $(filter $(UPGRADEABLE_MODULES), \
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   259
              $(call FindTransitiveDepsForModule, $m)), \
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   260
            $m \
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   261
          ) \
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   262
        )) \
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   263
    )
551c5d86de79 8155786: Determine modules depending on upgradeable modules directly and indirectly
erikj
parents: 37973
diff changeset
   264
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   265
################################################################################
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   266
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   267
# Param 1 - Name of module
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   268
define ReadSingleImportMetaData
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   269
    ifneq ($$(wildcard $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties), )
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   270
      classloader :=
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   271
      include_in_jre :=
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   272
      include_in_jdk :=
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   273
      include $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   274
      ifeq ($$(include_in_jre), true)
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   275
        JRE_MODULES += $1
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   276
      endif
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   277
      ifeq ($$(include_in_jdk), true)
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   278
        JDK_MODULES += $1
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   279
      endif
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   280
      ifeq ($$(classloader), boot)
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   281
        BOOT_MODULES += $1
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   282
      else ifeq ($$(classloader), ext)
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   283
        PLATFORM_MODULES += $1
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   284
      endif
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   285
    else
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   286
      # Default to include in all
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   287
      JRE_MODULES += $1
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   288
      JDK_MODULES += $1
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   289
    endif
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   290
endef
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   291
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   292
# Reading the imported modules metadata has a cost, so to make it available,
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   293
# a makefile needs to eval-call this macro first. After calling this, the
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   294
# following variables are populated with data from the imported modules:
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   295
# * JRE_MODULES
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   296
# * JDK_MODULES
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   297
# * BOOT_MODULES
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   298
# * PLATFORM_MODULES
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   299
# * JRE_TOOL_MODULES
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   300
define ReadImportMetaData
36725
f458544b0d76 8153261: Clean up fix for JDK-8153217
erikj
parents: 36723
diff changeset
   301
    IMPORTED_MODULES := $$(call FindImportedModules)
f458544b0d76 8153261: Clean up fix for JDK-8153217
erikj
parents: 36723
diff changeset
   302
    $$(foreach m, $$(IMPORTED_MODULES), \
f458544b0d76 8153261: Clean up fix for JDK-8153217
erikj
parents: 36723
diff changeset
   303
      $$(eval $$(call ReadSingleImportMetaData, $$m)))
36543
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   304
endef
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   305
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   306
################################################################################
a8ce27ddc757 8152197: Single place to specify module-specific information for images build
mchung
parents: 36506
diff changeset
   307
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
   308
endif # _MODULES_GMK