author | jgish |
Fri, 28 Dec 2012 16:56:54 -0500 | |
changeset 14997 | 97d6098fd419 |
parent 14994 | a544909d1d1c |
child 15140 | 87c70ee15c73 |
permissions | -rw-r--r-- |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
2 |
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
4 |
# |
9670c1610c53
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 |
9670c1610c53
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 |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
10 |
# |
9670c1610c53
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 |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9670c1610c53
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 |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
15 |
# accompanied this code). |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
16 |
# |
9670c1610c53
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 |
9670c1610c53
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, |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
20 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9670c1610c53
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 |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
23 |
# questions. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
24 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
25 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
26 |
include $(SPEC) |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
27 |
include MakeBase.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
28 |
include JavaCompilation.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
29 |
include Setup.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
30 |
|
12892 | 31 |
default: images |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
32 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
33 |
include Tools.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
34 |
|
13702 | 35 |
# Note: This double-colon rule is intentional, to support |
36 |
# custom make file integration. |
|
37 |
images:: jre-image jdk-image |
|
38 |
||
39 |
overlay-images: jre-overlay-image jdk-overlay-image |
|
40 |
||
41 |
||
42 |
-include $(CUSTOM_MAKE_DIR)/Images.gmk |
|
43 |
||
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
44 |
|
13702 | 45 |
# Processing license files from source area to image area |
46 |
# These will be modified to have the platform specific EOL chars. |
|
47 |
define process-doc-file |
|
14231 | 48 |
$(ECHO) $(LOG_INFO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 49 |
$(MKDIR) -p $(@D) |
50 |
$(RM) $@ |
|
51 |
$(SED) 's/$$//g' $< > $@ |
|
52 |
$(CHMOD) 444 $@ |
|
53 |
endef |
|
54 |
||
14231 | 55 |
define AddFileToCopy |
56 |
# Param 1 - src root dir |
|
57 |
# Param 2 - dest root dir |
|
58 |
# Param 3 - src file |
|
59 |
# Param 4 - variable to add targets to |
|
60 |
||
61 |
# Remove src dir root from src file |
|
62 |
$2_$3_FILE := $$(patsubst $1/%,%,$3) |
|
63 |
||
64 |
$2/$$($2_$3_FILE): $3 |
|
65 |
$(ECHO) $(LOG_INFO) Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@) |
|
66 |
$$(install-file) |
|
67 |
||
68 |
$4 += $2/$$($2_$3_FILE) |
|
69 |
endef |
|
13702 | 70 |
|
71 |
JDK_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-image |
|
72 |
JRE_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-image |
|
73 |
||
74 |
JDK_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-overlay-image |
|
75 |
JRE_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-overlay-image |
|
76 |
||
12892 | 77 |
################################################################################ |
78 |
# |
|
79 |
# JRE and JDK build rules |
|
80 |
# |
|
81 |
################################################################################ |
|
13702 | 82 |
# |
83 |
# Variable prefixes explained: |
|
84 |
# JRE_ refers to files in the j2re-image. |
|
85 |
# JDK_ refers to files in the j2sdk-image outside of the jre subdir. |
|
86 |
# JDKJRE_ refers to files in the j2sdk-image inside the jre subdir. |
|
87 |
# |
|
12892 | 88 |
|
89 |
################################################################################ |
|
90 |
# /bin dir |
|
91 |
||
13164 | 92 |
NOT_JRE_BIN_FILES := \ |
12892 | 93 |
appletviewer$(EXE_SUFFIX) \ |
94 |
extcheck$(EXE_SUFFIX) \ |
|
95 |
idlj$(EXE_SUFFIX) \ |
|
96 |
jar$(EXE_SUFFIX) \ |
|
97 |
jarsigner$(EXE_SUFFIX) \ |
|
98 |
java-rmi.cgi \ |
|
99 |
javac$(EXE_SUFFIX) \ |
|
100 |
javadoc$(EXE_SUFFIX) \ |
|
101 |
javah$(EXE_SUFFIX) \ |
|
102 |
javap$(EXE_SUFFIX) \ |
|
14994
a544909d1d1c
8003562: Provide a CLI tool to analyze class dependencies
mchung
parents:
14596
diff
changeset
|
103 |
jdeps$(EXE_SUFFIX) \ |
12892 | 104 |
jcmd$(EXE_SUFFIX) \ |
105 |
jdb$(EXE_SUFFIX) \ |
|
106 |
jps$(EXE_SUFFIX) \ |
|
107 |
jrunscript$(EXE_SUFFIX) \ |
|
108 |
jstat$(EXE_SUFFIX) \ |
|
109 |
jstatd$(EXE_SUFFIX) \ |
|
110 |
jstack$(EXE_SUFFIX) \ |
|
111 |
packagebean$(SCRIPT_SUFFIX) \ |
|
112 |
rmic$(EXE_SUFFIX) \ |
|
113 |
serialver$(EXE_SUFFIX) \ |
|
114 |
unregbean$(EXE_SUFFIX) \ |
|
115 |
jconsole$(EXE_SUFFIX) \ |
|
116 |
jinfo$(EXE_SUFFIX) \ |
|
117 |
jmap$(EXE_SUFFIX) \ |
|
118 |
native2ascii$(EXE_SUFFIX) \ |
|
119 |
xjc$(EXE_SUFFIX) \ |
|
120 |
wsgen$(EXE_SUFFIX) \ |
|
121 |
wsimport$(EXE_SUFFIX) \ |
|
122 |
schemagen$(EXE_SUFFIX) \ |
|
123 |
jsadebugd$(EXE_SUFFIX) \ |
|
124 |
jhat$(EXE_SUFFIX) |
|
125 |
||
126 |
WINDOWS_JDK_BIN_FILES = \ |
|
127 |
$(EXE_SUFFIX) \ |
|
13702 | 128 |
$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \ |
14231 | 129 |
$(notdir $(MSVCR_DLL)) |
13702 | 130 |
|
131 |
WINDOWS_JDKJRE_BIN_FILES := \ |
|
132 |
$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \ |
|
133 |
$(SALIB_NAME) |
|
12892 | 134 |
|
135 |
# Find all files in bin dir |
|
136 |
ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f) |
|
13164 | 137 |
|
14231 | 138 |
# Prevent sjavac from entering the images. |
139 |
ALL_BIN_LIST := $(filter-out %/sjavac,$(ALL_BIN_LIST)) |
|
140 |
||
13702 | 141 |
# For unknown reason the debuginfo files for executables are not put into images |
13164 | 142 |
# e.g filter them out |
13702 | 143 |
ifneq ($(OPENJDK_TARGET_OS),windows) |
144 |
ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST)) |
|
145 |
else |
|
146 |
# On windows, the libraries are in the bin dir, only filter out debuginfo files |
|
147 |
# for executables. "java" is both a library and executable. |
|
148 |
ALL_BIN_EXEC_FILES := $(filter-out java.exe,$(notdir $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name "*.exe"))) |
|
149 |
ALL_BIN_DEBUG_FILTER := $(addprefix %,$(patsubst %.exe,%.debuginfo,$(ALL_BIN_EXEC_FILES)) \ |
|
150 |
$(patsubst %.exe,%.diz,$(ALL_BIN_EXEC_FILES))) %.pdb |
|
151 |
ALL_BIN_LIST := $(filter-out $(ALL_BIN_DEBUG_FILTER),$(ALL_BIN_LIST)) |
|
152 |
endif |
|
13164 | 153 |
|
14231 | 154 |
JDKJRE_BIN_LIST := $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES)), $(ALL_BIN_LIST)) |
155 |
JRE_BIN_LIST := $(filter-out $(addprefix %,$(WINDOWS_JDKJRE_BIN_FILES)), $(JDKJRE_BIN_LIST)) |
|
156 |
||
13164 | 157 |
ifeq ($(OPENJDK_TARGET_OS),windows) |
12892 | 158 |
JDK_BIN_LIST := $(filter $(addprefix %,$(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST)) |
14231 | 159 |
# On windows x86, the server jvm is filtered out from the j2re image. This could possibly |
160 |
# be handled by profiles in the future. If no client jvm is built, leave server in. |
|
161 |
ifeq ($(OPENJDK_TARGET_CPU),x86) |
|
162 |
ifeq ($(JVM_VARIANT_CLIENT),true) |
|
163 |
JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%,$(JRE_BIN_LIST)) |
|
164 |
endif |
|
165 |
endif |
|
12892 | 166 |
else |
167 |
JDK_BIN_LIST := $(ALL_BIN_LIST) |
|
168 |
endif |
|
13702 | 169 |
|
170 |
ifneq ($(OPENJDK_TARGET_CPU_ISADIR),) |
|
171 |
OVERLAY_FILTER := $(JDK_OUTPUTDIR)/bin$(OPENJDK_TARGET_CPU_ISADIR)% |
|
172 |
endif |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
173 |
|
14231 | 174 |
$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JRE_BIN_LIST)),\ |
175 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_BIN_TARGETS))) |
|
176 |
$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\ |
|
177 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_BIN_TARGETS))) |
|
178 |
$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\ |
|
179 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS))) |
|
13702 | 180 |
|
14231 | 181 |
$(foreach f,$(filter $(OVERLAY_FILTER),$(JRE_BIN_LIST)),\ |
182 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_BIN_TARGETS))) |
|
183 |
$(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\ |
|
184 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_BIN_TARGETS))) |
|
185 |
$(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\ |
|
186 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS))) |
|
12892 | 187 |
|
188 |
################################################################################ |
|
189 |
# /lib dir |
|
13702 | 190 |
ifneq ($(OPENJDK_TARGET_OS), macosx) |
191 |
JDKJRE_LIB_FILES := \ |
|
192 |
$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \ |
|
12892 | 193 |
$(SALIB_NAME) |
13702 | 194 |
endif |
12892 | 195 |
|
196 |
NOT_JRE_LIB_FILES := \ |
|
197 |
tools.jar \ |
|
198 |
jconsole.jar \ |
|
199 |
sa-jdi.jar \ |
|
200 |
dt.jar \ |
|
201 |
orb.idl \ |
|
202 |
ir.idl \ |
|
203 |
ct.sym |
|
204 |
||
13702 | 205 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
206 |
NOT_JRE_LIB_FILES += jawt.lib jvm.lib |
|
207 |
endif |
|
208 |
||
12892 | 209 |
JDK_LIB_FILES := $(NOT_JRE_LIB_FILES) |
13164 | 210 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
12892 | 211 |
JDK_LIB_FILES += jexec |
212 |
endif |
|
213 |
||
14231 | 214 |
# Find all files to copy from $(JDK_OUTPUTDIR)/lib |
14596
a1f29d55b5ee
8004281: build-infra: Move all jar creation to images target and put jars in images/lib
erikj
parents:
14231
diff
changeset
|
215 |
# Jar files are not expected to be here |
14231 | 216 |
ALL_JDKOUT_LIB_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \ |
14596
a1f29d55b5ee
8004281: build-infra: Move all jar creation to images target and put jars in images/lib
erikj
parents:
14231
diff
changeset
|
217 |
\( -name "_the*" -o -name "javac_state " -o -name "*.jar" \) ) |
14231 | 218 |
# Find all files to copy from $(IMAGES_OUTPUTDIR)/lib |
14596
a1f29d55b5ee
8004281: build-infra: Move all jar creation to images target and put jars in images/lib
erikj
parents:
14231
diff
changeset
|
219 |
# This is were the jar files are and might not exist if building overlay-images |
14231 | 220 |
ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib),) |
221 |
ALL_IMAGES_LIB_LIST := $(shell $(FIND) $(IMAGES_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \ |
|
222 |
\( -name "_the*" -o -name "javac_state " \) ) |
|
223 |
endif |
|
224 |
||
225 |
# Filter files to copy for each destination |
|
226 |
JRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\ |
|
227 |
$(ALL_JDKOUT_LIB_LIST)) |
|
228 |
JDKJRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_JDKOUT_LIB_LIST)) |
|
229 |
JDK_JDKOUT_LIB_LIST := $(filter $(addprefix %,$(JDK_LIB_FILES)),$(ALL_JDKOUT_LIB_LIST)) |
|
230 |
||
231 |
JRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\ |
|
232 |
$(ALL_IMAGES_LIB_LIST)) |
|
233 |
JDKJRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_IMAGES_LIB_LIST)) |
|
234 |
JDK_IMAGES_LIB_LIST := $(filter $(addprefix %,$(JDK_LIB_FILES)),$(ALL_IMAGES_LIB_LIST)) |
|
12892 | 235 |
|
14231 | 236 |
# Iterate over files to copy to create rules for each one |
237 |
$(foreach f,$(JRE_JDKOUT_LIB_LIST),\ |
|
238 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS))) |
|
239 |
$(foreach f,$(JDK_JDKOUT_LIB_LIST),\ |
|
240 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS))) |
|
241 |
$(foreach f,$(JDKJRE_JDKOUT_LIB_LIST),\ |
|
242 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS))) |
|
12892 | 243 |
|
14231 | 244 |
$(foreach f,$(JRE_IMAGES_LIB_LIST),\ |
245 |
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS))) |
|
246 |
$(foreach f,$(JDK_IMAGES_LIB_LIST),\ |
|
247 |
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS))) |
|
248 |
$(foreach f,$(JDKJRE_IMAGES_LIB_LIST),\ |
|
249 |
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS))) |
|
250 |
||
251 |
$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JRE_JDKOUT_LIB_LIST)),\ |
|
252 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_OVERLAY_LIB_TARGETS))) |
|
253 |
$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDK_JDKOUT_LIB_LIST)),\ |
|
254 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_OVERLAY_LIB_TARGETS))) |
|
255 |
$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDKJRE_JDKOUT_LIB_LIST)),\ |
|
256 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_OVERLAY_LIB_TARGETS))) |
|
13702 | 257 |
|
12892 | 258 |
# CTE plugin security change require new empty directory lib/applet |
259 |
$(JRE_IMAGE_DIR)/lib/applet: |
|
14231 | 260 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 261 |
$(MKDIR) -p $@ |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
262 |
|
12892 | 263 |
$(JDK_IMAGE_DIR)/jre/lib/applet: |
14231 | 264 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 265 |
$(MKDIR) -p $@ |
266 |
||
13702 | 267 |
# In the old build, JObjC.jar is not part of the meta-index |
12892 | 268 |
$(JRE_IMAGE_DIR)/lib/meta-index: $(JRE_LIB_TARGETS) |
14231 | 269 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 270 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index `$(LS) *.jar | $(SED) 's/JObjC\.jar//g'` |
12892 | 271 |
|
272 |
$(JDK_IMAGE_DIR)/jre/lib/meta-index: $(JDKJRE_LIB_TARGETS) |
|
14231 | 273 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 274 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index `$(LS) *.jar | $(SED) 's/JObjC\.jar//g'` |
12892 | 275 |
|
276 |
$(JRE_IMAGE_DIR)/lib/ext/meta-index: $(JRE_LIB_TARGETS) |
|
14231 | 277 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 278 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
279 |
|
13702 | 280 |
$(JDK_IMAGE_DIR)/jre/lib/ext/meta-index: $(JDKJRE_LIB_TARGETS) |
14231 | 281 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 282 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
283 |
||
284 |
################################################################################ |
|
285 |
# /man dir |
|
14231 | 286 |
# Avoid evaluating this whole section on windows for speed and stability |
287 |
ifneq ($(OPENJDK_TARGET_OS),windows) |
|
288 |
JRE_MAN_PAGES := \ |
|
12892 | 289 |
java.1 \ |
290 |
keytool.1 \ |
|
291 |
orbd.1 \ |
|
292 |
pack200.1 \ |
|
293 |
policytool.1 \ |
|
294 |
rmid.1 \ |
|
295 |
rmiregistry.1 \ |
|
296 |
servertool.1 \ |
|
297 |
tnameserv.1 \ |
|
298 |
unpack200.1 |
|
299 |
||
14231 | 300 |
ifndef OPENJDK |
301 |
JRE_MAN_PAGES += javaws.1 |
|
302 |
endif |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
303 |
|
14231 | 304 |
JDK_MAN_PAGES = \ |
12892 | 305 |
$(JRE_MAN_PAGES) \ |
306 |
appletviewer.1 \ |
|
307 |
extcheck.1 \ |
|
308 |
idlj.1 \ |
|
309 |
jar.1 \ |
|
310 |
jarsigner.1 \ |
|
311 |
javac.1 \ |
|
312 |
javadoc.1 \ |
|
313 |
javah.1 \ |
|
314 |
javap.1 \ |
|
315 |
jconsole.1 \ |
|
316 |
jcmd.1 \ |
|
317 |
jdb.1 \ |
|
318 |
jhat.1 \ |
|
319 |
jinfo.1 \ |
|
320 |
jmap.1 \ |
|
321 |
jps.1 \ |
|
322 |
jrunscript.1 \ |
|
323 |
jsadebugd.1 \ |
|
324 |
jstack.1 \ |
|
325 |
jstat.1 \ |
|
326 |
jstatd.1 \ |
|
327 |
native2ascii.1 \ |
|
328 |
rmic.1 \ |
|
329 |
schemagen.1 \ |
|
330 |
serialver.1 \ |
|
331 |
wsgen.1 \ |
|
332 |
wsimport.1 \ |
|
333 |
xjc.1 |
|
334 |
||
14231 | 335 |
ifndef OPENJDK |
336 |
JDK_MAN_PAGES += jvisualvm.1 |
|
337 |
endif |
|
13497
2c09fb7cdf7f
7192804: Build should not install jvisualvm man page for OpenJDK
andrew
parents:
13164
diff
changeset
|
338 |
|
14231 | 339 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
340 |
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/linux/doc |
|
341 |
MAN1_SUBDIR:=man |
|
342 |
endif |
|
343 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
344 |
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/solaris/doc |
|
345 |
MAN1_SUBDIR:=sun/man/man1 |
|
346 |
endif |
|
347 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
348 |
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/bsd/doc |
|
349 |
MAN1_SUBDIR:=man |
|
350 |
JDK_MAN_PAGES := $(filter-out jcmd.1, $(JDK_MAN_PAGES)) |
|
351 |
JDK_MAN_PAGES := $(filter-out jvisualvm.1, $(JDK_MAN_PAGES)) |
|
352 |
endif |
|
13164 | 353 |
|
12892 | 354 |
|
14231 | 355 |
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% |
356 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
12892 | 357 |
$(install-file) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
358 |
|
14231 | 359 |
$(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% |
360 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
12892 | 361 |
$(install-file) |
362 |
||
14231 | 363 |
$(JRE_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/% |
364 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
12892 | 365 |
$(install-file) |
366 |
||
14231 | 367 |
$(JDK_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/% |
368 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
12892 | 369 |
$(install-file) |
370 |
||
14231 | 371 |
define install-ja-manpage |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
372 |
$(MKDIR) -p $(@D) |
12892 | 373 |
$(CAT) $< \ |
374 |
| $(NATIVE2ASCII) -encoding eucJP \ |
|
375 |
| $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \ |
|
376 |
| $(NATIVE2ASCII) -reverse -encoding $1 \ |
|
377 |
> $@ |
|
14231 | 378 |
endef |
12892 | 379 |
|
14231 | 380 |
$(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
381 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
12892 | 382 |
$(call install-ja-manpage,UTF-8) |
383 |
||
14231 | 384 |
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
385 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
12892 | 386 |
$(call install-ja-manpage,UTF-8) |
387 |
||
14231 | 388 |
$(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
389 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
12892 | 390 |
$(call install-ja-manpage,PCK) |
391 |
||
14231 | 392 |
$(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
393 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
12892 | 394 |
$(call install-ja-manpage,PCK) |
395 |
||
14231 | 396 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
397 |
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
398 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
399 |
$(install-file) |
|
12892 | 400 |
|
14231 | 401 |
$(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
402 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
403 |
$(install-file) |
|
404 |
endif |
|
12892 | 405 |
|
14231 | 406 |
# Old build creates empty man page for this, mimicing behaviour. |
407 |
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja/man1/jcmd.1: |
|
408 |
$(ECHO) $(LOG_INFO) Creating dummy $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
12892 | 409 |
$(MKDIR) -p $(@D) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
410 |
$(TOUCH) $@ |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
411 |
|
14231 | 412 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
413 |
$(JRE_IMAGE_DIR)/man/ja: |
|
414 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
415 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
13164 | 416 |
|
14231 | 417 |
$(JDK_IMAGE_DIR)/man/ja: |
418 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
419 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
420 |
endif |
|
13164 | 421 |
|
14231 | 422 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
423 |
$(JRE_IMAGE_DIR)/man/ja: |
|
424 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
425 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
12892 | 426 |
|
14231 | 427 |
$(JDK_IMAGE_DIR)/man/ja: |
428 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
429 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
430 |
endif |
|
12892 | 431 |
|
14231 | 432 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
433 |
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \ |
|
434 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \ |
|
435 |
$(JRE_IMAGE_DIR)/man/ja |
|
12892 | 436 |
|
14231 | 437 |
JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \ |
438 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \ |
|
439 |
$(JDK_IMAGE_DIR)/man/ja |
|
440 |
endif |
|
12892 | 441 |
|
14231 | 442 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
443 |
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \ |
|
444 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/,$(JRE_MAN_PAGES)) \ |
|
445 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \ |
|
446 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JRE_MAN_PAGES)) |
|
12892 | 447 |
|
14231 | 448 |
JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \ |
449 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/,$(JDK_MAN_PAGES)) \ |
|
450 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \ |
|
451 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JDK_MAN_PAGES)) |
|
452 |
endif |
|
12892 | 453 |
|
14231 | 454 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
455 |
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \ |
|
456 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \ |
|
457 |
$(JRE_IMAGE_DIR)/man/ja |
|
13164 | 458 |
|
14231 | 459 |
JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \ |
460 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \ |
|
461 |
$(JDK_IMAGE_DIR)/man/ja |
|
462 |
endif |
|
463 |
||
464 |
endif # Windows |
|
13164 | 465 |
|
12892 | 466 |
################################################################################ |
467 |
# /demo dir |
|
468 |
||
13702 | 469 |
# FIXME: demo/applets/GraphLayout/GraphPanel$2.class is sometimes not copied. |
12892 | 470 |
|
471 |
# The db demo contains an empty dir that needs to be copied. The other |
|
472 |
# directories will always trigger the rule for recompile since |
|
473 |
# _the.list_of_packages files are touched. |
|
14231 | 474 |
$(JDK_IMAGE_DIR)/demo/%: $(JDK_OUTPUTDIR)/demo/% |
12892 | 475 |
if [ ! -d "$@" ]; then \ |
14231 | 476 |
$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \ |
12892 | 477 |
$(MKDIR) -p $(@D); \ |
478 |
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \ |
|
479 |
fi |
|
480 |
||
481 |
# Find all files including directories |
|
14231 | 482 |
JDK_DEMO_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/demo/%,$(JDK_IMAGE_DIR)/demo/%,\ |
13702 | 483 |
$(shell $(FIND) $(JDK_OUTPUTDIR)/demo ! \( -name "_the*" -o -name "javac_state" \) )) |
484 |
||
485 |
||
486 |
||
14231 | 487 |
# Param 1 is source file |
488 |
define CreateOverlayDemoRule |
|
489 |
$1_TARGET:=$$(subst $(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),\ |
|
13702 | 490 |
$$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1)) |
14231 | 491 |
$$($1_TARGET): $1 |
492 |
$(ECHO) $(LOG_INFO) Copying '$$(patsubst $(OUTPUT_ROOT)/%,%,$$@)' |
|
493 |
$$(call install-file) |
|
13702 | 494 |
|
14231 | 495 |
JDK_OVERLAY_DEMO_TARGETS += $$($1_TARGET) |
496 |
endef |
|
497 |
JDK_OVERLAY_DEMO_SOURCES := $(shell $(FIND) $(JDK_OUTPUTDIR)/demo -name "*$(SHARED_LIBRARY_SUFFIX)") |
|
498 |
$(foreach lib,$(JDK_OVERLAY_DEMO_SOURCES),$(eval $(call CreateOverlayDemoRule,$(lib)))) |
|
12892 | 499 |
|
500 |
################################################################################ |
|
501 |
# /sample dir |
|
502 |
||
14231 | 503 |
$(foreach f,$(shell $(FIND) $(JDK_OUTPUTDIR)/sample -type f),\ |
504 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_SAMPLE_TARGETS))) |
|
12892 | 505 |
|
506 |
################################################################################ |
|
507 |
# /db dir |
|
508 |
||
509 |
ifndef OPENJDK |
|
510 |
$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/% |
|
511 |
$(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<) |
|
512 |
$(MKDIR) -p $(JDK_IMAGE_DIR)/db |
|
14231 | 513 |
cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -q -o $< -x index.html 2> /dev/null |
12892 | 514 |
$(MKDIR) -p $(@D) |
515 |
$(TOUCH) $@ |
|
516 |
||
517 |
$(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html |
|
14231 | 518 |
$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' |
12892 | 519 |
$(install-file) |
520 |
||
521 |
JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\ |
|
522 |
$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*.zip" ! -name "*demo*")) \ |
|
523 |
$(JDK_IMAGE_DIR)/db/README-JDK.html |
|
524 |
||
525 |
endif |
|
526 |
||
527 |
################################################################################ |
|
528 |
# /include dir |
|
529 |
||
14231 | 530 |
$(foreach f,$(shell $(FIND) $(JDK_OUTPUTDIR)/include -type f),\ |
531 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_INCLUDE_TARGETS))) |
|
12892 | 532 |
|
533 |
################################################################################ |
|
534 |
# doc files |
|
535 |
||
536 |
ifdef OPENJDK |
|
537 |
JRE_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README |
|
538 |
JDK_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README |
|
539 |
JRE_DOC_LOCATION := $(JDK_TOPDIR) |
|
540 |
JDK_DOC_LOCATION := $(JDK_TOPDIR) |
|
541 |
else |
|
542 |
JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt |
|
543 |
JDK_DOC_FILES := COPYRIGHT README.html LICENSE THIRDPARTYLICENSEREADME.txt |
|
13164 | 544 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
12892 | 545 |
JRE_DOC_FILES += README.txt |
546 |
else |
|
547 |
JRE_DOC_FILES += README |
|
548 |
endif |
|
14231 | 549 |
JDK_DOC_FILES += demo/DEMOS_LICENSE sample/SAMPLES_LICENSE |
12892 | 550 |
JRE_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jre |
551 |
JDK_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jdk |
|
552 |
endif |
|
553 |
JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/,$(JRE_DOC_FILES)) |
|
554 |
JDKJRE_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/jre/,$(JRE_DOC_FILES)) |
|
555 |
JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/,$(JDK_DOC_FILES)) |
|
556 |
||
557 |
$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/% |
|
13702 | 558 |
$(process-doc-file) |
12892 | 559 |
|
560 |
$(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/% |
|
13702 | 561 |
$(process-doc-file) |
12892 | 562 |
|
563 |
$(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README |
|
13702 | 564 |
$(process-doc-file) |
12892 | 565 |
|
566 |
$(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README |
|
13702 | 567 |
$(process-doc-file) |
12892 | 568 |
|
569 |
$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/% |
|
13702 | 570 |
$(process-doc-file) |
12892 | 571 |
|
572 |
$(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/% |
|
13702 | 573 |
$(process-doc-file) |
12892 | 574 |
|
575 |
$(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/% |
|
13702 | 576 |
$(process-doc-file) |
12892 | 577 |
|
578 |
JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release |
|
579 |
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release |
|
580 |
||
13702 | 581 |
JRE_OVERLAY_INFO_FILE := $(JRE_OVERLAY_IMAGE_DIR)/release |
582 |
JDK_OVERLAY_INFO_FILE := $(JDK_OVERLAY_IMAGE_DIR)/release |
|
583 |
||
12892 | 584 |
# Common way to emit a line into the release or info file |
585 |
define info-file-item # name value |
|
586 |
$(PRINTF) '%s="%s"\n' $1 $2 >> $@ |
|
587 |
endef |
|
588 |
||
13702 | 589 |
define create-info-file |
590 |
$(MKDIR) -p $(@D) |
|
591 |
$(RM) $@ |
|
592 |
$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)") |
|
593 |
$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)") |
|
594 |
$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)") |
|
595 |
$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)") |
|
596 |
$(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)") |
|
597 |
endef |
|
598 |
||
12892 | 599 |
ALL_SOURCE_TIPS = $(shell \ |
600 |
if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \ |
|
601 |
$(CAT) $(OUTPUT_ROOT)/source_tips ; \ |
|
602 |
fi) |
|
603 |
||
604 |
$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
14231 | 605 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 606 |
$(call create-info-file) |
12892 | 607 |
|
608 |
$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
14231 | 609 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 610 |
$(call create-info-file) |
611 |
||
612 |
$(JRE_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
14231 | 613 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 614 |
$(call create-info-file) |
615 |
||
616 |
$(JDK_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
14231 | 617 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 618 |
$(call create-info-file) |
12892 | 619 |
|
620 |
$(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip |
|
14231 | 621 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 622 |
$(install-file) |
623 |
||
624 |
################################################################################ |
|
625 |
# Post processing (strip etc) |
|
626 |
||
627 |
ifneq ($(POST_STRIP_CMD),) |
|
13164 | 628 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
13702 | 629 |
EXEC_LIST_BIN:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \ |
14231 | 630 |
-o -name \*.dll | $(EGREP) -v -i "$(MSVCR_DLL)") |
12892 | 631 |
else |
632 |
# Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed |
|
13702 | 633 |
EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX)` \ |
12892 | 634 |
| $(EGREP) 'ELF' | $(CUT) -d':' -f1) |
13702 | 635 |
# On mac, the old build searches for static libraries for stripping instead of shared. |
636 |
# Not clear if it's intentional. |
|
637 |
ifneq ($(OPENJDK_TARGET_OS), macosx) |
|
638 |
EXEC_LIST_LIB:=$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX)) |
|
639 |
endif |
|
12892 | 640 |
endif |
14231 | 641 |
# Filter out sjavac |
642 |
EXEC_LIST_BIN:=$(filter-out %sjavac$(EXE_SUFFIX),$(EXEC_LIST_BIN)) |
|
13702 | 643 |
|
644 |
# Filter out the overlay specific bin files |
|
645 |
EXEC_LIST:=$(filter-out $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB) |
|
646 |
EXEC_LIST_OVERLAY:=$(filter $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB) |
|
647 |
||
12892 | 648 |
# Filter out non JRE files and convert to unique touch files to depend on |
13702 | 649 |
JRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped,\ |
650 |
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\ |
|
651 |
$(EXEC_LIST))) |
|
13164 | 652 |
|
13702 | 653 |
JDKJRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \ |
13164 | 654 |
$(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \ |
12892 | 655 |
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST))) |
656 |
||
13702 | 657 |
JDK_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \ |
13164 | 658 |
$(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \ |
659 |
$(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST))) |
|
660 |
||
13702 | 661 |
# Do the same for overlay image |
662 |
JRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped,\ |
|
663 |
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\ |
|
664 |
$(EXEC_LIST_OVERLAY))) |
|
665 |
||
666 |
JDKJRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \ |
|
667 |
$(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/jre/%.stripped, \ |
|
668 |
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST_OVERLAY))) |
|
669 |
||
670 |
JDK_OVERLAY_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \ |
|
671 |
$(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped, \ |
|
672 |
$(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST_OVERLAY))) |
|
673 |
||
674 |
define mcs-file |
|
675 |
$(if $(POST_MCS_CMD),$(POST_MCS_CMD) $<) |
|
676 |
endef |
|
677 |
||
678 |
define strip-file |
|
14231 | 679 |
$(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<) |
13702 | 680 |
$(CHMOD) u+w $< |
681 |
$(POST_STRIP_CMD) $< |
|
682 |
$(call mcs-file) |
|
683 |
$(CHMOD) go-w $< |
|
684 |
$(MKDIR) -p $(@D) |
|
685 |
$(TOUCH) $@ |
|
686 |
endef |
|
687 |
||
12892 | 688 |
# Setup a rule for stripping files based on touch files |
13164 | 689 |
$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped: $(JRE_IMAGE_DIR)/% |
13702 | 690 |
$(call strip-file) |
691 |
||
692 |
$(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/% |
|
693 |
$(call strip-file) |
|
13164 | 694 |
|
13702 | 695 |
$(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped: $(JRE_OVERLAY_IMAGE_DIR)/% |
696 |
$(call strip-file) |
|
13164 | 697 |
|
13702 | 698 |
$(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped: $(JDK_OVERLAY_IMAGE_DIR)/% |
699 |
$(call strip-file) |
|
13164 | 700 |
|
12892 | 701 |
endif |
702 |
||
703 |
################################################################################ |
|
704 |
# Main targets |
|
705 |
||
706 |
jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \ |
|
707 |
$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \ |
|
13702 | 708 |
$(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST) |
12892 | 709 |
|
710 |
jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \ |
|
711 |
$(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \ |
|
712 |
$(JDK_IMAGE_DIR)/jre/lib/applet \ |
|
713 |
$(JDK_DEMO_TARGETS) \ |
|
714 |
$(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \ |
|
715 |
$(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \ |
|
716 |
$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \ |
|
717 |
$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \ |
|
13702 | 718 |
$(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \ |
13164 | 719 |
$(JDK_IMAGE_DIR)/src.zip |
12892 | 720 |
|
13702 | 721 |
jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \ |
722 |
$(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST) |
|
723 |
||
724 |
jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \ |
|
725 |
$(JDK_OVERLAY_LIB_TARGETS) $(JDKJRE_OVERLAY_LIB_TARGETS) \ |
|
726 |
$(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \ |
|
727 |
$(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST) |
|
728 |
||
12892 | 729 |
################################################################################ |
730 |
||
731 |
.PHONY: default images jre-image jdk-image |