make/Main.gmk
author weijun
Tue, 14 Oct 2014 10:07:44 +0800
changeset 27038 64cb6608f8a6
parent 26673 12957484d8c4
child 27136 ac3ebfa6b4ee
permissions -rw-r--r--
8029659: Keytool, print key algorithm of certificate or key entry Reviewed-by: xuelei
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     1
#
22714
a752920c4317 8034191: Move relevant parts of build system to new closed repo
ihse
parents: 22031
diff changeset
     2
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     4
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    10
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    15
# accompanied this code).
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    16
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    20
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    23
# questions.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    24
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    25
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    26
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    27
# This is the main makefile containing most actual top level targets. It needs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    28
# to be called with a SPEC file defined.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    29
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    30
# Declare default target
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    31
default:
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    32
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    33
# Now load the spec
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    34
include $(SPEC)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    35
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    36
include $(SRC_ROOT)/make/MakeHelpers.gmk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    37
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
    38
# Load the vital tools for all the makefiles.
21759
e24e22311718 8027566: Remove the old build system
ihse
parents: 21173
diff changeset
    39
include $(SRC_ROOT)/make/common/MakeBase.gmk
26116
f051bd253364 8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents: 26115
diff changeset
    40
include $(SRC_ROOT)/make/common/Modules.gmk
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    41
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    42
# Load common profile names definitions
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    43
include $(JDK_TOPDIR)/make/ProfileNames.gmk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    44
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    45
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    46
# valid top level targets. It's used to declare them all as PHONY and to 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    47
# generate the -only targets.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    48
ALL_TARGETS :=
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    49
22714
a752920c4317 8034191: Move relevant parts of build system to new closed repo
ihse
parents: 22031
diff changeset
    50
# Hook to include the corresponding custom file, if present.
a752920c4317 8034191: Move relevant parts of build system to new closed repo
ihse
parents: 22031
diff changeset
    51
$(eval $(call IncludeCustomExtension, , Main.gmk))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    52
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    53
# All modules for the current target platform.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    54
# Manually add jdk.hotspot.agent for now.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    55
ALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    56
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    57
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    58
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    59
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    60
# Recipes for all targets. Only recipes, dependencies are declared later.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    61
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    62
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    63
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    64
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    65
# Interim/build tools targets, compiling tools used during the build
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    66
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    67
interim-langtools:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    68
	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    69
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    70
interim-corba:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    71
	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCorba.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    72
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    73
interim-rmic:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    74
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    75
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    76
build-tools-jdk:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    77
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    78
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    79
ALL_TARGETS += interim-langtools interim-corba build-tools-jdk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    80
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    81
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    82
# Special targets for certain modules
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    83
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    84
import-hotspot:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    85
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    86
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    87
unpack-sec:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    88
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    89
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    90
policy-jars:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    91
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreatePolicyJars.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    92
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    93
ALL_TARGETS += import-hotspot unpack-sec policy-jars
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    94
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    95
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    96
# Gensrc targets, generating source before java compilation can be done
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    97
JDK_GENSRC_MODULES := $(call FindModulesWithMakefileFor, gensrc, Gensrc)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    98
LANGTOOLS_GENSRC_MODULES := jdk.compiler.tools
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    99
CORBA_GENSRC_MODULES := java.corba
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   100
GENSRC_MODULES := $(JDK_GENSRC_MODULES) $(LANGTOOLS_GENSRC_MODULES) \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   101
    $(CORBA_GENSRC_MODULES)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   102
