make/Main.gmk
author jmasa
Wed, 10 Sep 2014 23:14:13 +0000
changeset 26575 9d01d41f1aa7
parent 25854 98ce0879ab4c
child 25883 1aedb364117b
permissions -rw-r--r--
Merge
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
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    40
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    41
# Load common profile names definitions
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    42
include $(JDK_TOPDIR)/make/ProfileNames.gmk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    43
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    44
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    45
# 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
    46
# generate the -only targets.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    47
ALL_TARGETS :=
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    48
22714
a752920c4317 8034191: Move relevant parts of build system to new closed repo
ihse
parents: 22031
diff changeset
    49
# 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
    50
$(eval $(call IncludeCustomExtension, , Main.gmk))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    51
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    52
# All modules for the current target platform.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    53
# Manually add jdk.hotspot.agent for now.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    54
ALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    55
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
# Recipes for all targets. Only recipes, dependencies are declared later.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    60
#
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
# Interim/build tools targets, compiling tools used during the build
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    65
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    66
interim-langtools:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    67
	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    68
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    69
interim-corba:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    70
	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCorba.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    71
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    72
interim-rmic:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    73
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    74
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    75
build-tools-jdk:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    76
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    77
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    78
ALL_TARGETS += interim-langtools interim-corba build-tools-jdk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    79
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    80
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    81
# Special targets for certain modules
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    82
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    83
import-hotspot:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    84
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    85
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    86
unpack-sec:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    87
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    88
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    89
policy-jars:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    90
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreatePolicyJars.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    91
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    92
ALL_TARGETS += import-hotspot unpack-sec policy-jars
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    93
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    94
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    95
# Gensrc targets, generating source before java compilation can be done
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    96
JDK_GENSRC_MODULES := $(call FindModulesWithMakefileFor, gensrc, Gensrc)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    97
LANGTOOLS_GENSRC_MODULES := jdk.compiler.tools
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    98
CORBA_GENSRC_MODULES := java.corba
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
    99
GENSRC_MODULES := $(JDK_GENSRC_MODULES) $(LANGTOOLS_GENSRC_MODULES) \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   100
    $(CORBA_GENSRC_MODULES)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   101
