make/common/Modules.gmk
author erikj
Sat, 16 Jan 2016 13:01:43 +0100
changeset 35008 ef0cd710989f
parent 34116 b746e382da18
child 35030 916c91ff2589
permissions -rw-r--r--
8146403: Windows build can be faster Reviewed-by: ihse
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
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    29
################################################################################
34116
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    30
# Some platforms don't have the serviceability agent
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    31
ifeq ($(INCLUDE_SA), false)
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    32
  MODULES_FILTER += jdk.hotspot.agent
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    33
endif
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    34
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    35
################################################################################
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    36
# Module list macros
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    37
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    38
ALL_TOP_SRC_DIRS := \
33045
00f484891bcf 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 30095
diff changeset
    39
    $(HOTSPOT_TOPDIR)/src \
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    40
    $(JDK_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    41
    $(LANGTOOLS_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    42
    $(CORBA_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    43
    $(JAXP_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    44
    $(JAXWS_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    45
    $(NASHORN_TOPDIR)/src \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    46
    #
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    47
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    48
# Find all modules with java sources by looking in the source dirs
34116
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    49
# jdk.hotspot.agent currently doesn't comply with source dir policy.
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    50
define FindJavaModules
30095
0034766ccb09 8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents: 27602
diff changeset
    51
  $(filter-out $(MODULES_FILTER), $(sort $(notdir \
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    52
      $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    53
      $(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \
27586
e7cfdc266a70 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 27137
diff changeset
    54
          $(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS)) \
34116
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    55
          $(patsubst %,%/*/$(OPENJDK_TARGET_OS_TYPE)/classes/*, $(ALL_TOP_SRC_DIRS))))))))))) \
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    56
      jdk.hotspot.agent)
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    57
endef
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    58
26548
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
    59
# Find all modules with source for the target platform.
34116
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    60
# jdk.hotspot.agent currently doesn't comply with source dir policy.
26548
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
    61
define FindAllModules
30095
0034766ccb09 8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents: 27602
diff changeset
    62
  $(sort $(filter-out $(MODULES_FILTER) closed demo sample, \
0034766ccb09 8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents: 27602
diff changeset
    63
      $(notdir $(patsubst %/,%, $(dir \
26548
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
    64
      $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
    65
      $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \
34116
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    66
      $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS)))))) \
b746e382da18 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents: 33045
diff changeset
    67
      jdk.hotspot.agent))
26548
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
    68
endef
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
    69
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
    70
################################################################################
35008
ef0cd710989f 8146403: Windows build can be faster
erikj
parents: 34116
diff changeset
    71
# The module deps makefile is generated in make/GenerateModuleDeps.gmk
26548
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26116
diff changeset
    72
MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    73
-include $(MODULE_DEPS_MAKEFILE)
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    74
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    75
# Param 1: Module to find deps for
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    76
define FindDepsForModule
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    77
  $(DEPS_$(strip $1))
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    78
endef
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    79
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    80
################################################################################
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    81
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    82
# Hook to include the corresponding custom file, if present.
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    83
$(eval $(call IncludeCustomExtension, , common/Modules.gmk))
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    84
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
diff changeset
    85
endif # _MODULES_GMK