author | stefank |
Mon, 11 Mar 2013 08:49:53 +0100 | |
changeset 15951 | fde41b75883f |
parent 15790 | 3a8903868eb2 |
child 15911 | f4b36c906846 |
permissions | -rw-r--r-- |
14111 | 1 |
# |
2 |
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file. |
|
27 |
||
28 |
# Now load the spec |
|
29 |
include $(SPEC) |
|
30 |
||
31 |
# Load the vital tools for all the makefiles. |
|
32 |
include $(SRC_ROOT)/common/makefiles/MakeBase.gmk |
|
33 |
||
34 |
# Include the corresponding custom file, if present. |
|
35 |
-include $(CUSTOM_MAKE_DIR)/Main.gmk |
|
36 |
||
37 |
### Clean up from previous run |
|
38 |
||
39 |
# Remove any build.log from a previous run, if they exist |
|
40 |
ifneq (,$(BUILD_LOG)) |
|
41 |
ifneq (,$(BUILD_LOG_PREVIOUS)) |
|
42 |
# Rotate old log |
|
43 |
$(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null) |
|
44 |
$(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null) |
|
45 |
else |
|
46 |
$(shell $(RM) $(BUILD_LOG) 2> /dev/null) |
|
47 |
endif |
|
48 |
$(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null) |
|
49 |
endif |
|
50 |
# Remove any javac server logs and port files. This |
|
51 |
# prevents a new make run to reuse the previous servers. |
|
52 |
ifneq (,$(SJAVAC_SERVER_DIR)) |
|
53 |
$(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*) |
|
54 |
endif |
|
55 |
||
56 |
# Reset the build timers. |
|
57 |
$(eval $(call ResetAllTimers)) |
|
58 |
||
59 |
# Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line, |
|
60 |
# hence this workaround. |
|
61 |
MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS) |
|
62 |
||
63 |
### Main targets |
|
64 |
||
15053
64278cb83950
8005549: build-infra: Merge NewMakefile.gmk and common/makefiles/Makefile
erikj
parents:
14466
diff
changeset
|
65 |
default: jdk |
64278cb83950
8005549: build-infra: Merge NewMakefile.gmk and common/makefiles/Makefile
erikj
parents:
14466
diff
changeset
|
66 |
@$(call CheckIfMakeAtEnd) |
64278cb83950
8005549: build-infra: Merge NewMakefile.gmk and common/makefiles/Makefile
erikj
parents:
14466
diff
changeset
|
67 |
|
64278cb83950
8005549: build-infra: Merge NewMakefile.gmk and common/makefiles/Makefile
erikj
parents:
14466
diff
changeset
|
68 |
all: images docs |
64278cb83950
8005549: build-infra: Merge NewMakefile.gmk and common/makefiles/Makefile
erikj
parents:
14466
diff
changeset
|
69 |
@$(call CheckIfMakeAtEnd) |
14111 | 70 |
|
15060
b735cc083a72
8005692: build-infra: Target "all" should do the right thing
erikj
parents:
15057
diff
changeset
|
71 |
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64) |
b735cc083a72
8005692: build-infra: Target "all" should do the right thing
erikj
parents:
15057
diff
changeset
|
72 |
all: overlay-images |
b735cc083a72
8005692: build-infra: Target "all" should do the right thing
erikj
parents:
15057
diff
changeset
|
73 |
endif |
b735cc083a72
8005692: build-infra: Target "all" should do the right thing
erikj
parents:
15057
diff
changeset
|
74 |
|
15395
e5d837c6e999
8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents:
15060
diff
changeset
|
75 |
# Setup a rule for SPEC file that fails if executed. This check makes sure the configuration |
e5d837c6e999
8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents:
15060
diff
changeset
|
76 |
# is up to date after changes to configure |
e5d837c6e999
8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents:
15060
diff
changeset
|
77 |
$(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*) |
e5d837c6e999
8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents:
15060
diff
changeset
|
78 |
@$(ECHO) ERROR: $(SPEC) is not up to date |
e5d837c6e999
8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents:
15060
diff
changeset
|
79 |
@$(ECHO) Please rerun configure! |
e5d837c6e999
8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents:
15060
diff
changeset
|
80 |
@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi |
e5d837c6e999
8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents:
15060
diff
changeset
|
81 |
|
e5d837c6e999
8007093: build-infra: Make should fail if spec is older than configure files
erikj
parents:
15060
diff
changeset
|
82 |
start-make: $(SPEC) |
14111 | 83 |
@$(call AtMakeStart) |
84 |
||
85 |
langtools: langtools-only |
|
86 |
langtools-only: start-make |
|
87 |
@$(call TargetEnter) |
|
88 |
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildLangtools.gmk) |
|
89 |
@$(call TargetExit) |
|
90 |
||
91 |
corba: langtools corba-only |
|
92 |
corba-only: start-make |
|
93 |
@$(call TargetEnter) |
|
94 |
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildCorba.gmk) |
|
95 |
@$(call TargetExit) |
|
96 |
||
97 |
jaxp: langtools jaxp-only |
|
98 |
jaxp-only: start-make |
|
99 |
@$(call TargetEnter) |
|
100 |
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxp.gmk) |
|
101 |
@$(call TargetExit) |
|
102 |
||
103 |
jaxws: langtools jaxp jaxws-only |
|
104 |
jaxws-only: start-make |
|
105 |
@$(call TargetEnter) |
|
106 |
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxws.gmk) |
|
107 |
@$(call TargetExit) |
|
108 |
||
14378
0ef5d942b98e
8002028: build-infra: need no-hotspot partial build
tbell
parents:
14111
diff
changeset
|
109 |
ifeq ($(BUILD_HOTSPOT),true) |
14111 | 110 |
hotspot: hotspot-only |
111 |
hotspot-only: start-make |
|
112 |
@$(call TargetEnter) |
|
113 |
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk) |
|
114 |
@$(call TargetExit) |
|
14378
0ef5d942b98e
8002028: build-infra: need no-hotspot partial build
tbell
parents:
14111
diff
changeset
|
115 |
endif |
14111 | 116 |
|
117 |
jdk: langtools hotspot corba jaxp jaxws jdk-only |
|
118 |
jdk-only: start-make |
|
119 |
@$(call TargetEnter) |
|
120 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET)) |
|
121 |
@$(call TargetExit) |
|
122 |
||
123 |
demos: jdk demos-only |
|
124 |
demos-only: start-make |
|
125 |
@$(call TargetEnter) |
|
126 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk demos) |
|
127 |
@$(call TargetExit) |
|
128 |
||
15584 | 129 |
# Note: This double-colon rule is intentional, to support |
130 |
# custom make file integration. |
|
131 |
images:: source-tips demos images-only |
|
14111 | 132 |
images-only: start-make |
133 |
@$(call TargetEnter) |
|
134 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images) |
|
135 |
@$(call TargetExit) |
|
136 |
||
137 |
overlay-images: source-tips demos overlay-images-only |
|
138 |
overlay-images-only: start-make |
|
139 |
@$(call TargetEnter) |
|
140 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images) |
|
141 |
@$(call TargetExit) |
|
142 |
||
15584 | 143 |
profiles: profiles-oscheck source-tips jdk hotspot profiles-only |
144 |
profiles-only: start-make |
|
145 |
@$(call TargetEnter) |
|
146 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk profiles) |
|
147 |
@$(call TargetExit) |
|
148 |
||
149 |
profiles-oscheck: |
|
150 |
ifneq ($(OPENJDK_TARGET_OS), linux) |
|
151 |
@echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1 |
|
152 |
endif |
|
153 |
||
14111 | 154 |
install: images install-only |
155 |
install-only: start-make |
|
156 |
@$(call TargetEnter) |
|
157 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk install) |
|
158 |
@$(call TargetExit) |
|
159 |
||
160 |
docs: jdk docs-only |
|
161 |
docs-only: start-make |
|
162 |
@$(call TargetEnter) |
|
163 |
@($(CD) $(SRC_ROOT)/common/makefiles/javadoc && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs) |
|
164 |
@$(call TargetExit) |
|
165 |
||
15057
6cdc13b4157e
8005355: build-infra: Java security signing (need a top-level make target).
erikj
parents:
15053
diff
changeset
|
166 |
sign-jars: jdk sign-jars-only |
6cdc13b4157e
8005355: build-infra: Java security signing (need a top-level make target).
erikj
parents:
15053
diff
changeset
|
167 |
sign-jars-only: start-make |
6cdc13b4157e
8005355: build-infra: Java security signing (need a top-level make target).
erikj
parents:
15053
diff
changeset
|
168 |
@$(call TargetEnter) |
6cdc13b4157e
8005355: build-infra: Java security signing (need a top-level make target).
erikj
parents:
15053
diff
changeset
|
169 |
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk sign-jars) |
6cdc13b4157e
8005355: build-infra: Java security signing (need a top-level make target).
erikj
parents:
15053
diff
changeset
|
170 |
@$(call TargetExit) |
6cdc13b4157e
8005355: build-infra: Java security signing (need a top-level make target).
erikj
parents:
15053
diff
changeset
|
171 |
|
14111 | 172 |
bootcycle-images: |
173 |
@$(ECHO) Boot cycle build step 1: Building the JDK image normally |
|
174 |
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(SPEC) images) |
|
175 |
@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image |
|
176 |
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images) |
|
177 |
||
178 |
test: start-make |
|
179 |
@$(call TargetEnter) |
|
15577
0ed5f9a7f454
8006595: Use jdk/test/Makefile targets in preference to local definitions
mduigou
parents:
15060
diff
changeset
|
180 |
@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= PRODUCT_HOME=$(OUTPUT_ROOT)/jdk JPRT_JAVA_HOME=$(OUTPUT_ROOT)/jdk ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true |
14111 | 181 |
@$(call TargetExit) |
182 |
||
183 |
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be |
|
184 |
# used to track the exact sources used to build that image. |
|
185 |
source-tips: $(OUTPUT_ROOT)/source_tips |
|
186 |
$(OUTPUT_ROOT)/source_tips: FRC |
|
187 |
@$(MKDIR) -p $(@D) |
|
188 |
@$(RM) $@ |
|
189 |
@$(if $(HG),$(call GetSourceTips),$(ECHO) "hg not installed" > $@) |
|
190 |
||
191 |
||
192 |
# Remove everything, except the output from configure. |
|
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14378
diff
changeset
|
193 |
clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build clean-docs |
14111 | 194 |
@($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*) |
195 |
@$(ECHO) Cleaned all build artifacts. |
|
196 |
||
197 |
# Remove everything, including configure configuration. |
|
198 |
# If the output directory was created by configure and now becomes empty, remove it as well. |
|
199 |
# FIXME: tmp should not be here, fix ResetTimers instead. And remove spec.sh! |
|
200 |
dist-clean: clean |
|
201 |
@($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp) |
|
202 |
@$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \ |
|
203 |
if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \ |
|
204 |
$(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ;\ |
|
205 |
else \ |
|
206 |
($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" && $(RM) -r $(OUTPUT_ROOT)) \ |
|
207 |
fi \ |
|
208 |
) |
|
209 |
@$(ECHO) Cleaned everything, you will have to re-run configure. |
|
210 |
||
211 |
clean-langtools: |
|
212 |
$(call CleanComponent,langtools) |
|
213 |
clean-corba: |
|
214 |
$(call CleanComponent,corba) |
|
215 |
clean-jaxp: |
|
216 |
$(call CleanComponent,jaxp) |
|
217 |
clean-jaxws: |
|
218 |
$(call CleanComponent,jaxws) |
|
219 |
clean-hotspot: |
|
220 |
$(call CleanComponent,hotspot) |
|
221 |
clean-jdk: |
|
222 |
$(call CleanComponent,jdk) |
|
223 |
clean-images: |
|
224 |
$(call CleanComponent,images) |
|
225 |
clean-overlay-images: |
|
226 |
$(call CleanComponent,overlay-images) |
|
227 |
clean-bootcycle-build: |
|
228 |
$(call CleanComponent,bootcycle-build) |
|
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14378
diff
changeset
|
229 |
clean-docs: |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14378
diff
changeset
|
230 |
$(call CleanComponent,docs) |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14378
diff
changeset
|
231 |
$(call CleanComponent,docstemp) |
14111 | 232 |
|
233 |
.PHONY: langtools corba jaxp jaxws hotspot jdk images overlay-images install |
|
234 |
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only |
|
235 |
.PHONY: all test clean dist-clean bootcycle-images start-make |
|
236 |
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build |
|
15584 | 237 |
.PHONY: profiles profiles-only profiles-oscheck |
14111 | 238 |
|
239 |
FRC: # Force target |