author | sla |
Thu, 28 Jun 2012 11:37:28 +0200 | |
changeset 13200 | 7b506e7b406e |
parent 12801 | 948f8ad66ee7 |
child 13132 | bd88bb8dd3af |
permissions | -rw-r--r-- |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
2 |
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
4 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
10 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
15 |
# accompanied this code). |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
16 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
20 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
23 |
# questions. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
24 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
25 |
|
12801 | 26 |
# This must be the first rule |
27 |
default: all |
|
28 |
||
29 |
# Find out which variables were passed explicitely on the make command line. These |
|
30 |
# will be passed on to sub-makes, overriding spec.gmk settings. |
|
31 |
MAKE_ARGS=$(foreach var,$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))),$(var)=$($(var))) |
|
32 |
||
33 |
define fatal-error |
|
34 |
# If the user specificed a "global" target (e.g. 'help'), do not exit but continue running |
|
35 |
$$(if $$(findstring help,$$(MAKECMDGOALS)),,$$(error Cannot continue)) |
|
36 |
endef |
|
37 |
||
38 |
ifeq ($(origin VERBOSE),undefined) |
|
39 |
# Setup logging according to LOG (but only if VERBOSE is not given) |
|
40 |
ifeq ($(LOG),) |
|
41 |
# Set LOG to "warn" as default if not set (and no VERBOSE given) |
|
42 |
LOG=warn |
|
43 |
endif |
|
44 |
ifeq ($(LOG),warn) |
|
45 |
VERBOSE=-s |
|
46 |
else ifeq ($(LOG),info) |
|
47 |
VERBOSE= |
|
48 |
else ifeq ($(LOG),debug) |
|
49 |
VERBOSE= |
|
50 |
else ifeq ($(LOG),trace) |
|
51 |
VERBOSE=-d -p |
|
52 |
else |
|
53 |
$(info Error: LOG must be one of: warn, info, debug or trace.) |
|
54 |
$(eval $(call fatal-error)) |
|
55 |
endif |
|
56 |
else |
|
57 |
ifneq ($(LOG),) |
|
58 |
# We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves, |
|
59 |
# but complain if this is the top-level make call. |
|
60 |
ifeq ($(MAKELEVEL),0) |
|
61 |
$(info Cannot use LOG=$(LOG) and VERBOSE=$(VERBOSE) at the same time. Choose one.) |
|
62 |
$(eval $(call fatal-error)) |
|
63 |
endif |
|
64 |
endif |
|
65 |
endif |
|
66 |
||
67 |
# TODO: Fix duplication in MakeBase.gmk |
|
68 |
define SetupLogging |
|
69 |
ifneq ($(findstring $(LOG),debug trace),) |
|
70 |
# Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make |
|
71 |
OLD_SHELL:=$$(SHELL) |
|
72 |
SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x |
|
73 |
endif |
|
74 |
endef |
|
75 |
||
76 |
$(eval $(call SetupLogging)) |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
77 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
78 |
# Find all environment or command line variables that begin with ALT. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
79 |
list_alt_overrides_with_origins = $(filter ALT_%=environment ALT_%=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var))))) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
80 |
list_alt_overrides=$(subst =command,,$(subst =environment,,$(list_alt_overrides_with_origins))) |
12801 | 81 |
|
82 |
ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) |
|
83 |
makefile_path=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) |
|
84 |
else |
|
85 |
makefile_path=$(lastword $(MAKEFILE_LIST)) |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
86 |
endif |
12801 | 87 |
root_dir=$(patsubst %/common/makefiles/Makefile,%,$(makefile_path)) |
88 |
output_dir=$(root_dir)/build |
|
89 |
||
90 |
ifneq ($(origin SPEC),undefined) |
|
91 |
# We have been given a SPEC, check that it works out properly |
|
92 |
ifeq ($(wildcard $(SPEC)),) |
|
93 |
$(info Cannot locate spec.gmk, given by SPEC=$(SPEC)) |
|
94 |
$(eval $(call fatal-error)) |
|
95 |
endif |
|
96 |
ifneq ($(origin CONF),undefined) |
|
97 |
# We also have a CONF argument. This is OK only if this is a repeated call by ourselves, |
|
98 |
# but complain if this is the top-level make call. |
|
99 |
ifeq ($(MAKELEVEL),0) |
|
100 |
$(info Cannot use CONF=$(CONF) and SPEC=$(SPEC) at the same time. Choose one.) |
|
101 |
$(eval $(call fatal-error)) |
|
102 |
endif |
|
103 |
endif |
|
104 |
# ... OK, we're satisfied, we'll use this SPEC later on |
|
105 |
else |
|
106 |
# Find all spec.gmk files in the build output directory |
|
107 |
all_spec_files=$(wildcard $(output_dir)/*/spec.gmk) |
|
108 |
ifeq ($(all_spec_files),) |
|
109 |
$(info No configurations found for $(root_dir)! Please run configure to create a configuration.) |
|
110 |
$(eval $(call fatal-error)) |
|
111 |
endif |
|
112 |
# Extract the configuration names from the path |
|
113 |
all_confs=$(patsubst %/spec.gmk,%,$(patsubst $(output_dir)/%,%,$(all_spec_files))) |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
114 |
|
12801 | 115 |
ifneq ($(origin CONF),undefined) |
116 |
# User have given a CONF= argument. |
|
117 |
ifeq ($(CONF),) |
|
118 |
# If given CONF=, match all configurations |
|
119 |
matching_confs=$(strip $(all_confs)) |
|
120 |
else |
|
121 |
# Otherwise select those that contain the given CONF string |
|
122 |
matching_confs=$(strip $(foreach var,$(all_confs),$(if $(findstring $(CONF),$(var)),$(var)))) |
|
123 |
endif |
|
124 |
ifeq ($(matching_confs),) |
|
125 |
$(info No configurations found matching CONF=$(CONF)) |
|
126 |
$(info Available configurations:) |
|
127 |
$(foreach var,$(all_confs),$(info * $(var))) |
|
128 |
$(eval $(call fatal-error)) |
|
129 |
else |
|
130 |
ifeq ($(words $(matching_confs)),1) |
|
131 |
$(info Building '$(matching_confs)' (matching CONF=$(CONF))) |
|
132 |
else |
|
133 |
$(info Building the following configurations (matching CONF=$(CONF)):) |
|
134 |
$(foreach var,$(matching_confs),$(info * $(var))) |
|
135 |
endif |
|
136 |
endif |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
137 |
|
12801 | 138 |
# Create a SPEC definition. This will contain the path to one or more spec.gmk files. |
139 |
SPEC=$(addsuffix /spec.gmk,$(addprefix $(output_dir)/,$(matching_confs))) |
|
140 |
else |
|
141 |
# No CONF or SPEC given, check the available configurations |
|
142 |
ifneq ($(words $(all_spec_files)),1) |
|
143 |
$(info No CONF or SPEC given, but more than one spec.gmk found in $(output_dir).) |
|
144 |
$(info Available configurations:) |
|
145 |
$(foreach var,$(all_confs),$(info * $(var))) |
|
146 |
$(info Please retry building with CONF=<config> or SPEC=<specfile>) |
|
147 |
$(eval $(call fatal-error)) |
|
148 |
endif |
|
149 |
||
150 |
# We found exactly one configuration, use it |
|
151 |
SPEC=$(strip $(all_spec_files)) |
|
152 |
endif |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
153 |
endif |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
154 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
155 |
ifneq ($(words $(SPEC)),1) |
12801 | 156 |
# We have multiple configurations to build, call make repeatedly |
157 |
all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean: |
|
158 |
@$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@ $(MAKE_ARGS)) &&) true |
|
159 |
||
160 |
.PHONY: all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean |
|
161 |
||
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
162 |
else |
12801 | 163 |
# This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file. |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
164 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
165 |
# Now load the spec |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
166 |
-include $(SPEC) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
167 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
168 |
# Load the vital tools for all the makefiles. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
169 |
-include $(SRC_ROOT)/common/makefiles/MakeBase.gmk |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
170 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
171 |
# Remove any build.log from a previous run |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
172 |
ifneq (,$(BUILD_LOG)) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
173 |
$(shell $(RM) $(BUILD_LOG)) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
174 |
endif |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
175 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
176 |
# Remove any javac server logs and port files. This |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
177 |
# prevents a new make run to reuse the previous servers. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
178 |
ifneq (,$(JAVAC_SERVERS)) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
179 |
$(shell mkdir -p $(JAVAC_SERVERS) && rm -rf $(JAVAC_SERVERS)/*) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
180 |
endif |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
181 |
# Reset the build timers. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
182 |
$(eval $(call ResetTimers)) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
183 |
# Clean out any notifications from the previous build. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
184 |
$(shell find $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE)) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
185 |
|
12801 | 186 |
# If make was called explicitely with -j, don't add a -j ourself to sub-makes, since |
187 |
# this will be inherited automatically by make. Otherwise use our default for sub-makes. |
|
188 |
# The -j in MAKEFLAGS is only visible when executing a recipe, hence this macro. |
|
189 |
define GetMakeJobFlag |
|
190 |
$(if $(findstring -j,$(MAKEFLAGS)),,-j$(NUM_CORES)) |
|
191 |
endef |
|
192 |
||
193 |
define CheckEnvironment |
|
194 |
$(if $(list_alt_overrides), |
|
195 |
@$(PRINTF) "\nWARNING: You have the following ALT_ variables set:\n" |
|
196 |
@$(PRINTF) "$(foreach var,$(list_alt_overrides),$(var)=$$$(var))\n" |
|
197 |
@$(PRINTF) "ALT_ variables are deprecated and will be ignored. Please clean your environment.\n" |
|
198 |
) |
|
199 |
endef |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
200 |
|
12801 | 201 |
define PrintStartMessage |
202 |
$(if $(VERBOSE),,@$(ECHO) Running make as $(MAKE) $(MFLAGS) $(MAKE_ARGS)) |
|
203 |
$(call CheckEnvironment) |
|
204 |
@$(ECHO) "Building OpenJDK for target $(if $(MAKECMDGOALS),'$(MAKECMDGOALS)','all') in configuration '$(CONF_NAME)'" |
|
205 |
endef |
|
206 |
||
207 |
define PrintEndMessage |
|
208 |
@$(ECHO) "Finished building OpenJDK for target '$@'" |
|
209 |
$(call CheckEnvironment) |
|
210 |
endef |
|
211 |
||
212 |
all: jdk |
|
213 |
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port) |
|
214 |
@$(call AtRootMakeEnd) |
|
215 |
||
216 |
langtools: start-make |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
217 |
@$(call MakeStart,langtools,all) |
12801 | 218 |
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(LANGTOOLS_MAKE_ARGS) $(MAKE_ARGS)) |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
219 |
@$(call MakeFinish,langtools,all) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
220 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
221 |
corba: langtools |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
222 |
@$(call MakeStart,corba,all) |
12801 | 223 |
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS)) |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
224 |
@$(call MakeFinish,corba,all) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
225 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
226 |
jaxp: langtools |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
227 |
@$(call MakeStart,jaxp,all) |
12801 | 228 |
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS)) |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
229 |
@$(call MakeFinish,jaxp,all) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
230 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
231 |
jaxws: langtools jaxp |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
232 |
@$(call MakeStart,jaxws,all) |
12801 | 233 |
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS)) |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
234 |
@$(call MakeFinish,jaxws,all) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
235 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
236 |
hotspot: langtools |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
237 |
@$(call MakeStart,hotspot,all) |
12801 | 238 |
@($(CD) $(HOTSPOT_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS) $(MAKE_ARGS)) |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
239 |
@$(call MakeFinish,hotspot,all) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
240 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
241 |
jdk: langtools corba jaxp jaxws hotspot |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
242 |
@$(call MakeStart,jdk,all) |
12801 | 243 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS)) |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
244 |
@$(call MakeFinish,jdk,all) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
245 |
|
12801 | 246 |
images install packages: source-tips start-make jdk langtools corba jaxp jaxws hotspot |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
247 |
@$(call MakeStart,jdk-images,$@) |
12801 | 248 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@) |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
249 |
@$(call MakeFinish,jdk-images,$@) |
12801 | 250 |
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port) |
251 |
@$(call AtRootMakeEnd) |
|
252 |
||
253 |
old-images: source-tips start-make jdk langtools corba jaxp jaxws hotspot |
|
254 |
@$(call MakeStart,jdk-old-images,$@) |
|
255 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@) |
|
256 |
@$(call MakeFinish,old-jdk-images,$@) |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
257 |
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port) |
12801 | 258 |
@$(call AtRootMakeEnd) |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
259 |
|
12801 | 260 |
start-make: |
261 |
@$(call AtRootMakeStart) |
|
262 |
||
263 |
.PHONY: jdk hotspot jaxws jaxp corba langtools install images packages start-make |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
264 |
|
12801 | 265 |
test: start-make |
266 |
@$(call MakeStart,test,$(if $(TEST),$(TEST),all)) |
|
267 |
@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) MAKEFLAGS= -j1 PRODUCT_HOME=$(OUTPUT_ROOT)/jdk JPRT_JAVA_HOME=$(OUTPUT_ROOT)/jdk ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true |
|
268 |
@$(call MakeFinish,test,$(if $(TEST),$(TEST),all)) |
|
269 |
@$(call AtRootMakeEnd) |
|
270 |
.PHONY: test |
|
271 |
||
272 |
||
273 |
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be |
|
274 |
# used to track the exact sources used to build that image. |
|
275 |
source-tips: $(OUTPUT_ROOT)/source_tips |
|
276 |
$(OUTPUT_ROOT)/source_tips: FRC |
|
277 |
@$(MKDIR) -p $(@D) |
|
278 |
@$(RM) $@ |
|
279 |
@$(call GetSourceTips) |
|
280 |
||
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
281 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
282 |
# Remove everything, except the output from configure. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
283 |
clean: |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
284 |
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | grep -v "localdevenv.*" | grep -v uncygdrive.exe`) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
285 |
@$(ECHO) Cleaned everything except the build configuration. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
286 |
.PHONY: clean |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
287 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
288 |
# Remove everything, you have to rerun configure. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
289 |
dist-clean: |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
290 |
@$(RM) -r $(OUTPUT_ROOT) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
291 |
@$(ECHO) Cleaned everything, you will have to re-run configure. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
292 |
.PHONY: dist-clean |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
293 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
294 |
clean-jdk: |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
295 |
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | \ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
296 |
grep -v langtools | grep -v corba | grep -v jaxp | grep -v jaxws | grep -v hotspot`) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
297 |
@$(ECHO) "Cleaned jdk build artifacts (but not langtools,corba,jaxp,jaxws,hotspot nor the build configuration)" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
298 |
.PHONY: clean |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
299 |
|
12801 | 300 |
endif |
301 |
||
302 |
# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration. |
|
303 |
# If you addd more global targets, please update the fatal-error macro. |
|
304 |
||
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
305 |
help: |
12801 | 306 |
$(info ) |
307 |
$(info OpenJDK Makefile help) |
|
308 |
$(info =====================) |
|
309 |
$(info ) |
|
310 |
$(info Common make targets) |
|
311 |
$(info . make [all] # Compile all code but do not create images) |
|
312 |
$(info . make images # Create complete j2sdk and j2re images) |
|
313 |
$(info . make install # Install the generated images locally) |
|
314 |
$(info . make clean # Remove all files generated by make, but not those generated by configure) |
|
315 |
$(info . make dist-clean # Remove all files generated by both make and configure) |
|
316 |
$(info . make help # Give some help on using make) |
|
317 |
$(info . make test # Run tests, default is all tests (see TEST below)) |
|
318 |
$(info ) |
|
319 |
$(info Useful make variables) |
|
320 |
$(info . make CONF= # Build all configurations (note, assignment is empty)) |
|
321 |
$(info . make CONF=<substring> # Build the configuration(s) with a name matching the given substring) |
|
322 |
$(info ) |
|
323 |
$(info . make LOG=<loglevel> # Change loglevel from warn (default) to the given loglevel) |
|
324 |
$(info . # Available loglevels are: warn, info, debug and trace) |
|
325 |
$(info . # To see executed command lines, use LOG=info) |
|
326 |
$(info ) |
|
327 |
$(info . make test TEST=<test> # Only run the given test or tests, e.g.) |
|
328 |
$(info . # make test TEST="jdk_lang jdk_net") |
|
329 |
$(info ) |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
330 |
.PHONY: help |
12801 | 331 |
FRC: # Force target |