JDK_GENSRC_TARGETS := $(addsuffix -gensrc, $(JDK_GENSRC_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   103
LANGTOOLS_GENSRC_TARGETS := $(addsuffix -gensrc, $(LANGTOOLS_GENSRC_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   104
CORBA_GENSRC_TARGETS := $(addsuffix -gensrc, $(CORBA_GENSRC_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   105
GENSRC_TARGETS := $(addsuffix -gensrc, $(GENSRC_MODULES))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   106
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   107
jdk.compiler.tools-gensrc:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   108
	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcLangtools.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   109
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   110
java.corba-gensrc:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   111
	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcCorba.gmk)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   112
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   113
# Declare recipes for all jdk <module>-gensrc targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   114
$(foreach m, $(JDK_GENSRC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   115
    $m, gensrc, gensrc, Gensrc)))
15053
64278cb83950 8005549: build-infra: Merge NewMakefile.gmk and common/makefiles/Makefile
erikj
parents: 14466
diff changeset
   116
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   117
ALL_TARGETS += $(GENSRC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   118
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   119
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   120
# Generate data targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   121
GENDATA_MODULES := $(call FindModulesWithMakefileFor, gendata, Gendata)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   122
GENDATA_TARGETS := $(addsuffix -gendata, $(GENDATA_MODULES))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   123
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   124
# Declare recipes for all <module>-gendata targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   125
$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   126
    $m, gendata, gendata, Gendata)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   127
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   128
$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareGendataRecipe,$m)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   129
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   130
ALL_TARGETS += $(GENDATA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   131
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   132
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   133
# Copy files targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   134
COPY_MODULES := $(call FindModulesWithMakefileFor, copy, Copy)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   135
COPY_TARGETS := $(addsuffix -copy, $(COPY_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   136
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   137
# Declare recipes for all <module>-copy targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   138
$(foreach m, $(COPY_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   139
    $m, copy, copy, Copy)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   140
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   141
ALL_TARGETS += $(COPY_TARGETS)
15395
e5d837c6e999 8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents: 15060
diff changeset
   142
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   143
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   144
# Targets for compiling all java modules. Nashorn is treated separately.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   145
JAVA_MODULES := $(call FindJavaModules)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   146
JAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   147
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   148
define DeclareCompileJavaRecipe
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   149
  $1-java:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   150
	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   151
	    $1 JAVA_MODULES=$1)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   152
endef
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   153
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   154
$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   155
    $(eval $(call DeclareCompileJavaRecipe,$m)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   156
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   157
# Build nashorn. Needs to be compiled separately from the rest of the modules
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   158
# due to nasgen.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   159
jdk.scripting.nashorn-java:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   160
	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   161
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   162
ALL_TARGETS += $(JAVA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   163
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   164
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   165
# Targets for running rmic.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   166
RMIC_MODULES := $(call FindModulesWithMakefileFor, rmic, Rmic)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   167
RMIC_TARGETS := $(addsuffix -rmic, $(RMIC_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   168
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   169
# Declare recipes for all <module>-rmic targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   170
$(foreach m, $(RMIC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   171
    $m, rmic, rmic, Rmic)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   172
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   173
ALL_TARGETS += $(RMIC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   174
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   175
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   176
# Targets for compiling native libraries
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   177
ALL_LIB_MODULES := $(call FindModulesWithMakefileFor, lib, Lib)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   178
LIB_MODULES := $(filter $(ALL_MODULES), $(ALL_LIB_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   179
LIB_TARGETS := $(addsuffix -libs, $(LIB_MODULES))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   180
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   181
# Declare recipes for all <module>-libs targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   182
$(foreach m, $(LIB_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   183
    $m, libs, lib, Lib)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   184
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   185
ALL_TARGETS += $(LIB_TARGETS)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   186
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   187
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   188
# Targets for compiling native executables
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   189
ALL_LAUNCHER_MODULES := $(call FindModulesWithMakefileFor, launcher, Launcher)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   190
LAUNCHER_MODULES := $(filter $(ALL_MODULES), $(ALL_LAUNCHER_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   191
LAUNCHER_TARGETS := $(addsuffix -launchers, $(LAUNCHER_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   192
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   193
# Declare recipes for all <module>-launchers targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   194
$(foreach m, $(LAUNCHER_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   195
    $m, launchers, launcher, Launcher)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   196
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   197
ALL_TARGETS += $(LAUNCHER_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   198
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   199
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   200
# Build hotspot target
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   201
14378
0ef5d942b98e 8002028: build-infra: need no-hotspot partial build
tbell
parents: 14111
diff changeset
   202
ifeq ($(BUILD_HOTSPOT),true)
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   203
  hotspot:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   204
	($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
14378
0ef5d942b98e 8002028: build-infra: need no-hotspot partial build
tbell
parents: 14111
diff changeset
   205
endif
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   206
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   207
ALL_TARGETS += hotspot
15903
bc0e6cd9d760 8008914: Add nashorn to the tl build
jjg
parents: 15587
diff changeset
   208
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   209
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   210
# Build demos and samples targets
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   211
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   212
demos:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   213
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   214
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   215
samples:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   216
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   217
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   218
ALL_TARGETS += demos samples
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   219
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   220
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   221
# Image targets
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   222
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   223
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   224
# used to track the exact sources used to build that image.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   225
source-tips: $(OUTPUT_ROOT)/source_tips
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   226
$(OUTPUT_ROOT)/source_tips: FRC
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   227
	@$(MKDIR) -p $(@D)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   228
	@$(RM) $@
18052
f326fa317a81 8012564: The SOURCE value in release file of JDK 8 doesn't contain valid changesets for some OS since b74
erikj
parents: 17664
diff changeset
   229
	@$(call GetSourceTips)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   230
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   231
security-jars:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   232
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateSecurityJars.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   233
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   234
nashorn-jar:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   235
	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk all)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   236
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   237
# Creates the jar files (rt.jar resources.jar etc)
26115
7a9dc384f3c8 8055188: General cleanup of minor issues from source restructure
erikj
parents: 25883
diff changeset
   238
main-jars:
26285
705a9199d2e4 8057132: Build fails if PROFILE is set in the environment
erikj
parents: 26132
diff changeset
   239
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE="" -f CreateJars.gmk)
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   240
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   241
# Creates the images (j2sdk-image j2re-image etc)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   242
images:
26285
705a9199d2e4 8057132: Build fails if PROFILE is set in the environment
erikj
parents: 26132
diff changeset
   243
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE="" -f Images.gmk)
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   244
        ifeq ($(OPENJDK_TARGET_OS), macosx)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   245
	  +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   246
        endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   247
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   248
# Create Compact Profile jars
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   249
PROFILE_JARS_TARGETS := $(addsuffix -jars, $(ALL_PROFILES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   250
$(PROFILE_JARS_TARGETS):
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   251
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-jars=%) -f CreateJars.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   252
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   253
# Create Compact Profile images
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   254
PROFILE_IMAGES_TARGETS := $(addsuffix -images, $(ALL_PROFILES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   255
$(PROFILE_IMAGES_TARGETS):
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   256
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-images=%) \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   257
	    JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/j2re-$(word $(call profile_number,$(@:%-images=%)),$(PROFILE_NAMES))-image \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   258
	    -f Images.gmk profile-image)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   259
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   260
profiles-oscheck:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   261
        ifneq ($(OPENJDK_TARGET_OS), linux)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   262
	  @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   263
        endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   264
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   265
bootcycle-images:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   266
	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   267
	+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk images
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   268
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   269
ALL_TARGETS += source-tips security-jars nashorn-jar main-jars images \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   270
    $(PROFILE_JARS_TARGETS) $(PROFILE_IMAGES_TARGETS) profiles-oscheck \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   271
    bootcycle-images
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   272
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   273
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   274
# Docs targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   275
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   276
docs-javadoc:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   277
	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   278
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   279
docs-jvmtidoc:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   280
	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   281
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   282
ALL_TARGETS += docs-javadoc docs-jvmtidoc
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   283
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   284
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   285
# Test target
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   286
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   287
test:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   288
	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   289
	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_OUTPUT_DIR) \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   290
	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   291
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   292
test-make:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   293
	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   294
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   295
ALL_TARGETS += test test-make
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   296
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   297
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   298
# Verification targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   299
26132
11df1233e1e8 8055856: checkdeps build target doesn't work for cross-compilation builds
mchung
parents: 26128
diff changeset
   300
verify-modules:
26547
f8b190ea8955 8058367: Add verify-modules target to the default and images target
mchung
parents: 26398
diff changeset
   301
	@$(call TargetEnter)
26132
11df1233e1e8 8055856: checkdeps build target doesn't work for cross-compilation builds
mchung
parents: 26128
diff changeset
   302
	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CheckModules.gmk)
26547
f8b190ea8955 8058367: Add verify-modules target to the default and images target
mchung
parents: 26398
diff changeset
   303
	@$(call TargetExit)
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   304
26132
11df1233e1e8 8055856: checkdeps build target doesn't work for cross-compilation builds
mchung
parents: 26128
diff changeset
   305
ALL_TARGETS += verify-modules
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   306
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   307
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   308
# Install targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   309
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   310
install:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   311
	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   312
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   313
ALL_TARGETS += install
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   314
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   315
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   316
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   317
# Dependency declarations between targets. 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   318
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   319
# These are declared in two groups. First all dependencies between targets that 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   320
# have recipes above as these dependencies may be disabled. Then the aggregator
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   321
# targets that do not have recipes of their own, which will never have their
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   322
# dependencies disabled.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   323
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   324
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   325
# Targets with recipes above
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   326
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   327
# If running an *-only target, parallel execution and dependencies between 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   328
# recipe targets are disabled. This makes it possible to run a select set of 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   329
# recipe targets in order. It's the responsibility of the user to make sure
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   330
# all prerequisites are fulfilled. 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   331
ifneq ($(findstring -only, $(MAKECMDGOALS)), )
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   332
  .NOTPARALLEL:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   333
else
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   334
  interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   335
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   336
  build-tools-jdk: interim-langtools
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   337
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   338
  $(CORBA_GENSRC_TARGETS): interim-langtools
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   339
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   340
  $(JDK_GENSRC_TARGETS): interim-langtools build-tools-jdk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   341
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   342
  interim-corba: $(CORBA_GENSRC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   343
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   344
  $(GENDATA_TARGETS): interim-langtools build-tools-jdk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   345
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   346
  interim-rmic: interim-langtools
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   347
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   348
  $(RMIC_TARGETS): interim-langtools interim-corba interim-rmic
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   349
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   350
  import-hotspot: hotspot
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   351
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   352
  $(LIB_TARGETS): import-hotspot
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   353
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   354
  $(LAUNCHER_TARGETS): java.base-libs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   355
26115
7a9dc384f3c8 8055188: General cleanup of minor issues from source restructure
erikj
parents: 25883
diff changeset
   356
  # The demos are currently linking to libjvm and libjava, just like all other
7a9dc384f3c8 8055188: General cleanup of minor issues from source restructure
erikj
parents: 25883
diff changeset
   357
  # jdk libs, even though they don't need to. To avoid warnings, make sure they
7a9dc384f3c8 8055188: General cleanup of minor issues from source restructure
erikj
parents: 25883
diff changeset
   358
  # aren't built until after libjava and libjvm are available to link to.
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   359
  demos: $(JAVA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   360
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   361
  # Declare dependency from <module>-java to <module>-gensrc
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   362
  $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   363
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   364
  # Declare dependencies between java modules
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   365
  $(foreach m, $(JAVA_MODULES), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   366
      $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   367
      $(call FindDepsForModule,$m)))))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   368
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   369
  # Declare dependencies between <module>-rmic to <module>-java
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   370
  $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   371
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   372
  # Declare dependencies from <module>-lib to <module>-java
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   373
  # Skip jdk.jdwp.agent as it contains no java code.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   374
  $(foreach m, $(filter-out jdk.jdwp.agent, $(LIB_MODULES)), $(eval $m-libs: $m-java))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   375
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   376
  # Declare dependencies from all other <module>-lib to java.base-lib
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   377
  $(foreach t, $(filter-out java.base-libs, $(LIB_TARGETS)), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   378
      $(eval $t: java.base-libs))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   379
  # Declare the special case dependency for jdk.deploy.osx where libosx 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   380
  # links against libosxapp.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   381
  jdk.deploy.osx-libs: java.desktop-libs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   382
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   383
  # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   384
  # header file used by jdk.jdwp libs.
26115
7a9dc384f3c8 8055188: General cleanup of minor issues from source restructure
erikj
parents: 25883
diff changeset
   385
  jdk.jdwp.agent-libs: jdk.jdi-gensrc
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   386
26672
528d9d6614e5 8047933: Race between jdk/make/scripts/genExceptions.sh and com.sun.tools.javadoc.Main
erikj
parents: 26398
diff changeset
   387
  # The swing beans need to have java base properly generated to avoid errors
528d9d6614e5 8047933: Race between jdk/make/scripts/genExceptions.sh and com.sun.tools.javadoc.Main
erikj
parents: 26398
diff changeset
   388
  # in javadoc.
528d9d6614e5 8047933: Race between jdk/make/scripts/genExceptions.sh and com.sun.tools.javadoc.Main
erikj
parents: 26398
diff changeset
   389
  java.desktop-gensrc: java.base-gensrc
528d9d6614e5 8047933: Race between jdk/make/scripts/genExceptions.sh and com.sun.tools.javadoc.Main
erikj
parents: 26398
diff changeset
   390
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   391
  # Explicitly add dependencies for special targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   392
  java.base-java: unpack-sec
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   393
26132
11df1233e1e8 8055856: checkdeps build target doesn't work for cross-compilation builds
mchung
parents: 26128
diff changeset
   394
  jdk.dev-gendata: java rmic
11df1233e1e8 8055856: checkdeps build target doesn't work for cross-compilation builds
mchung
parents: 26128
diff changeset
   395
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   396
  security-jars: java
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   397
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   398
  nashorn-jar: jdk.scripting.nashorn-java
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   399
26115
7a9dc384f3c8 8055188: General cleanup of minor issues from source restructure
erikj
parents: 25883
diff changeset
   400
  main-jars: java rmic security-jars nashorn-jar policy-jars import-hotspot gendata
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   401
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   402
  # On windows, the jars target needs to wait for jgss libs to be built.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   403
  # Should ideally split out the sec-bin zip file generation to avoid
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   404
  # this dependency.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   405
  ifeq ($(OPENJDK_TARGET_OS), windows)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   406
    main-jars: java.security.jgss-libs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   407
  endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   408
26547
f8b190ea8955 8058367: Add verify-modules target to the default and images target
mchung
parents: 26398
diff changeset
   409
  images: jars demos samples exploded-image verify-modules source-tips
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   410
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   411
  bootcycle-images: images
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   412
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   413
  # Need to depend on jars as otherwise there will a race between all the
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   414
  # invocations of CreateJars.gmk.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   415
  $(PROFILE_JARS_TARGETS): jars profiles-oscheck
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   416
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   417
  $(PROFILE_IMAGES_TARGETS): demos samples exploded-image source-tips
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   418
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   419
  # Declare dependencies from <profile>-images to <profile>-jars
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   420
  $(foreach p, $(ALL_PROFILES), $(eval $p-images: $p-jars))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   421
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   422
  docs-javadoc: $(GENSRC_TARGETS) rmic
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   423
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   424
  docs-jvmtidoc: hotspot
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   425
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   426
  test: exploded-image
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   427
26132
11df1233e1e8 8055856: checkdeps build target doesn't work for cross-compilation builds
mchung
parents: 26128
diff changeset
   428
  verify-modules: exploded-image
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   429
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   430
endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   431
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   432
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   433
# Virtual targets without recipes
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   434
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   435
gensrc: $(GENSRC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   436
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   437
gendata: $(GENDATA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   438
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   439
copy: $(COPY_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   440
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   441
java: $(JAVA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   442
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   443
rmic: $(RMIC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   444
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   445
libs: $(LIB_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   446
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   447
launchers: $(LAUNCHER_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   448
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   449
# Explicitly add dependencies for these special targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   450
java.base: import-hotspot policy-jars
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   451
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   452
# Declare dependencies from <module> to all the individual targets specific
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   453
# to that module <module>-*.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   454
$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   455
$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   456
$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   457
$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   458
$(foreach m, $(LIB_MODULES), $(eval $m: $m-libs))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   459
$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   460
$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   461
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   462
ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   463
    $(GENDATA_MODULES) $(LIB_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   464
26132
11df1233e1e8 8055856: checkdeps build target doesn't work for cross-compilation builds
mchung
parents: 26128
diff changeset
   465
exploded-image: $(ALL_MODULE_TARGETS)
26128
91be51647a45 8056062: Additional minor cleanups from source restructure build changes
erikj
parents: 26116
diff changeset
   466
# The old 'jdk' target most closely matches the new exploded-image. Keep an
91be51647a45 8056062: Additional minor cleanups from source restructure build changes
erikj
parents: 26116
diff changeset
   467
# alias for ease of use.
91be51647a45 8056062: Additional minor cleanups from source restructure build changes
erikj
parents: 26116
diff changeset
   468
jdk: exploded-image
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   469
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   470
jars: main-jars nashorn-jar security-jars policy-jars
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   471
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   472
# Make each profile name a target that depends on it's images target.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   473
$(foreach p, $(ALL_PROFILES), $(eval $(p): $(p)-images $(p)-jars))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   474
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   475
profiles: $(ALL_PROFILES)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   476
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   477
docs: docs-javadoc docs-jvmtidoc
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   478
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   479
ALL_TARGETS += gensrc gendata copy java rmic libs launchers \
26128
91be51647a45 8056062: Additional minor cleanups from source restructure build changes
erikj
parents: 26116
diff changeset
   480
    $(ALL_MODULE_TARGETS) exploded-image jdk jars \
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   481
    $(ALL_PROFILES) profiles docs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   482
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   483
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   484
26547
f8b190ea8955 8058367: Add verify-modules target to the default and images target
mchung
parents: 26398
diff changeset
   485
all: images docs
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   486
default: exploded-image
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   487
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   488
ALL_TARGETS += default all
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   489
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   490
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   491
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   492
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   493
# Clean targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   494
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   495
################################################################################
26398
ca1f84f97e20 8057537: Serialize reconfigure and fix make clean-foo foo
erikj
parents: 26285
diff changeset
   496
# Clean targets are automatically run serially by the Makefile calling this 
ca1f84f97e20 8057537: Serialize reconfigure and fix make clean-foo foo
erikj
parents: 26285
diff changeset
   497
# file.
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   498
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   499
CLEAN_COMPONENTS += langtools corba hotspot jdk nashorn images \
26548
3b002da2aee1 8058118: Generate modules.list during the build
erikj
parents: 26547
diff changeset
   500
    bootcycle-build docs docstemp test make-support
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   501
CLEAN_TARGETS := $(addprefix clean-, $(CLEAN_COMPONENTS))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   502
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   503
# Remove everything, except the output from configure.
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   504
clean: $(CLEAN_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   505
	($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   506
	$(ECHO) Cleaned all build artifacts.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   507
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   508
$(CLEAN_TARGETS):
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   509
	$(call CleanComponent,$(patsubst clean-%, %, $@))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   510
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   511
clean-docs: clean-docstemp
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   512
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   513
# Remove everything, including configure configuration.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   514
# If the output directory was created by configure and now becomes empty, remove it as well.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   515
dist-clean: clean
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   516
	($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   517
	    Makefile compare.sh spec.sh tmp javacservers)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   518
	$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   519
	  if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   520
	    $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   521
	  else \
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   522
	    ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   523
	        && $(RM) -r $(OUTPUT_ROOT)) \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   524
	  fi \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   525
	)
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   526
	$(ECHO) Cleaned everything, you will have to re-run configure.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   527
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   528
ALL_TARGETS += clean dist-clean $(CLEAN_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   529
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   530
################################################################################
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   531
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   532
# Setup a rule for SPEC file that fails if executed. This check makes sure the 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   533
# configuration is up to date after changes to configure. 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   534
ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   535
  $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   536
	@$(ECHO) "ERROR: $(SPEC) is not up to date."
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   537
	@$(ECHO) "Please rerun configure! Easiest way to do this is by running"
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   538
	@$(ECHO) "'make reconfigure'."
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   539
	@$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true"
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   540
	@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   541
endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   542
26398
ca1f84f97e20 8057537: Serialize reconfigure and fix make clean-foo foo
erikj
parents: 26285
diff changeset
   543
# The reconfigure target is automatically run serially from everything else
ca1f84f97e20 8057537: Serialize reconfigure and fix make clean-foo foo
erikj
parents: 26285
diff changeset
   544
# by the Makefile calling this file.
ca1f84f97e20 8057537: Serialize reconfigure and fix make clean-foo foo
erikj
parents: 26285
diff changeset
   545
22716
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   546
reconfigure:
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   547
        ifneq ($(CONFIGURE_COMMAND_LINE), )
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   548
	  @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   549
        else
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   550
	  @$(ECHO) "Re-running configure using default settings"
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   551
        endif
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22716
diff changeset
   552
	@( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   553
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   554
ALL_TARGETS += reconfigure
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   555
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   556
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   557
# Declare *-only targets for each normal target
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   558
$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   559
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   560
ALL_TARGETS += $(addsuffix -only, $(ALL_TARGETS))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   561
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   562
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   563
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   564
.PHONY: $(ALL_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   565
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   566
include $(SRC_ROOT)/make/Jprt.gmk
22031
ae288cbb4c28 8029797: Let jprt run configure when building
erikj
parents: 21759
diff changeset
   567
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   568
FRC: # Force target