JDK_GENSRC_TARGETS := $(addsuffix -gensrc, $(JDK_GENSRC_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   102
LANGTOOLS_GENSRC_TARGETS := $(addsuffix -gensrc, $(LANGTOOLS_GENSRC_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   103
CORBA_GENSRC_TARGETS := $(addsuffix -gensrc, $(CORBA_GENSRC_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   104
GENSRC_TARGETS := $(addsuffix -gensrc, $(GENSRC_MODULES))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   105
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   106
jdk.compiler.tools-gensrc:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   107
	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcLangtools.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   108
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   109
java.corba-gensrc:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   110
	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcCorba.gmk)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   111
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   112
# Declare recipes for all jdk <module>-gensrc targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   113
$(foreach m, $(JDK_GENSRC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   114
    $m, gensrc, gensrc, Gensrc)))
15053
64278cb83950 8005549: build-infra: Merge NewMakefile.gmk and common/makefiles/Makefile
erikj
parents: 14466
diff changeset
   115
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   116
ALL_TARGETS += $(GENSRC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   117
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   118
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   119
# Generate data targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   120
GENDATA_MODULES := $(call FindModulesWithMakefileFor, gendata, Gendata)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   121
GENDATA_TARGETS := $(addsuffix -gendata, $(GENDATA_MODULES))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   122
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   123
# Declare recipes for all <module>-gendata targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   124
$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   125
    $m, gendata, gendata, Gendata)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   126
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   127
$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareGendataRecipe,$m)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   128
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   129
ALL_TARGETS += $(GENDATA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   130
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   131
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   132
# Copy files targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   133
COPY_MODULES := $(call FindModulesWithMakefileFor, copy, Copy)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   134
COPY_TARGETS := $(addsuffix -copy, $(COPY_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   135
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   136
# Declare recipes for all <module>-copy targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   137
$(foreach m, $(COPY_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   138
    $m, copy, copy, Copy)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   139
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   140
ALL_TARGETS += $(COPY_TARGETS)
15395
e5d837c6e999 8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents: 15060
diff changeset
   141
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   142
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   143
# Targets for compiling all java modules. Nashorn is treated separately.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   144
JAVA_MODULES := $(call FindJavaModules)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   145
JAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   146
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   147
define DeclareCompileJavaRecipe
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   148
  $1-java:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   149
	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   150
	    $1 JAVA_MODULES=$1)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   151
endef
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   152
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   153
$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   154
    $(eval $(call DeclareCompileJavaRecipe,$m)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   155
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   156
# Build nashorn. Needs to be compiled separately from the rest of the modules
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   157
# due to nasgen.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   158
jdk.scripting.nashorn-java:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   159
	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   160
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   161
ALL_TARGETS += $(JAVA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   162
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   163
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   164
# Targets for running rmic.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   165
RMIC_MODULES := $(call FindModulesWithMakefileFor, rmic, Rmic)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   166
RMIC_TARGETS := $(addsuffix -rmic, $(RMIC_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   167
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   168
# Declare recipes for all <module>-rmic targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   169
$(foreach m, $(RMIC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   170
    $m, rmic, rmic, Rmic)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   171
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   172
ALL_TARGETS += $(RMIC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   173
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   174
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   175
# Targets for compiling native libraries
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   176
ALL_LIB_MODULES := $(call FindModulesWithMakefileFor, lib, Lib)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   177
LIB_MODULES := $(filter $(ALL_MODULES), $(ALL_LIB_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   178
LIB_TARGETS := $(addsuffix -libs, $(LIB_MODULES))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   179
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   180
# Declare recipes for all <module>-libs targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   181
$(foreach m, $(LIB_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   182
    $m, libs, lib, Lib)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   183
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   184
ALL_TARGETS += $(LIB_TARGETS)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   185
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   186
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   187
# Targets for compiling native executables
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   188
ALL_LAUNCHER_MODULES := $(call FindModulesWithMakefileFor, launcher, Launcher)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   189
LAUNCHER_MODULES := $(filter $(ALL_MODULES), $(ALL_LAUNCHER_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   190
LAUNCHER_TARGETS := $(addsuffix -launchers, $(LAUNCHER_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   191
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   192
# Declare recipes for all <module>-launchers targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   193
$(foreach m, $(LAUNCHER_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   194
    $m, launchers, launcher, Launcher)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   195
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   196
ALL_TARGETS += $(LAUNCHER_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   197
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   198
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   199
# Build hotspot target
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   200
14378
0ef5d942b98e 8002028: build-infra: need no-hotspot partial build
tbell
parents: 14111
diff changeset
   201
ifeq ($(BUILD_HOTSPOT),true)
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   202
  hotspot:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   203
	($(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
   204
endif
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   205
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   206
ALL_TARGETS += hotspot
15903
bc0e6cd9d760 8008914: Add nashorn to the tl build
jjg
parents: 15587
diff changeset
   207
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   208
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   209
# Build demos and samples targets
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   210
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   211
demos:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   212
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   213
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   214
samples:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   215
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   216
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   217
ALL_TARGETS += demos samples
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   218
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   219
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   220
# Image targets
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   221
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   222
# 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
   223
# used to track the exact sources used to build that image.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   224
source-tips: $(OUTPUT_ROOT)/source_tips
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   225
$(OUTPUT_ROOT)/source_tips: FRC
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   226
	@$(MKDIR) -p $(@D)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   227
	@$(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
   228
	@$(call GetSourceTips)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   229
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   230
security-jars:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   231
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateSecurityJars.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   232
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   233
nashorn-jar:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   234
	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk all)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   235
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   236
# Creates the jar files (rt.jar resources.jar etc)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   237
main-jars:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   238
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJars.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   239
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   240
# Creates the images (j2sdk-image j2re-image etc)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   241
images:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   242
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   243
        ifeq ($(OPENJDK_TARGET_OS), macosx)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   244
	  +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   245
        endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   246
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   247
# Create Compact Profile jars
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   248
PROFILE_JARS_TARGETS := $(addsuffix -jars, $(ALL_PROFILES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   249
$(PROFILE_JARS_TARGETS):
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   250
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-jars=%) -f CreateJars.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   251
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   252
# Create Compact Profile images
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   253
PROFILE_IMAGES_TARGETS := $(addsuffix -images, $(ALL_PROFILES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   254
$(PROFILE_IMAGES_TARGETS):
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   255
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-images=%) \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   256
	    JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/j2re-$(word $(call profile_number,$(@:%-images=%)),$(PROFILE_NAMES))-image \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   257
	    -f Images.gmk profile-image)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   258
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   259
profiles-oscheck:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   260
        ifneq ($(OPENJDK_TARGET_OS), linux)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   261
	  @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
   262
        endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   263
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   264
bootcycle-images:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   265
	@$(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
   266
	+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk images
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   267
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   268
ALL_TARGETS += source-tips security-jars nashorn-jar main-jars images \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   269
    $(PROFILE_JARS_TARGETS) $(PROFILE_IMAGES_TARGETS) profiles-oscheck \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   270
    bootcycle-images
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   271
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   272
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   273
# Docs targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   274
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   275
docs-javadoc:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   276
	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   277
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   278
docs-jvmtidoc:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   279
	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   280
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   281
ALL_TARGETS += docs-javadoc docs-jvmtidoc
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   282
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   283
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   284
# Test target
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   285
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   286
test:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   287
	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   288
	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_OUTPUT_DIR) \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   289
	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   290
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   291
test-make:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   292
	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   293
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   294
ALL_TARGETS += test test-make
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   295
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   296
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   297
# Verification targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   298
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   299
# generate modules.xml in the exploded image
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   300
modules-xml:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   301
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk gen-modules-xml)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   302
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   303
verify-modules:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   304
	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk checkdeps)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   305
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   306
ALL_TARGETS += modules-xml verify-modules
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   307
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   308
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   309
# Install targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   310
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   311
install:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   312
	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   313
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   314
ALL_TARGETS += install
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
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   318
# Dependency declarations between targets. 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   319
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   320
# These are declared in two groups. First all dependencies between targets that 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   321
# have recipes above as these dependencies may be disabled. Then the aggregator
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   322
# targets that do not have recipes of their own, which will never have their
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   323
# dependencies disabled.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   324
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   325
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   326
# Targets with recipes above
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   327
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   328
# If running an *-only target, parallel execution and dependencies between 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   329
# recipe targets are disabled. This makes it possible to run a select set of 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   330
# recipe targets in order. It's the responsibility of the user to make sure
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   331
# all prerequisites are fulfilled. 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   332
ifneq ($(findstring -only, $(MAKECMDGOALS)), )
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   333
  .NOTPARALLEL:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   334
else
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   335
  interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   336
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   337
  build-tools-jdk: interim-langtools
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   338
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   339
  $(CORBA_GENSRC_TARGETS): interim-langtools
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   340
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   341
  $(JDK_GENSRC_TARGETS): interim-langtools build-tools-jdk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   342
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   343
  interim-corba: $(CORBA_GENSRC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   344
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   345
  $(GENDATA_TARGETS): interim-langtools build-tools-jdk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   346
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   347
  interim-rmic: interim-langtools
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   348
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   349
  $(RMIC_TARGETS): interim-langtools interim-corba interim-rmic
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   350
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   351
  import-hotspot: hotspot
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   352
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   353
  $(LIB_TARGETS): import-hotspot
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   354
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   355
  $(LAUNCHER_TARGETS): java.base-libs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   356
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   357
  demos: $(JAVA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   358
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   359
  # Declare dependency from <module>-java to <module>-gensrc
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   360
  $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   361
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   362
  # Declare dependencies between java modules
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   363
  $(foreach m, $(JAVA_MODULES), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   364
      $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   365
      $(call FindDepsForModule,$m)))))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   366
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   367
  # Declare dependencies between <module>-rmic to <module>-java
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   368
  $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   369
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   370
  # Declare dependencies from <module>-lib to <module>-java
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   371
  # Skip jdk.jdwp.agent as it contains no java code.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   372
  $(foreach m, $(filter-out jdk.jdwp.agent, $(LIB_MODULES)), $(eval $m-libs: $m-java))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   373
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   374
  # Declare dependencies from all other <module>-lib to java.base-lib
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   375
  $(foreach t, $(filter-out java.base-libs, $(LIB_TARGETS)), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   376
      $(eval $t: java.base-libs))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   377
  # Declare the special case dependency for jdk.deploy.osx where libosx 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   378
  # links against libosxapp.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   379
  jdk.deploy.osx-libs: java.desktop-libs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   380
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   381
  # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   382
  # header file used by jdk.jdwp libs.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   383
  jdk.jdwp-libs: jdk.jdi-gensrc
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   384
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   385
  # Explicitly add dependencies for special targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   386
  java.base-java: unpack-sec
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   387
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   388
  security-jars: java
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   389
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   390
  nashorn-jar: jdk.scripting.nashorn-java
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   391
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   392
  main-jars: java rmic security-jars nashorn-jar policy-jars import-hotspot
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   393
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   394
  # On windows, the jars target needs to wait for jgss libs to be built.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   395
  # Should ideally split out the sec-bin zip file generation to avoid
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   396
  # this dependency.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   397
  ifeq ($(OPENJDK_TARGET_OS), windows)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   398
    main-jars: java.security.jgss-libs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   399
  endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   400
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   401
  images: jars demos samples exploded-image source-tips
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   402
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   403
  bootcycle-images: images
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   404
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   405
  # Need to depend on jars as otherwise there will a race between all the
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   406
  # invocations of CreateJars.gmk.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   407
  $(PROFILE_JARS_TARGETS): jars profiles-oscheck
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   408
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   409
  $(PROFILE_IMAGES_TARGETS): demos samples exploded-image source-tips
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   410
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   411
  # Declare dependencies from <profile>-images to <profile>-jars
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   412
  $(foreach p, $(ALL_PROFILES), $(eval $p-images: $p-jars))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   413
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   414
  docs-javadoc: $(GENSRC_TARGETS) rmic
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   415
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   416
  docs-jvmtidoc: hotspot
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   417
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   418
  test: exploded-image
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   419
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   420
  modules-xml: build-tools-jdk java
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   421
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   422
  verify-modules: exploded-image modules-xml
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   423
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   424
endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   425
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   426
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   427
# Virtual targets without recipes
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   428
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   429
gensrc: $(GENSRC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   430
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   431
gendata: $(GENDATA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   432
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   433
copy: $(COPY_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   434
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   435
java: $(JAVA_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   436
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   437
rmic: $(RMIC_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   438
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   439
libs: $(LIB_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   440
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   441
launchers: $(LAUNCHER_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   442
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   443
# Explicitly add dependencies for these special targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   444
java.base: import-hotspot policy-jars
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   445
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   446
# Declare dependencies from <module> to all the individual targets specific
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   447
# to that module <module>-*.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   448
$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   449
$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   450
$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   451
$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   452
$(foreach m, $(LIB_MODULES), $(eval $m: $m-libs))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   453
$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   454
$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   455
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   456
ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   457
    $(GENDATA_MODULES) $(LIB_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   458
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   459
exploded-image: $(ALL_MODULE_TARGETS) modules-xml
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   460
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   461
jars: main-jars nashorn-jar security-jars policy-jars
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   462
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   463
# Make each profile name a target that depends on it's images target.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   464
$(foreach p, $(ALL_PROFILES), $(eval $(p): $(p)-images $(p)-jars))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   465
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   466
profiles: $(ALL_PROFILES)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   467
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   468
docs: docs-javadoc docs-jvmtidoc
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   469
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   470
ALL_TARGETS += gensrc gendata copy java rmic libs launchers \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   471
    $(ALL_MODULE_TARGETS) exploded-image jars \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   472
    $(ALL_PROFILES) profiles docs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   473
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   474
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   475
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   476
all: images docs verify-modules
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   477
default: exploded-image
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   478
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   479
ALL_TARGETS += default all
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   480
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   481
################################################################################
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
# Clean targets
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   485
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   486
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   487
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   488
# If running a clean target, disable parallel execution
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   489
ifneq ($(findstring clean, $(MAKECMDGOALS)), )
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   490
  .NOTPARALLEL:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   491
endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   492
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   493
CLEAN_COMPONENTS += langtools corba hotspot jdk nashorn images \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   494
    bootcycle-build docs docstemp test
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   495
CLEAN_TARGETS := $(addprefix clean-, $(CLEAN_COMPONENTS))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   496
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   497
# Remove everything, except the output from configure.
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   498
clean: $(CLEAN_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   499
	($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   500
	$(ECHO) Cleaned all build artifacts.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   501
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   502
$(CLEAN_TARGETS):
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   503
	$(call CleanComponent,$(patsubst clean-%, %, $@))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   504
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   505
clean-docs: clean-docstemp
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   506
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   507
# Remove everything, including configure configuration.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   508
# 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
   509
dist-clean: clean
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   510
	($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   511
	    Makefile compare.sh spec.sh tmp javacservers)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   512
	$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   513
	  if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   514
	    $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   515
	  else \
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   516
	    ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   517
	        && $(RM) -r $(OUTPUT_ROOT)) \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   518
	  fi \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20047
diff changeset
   519
	)
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   520
	$(ECHO) Cleaned everything, you will have to re-run configure.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   521
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   522
ALL_TARGETS += clean dist-clean $(CLEAN_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   523
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   524
################################################################################
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   525
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   526
# 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
   527
# configuration is up to date after changes to configure. 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   528
ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   529
  $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   530
	@$(ECHO) "ERROR: $(SPEC) is not up to date."
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   531
	@$(ECHO) "Please rerun configure! Easiest way to do this is by running"
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   532
	@$(ECHO) "'make reconfigure'."
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   533
	@$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true"
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   534
	@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   535
endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   536
22716
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   537
reconfigure:
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   538
        ifneq ($(CONFIGURE_COMMAND_LINE), )
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   539
	  @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   540
        else
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   541
	  @$(ECHO) "Re-running configure using default settings"
cf32fe2eb254 8034199: Add 'reconfigure' target for re-creating a configuration
ihse
parents: 22714
diff changeset
   542
        endif
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22716
diff changeset
   543
	@( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   544
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   545
ALL_TARGETS += reconfigure
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   546
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   547
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   548
# Declare *-only targets for each normal target
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   549
$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   550
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   551
ALL_TARGETS += $(addsuffix -only, $(ALL_TARGETS))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   552
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   553
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   554
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   555
.PHONY: $(ALL_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   556
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22721
diff changeset
   557
include $(SRC_ROOT)/make/Jprt.gmk
22031
ae288cbb4c28 8029797: Let jprt run configure when building
erikj
parents: 21759
diff changeset
   558
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   559
FRC: # Force target