author | chegar |
Sun, 17 Aug 2014 15:54:13 +0100 | |
changeset 25859 | 3317bb8137f4 |
parent 23602 | ff671719d44a |
child 26860 | 2bd15d21fb0f |
permissions | -rw-r--r-- |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
22963
a28e6f0b511b
8034191: Move relevant parts of build system to new closed repo
ihse
parents:
22342
diff
changeset
|
2 |
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
12317
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 |
|
12892 | 30 |
default: images |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
31 |
|
23347
acb1d044a217
8037281: Improve CacheFind and enable on all platforms
erikj
parents:
22963
diff
changeset
|
32 |
# Prepare the find cache. |
20547 | 33 |
$(eval $(call FillCacheFind, \ |
15126
bceb690ccf35
8005540: build-infra: Improve incremental build speed on windows by caching find results
erikj
parents:
14596
diff
changeset
|
34 |
$(wildcard $(JDK_OUTPUTDIR)/bin \ |
20547 | 35 |
$(JDK_OUTPUTDIR)/lib \ |
36 |
$(IMAGES_OUTPUTDIR)/lib \ |
|
37 |
$(JDK_OUTPUTDIR)/include \ |
|
38 |
$(JDK_OUTPUTDIR)/sample \ |
|
39 |
$(JDK_OUTPUTDIR)/demo))) |
|
15126
bceb690ccf35
8005540: build-infra: Improve incremental build speed on windows by caching find results
erikj
parents:
14596
diff
changeset
|
40 |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
41 |
include Tools.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
42 |
|
15681 | 43 |
include Profiles.gmk |
44 |
||
13702 | 45 |
# Note: This double-colon rule is intentional, to support |
46 |
# custom make file integration. |
|
47 |
images:: jre-image jdk-image |
|
48 |
||
49 |
overlay-images: jre-overlay-image jdk-overlay-image |
|
50 |
||
51 |
||
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
52 |
|
13702 | 53 |
# Processing license files from source area to image area |
54 |
# These will be modified to have the platform specific EOL chars. |
|
55 |
define process-doc-file |
|
14231 | 56 |
$(ECHO) $(LOG_INFO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 57 |
$(MKDIR) -p $(@D) |
58 |
$(RM) $@ |
|
15823
9882cddb33b9
8007387: "sed: RE error: illegal byte sequence" when building images on Mac
erikj
parents:
15693
diff
changeset
|
59 |
LC_ALL=C $(SED) 's/$$//g' $< > $@ |
13702 | 60 |
$(CHMOD) 444 $@ |
61 |
endef |
|
62 |
||
14231 | 63 |
define AddFileToCopy |
64 |
# Param 1 - src root dir |
|
65 |
# Param 2 - dest root dir |
|
66 |
# Param 3 - src file |
|
67 |
# Param 4 - variable to add targets to |
|
68 |
||
69 |
# Remove src dir root from src file |
|
70 |
$2_$3_FILE := $$(patsubst $1/%,%,$3) |
|
71 |
||
72 |
$2/$$($2_$3_FILE): $3 |
|
73 |
$(ECHO) $(LOG_INFO) Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@) |
|
74 |
$$(install-file) |
|
75 |
||
76 |
$4 += $2/$$($2_$3_FILE) |
|
77 |
endef |
|
13702 | 78 |
|
12892 | 79 |
################################################################################ |
80 |
# |
|
81 |
# JRE and JDK build rules |
|
82 |
# |
|
83 |
################################################################################ |
|
13702 | 84 |
# |
85 |
# Variable prefixes explained: |
|
15681 | 86 |
# JRE_ refers to files in the j2re-*-image. |
13702 | 87 |
# JDK_ refers to files in the j2sdk-image outside of the jre subdir. |
88 |
# JDKJRE_ refers to files in the j2sdk-image inside the jre subdir. |
|
89 |
# |
|
12892 | 90 |
|
91 |
################################################################################ |
|
92 |
# /bin dir |
|
93 |
||
20547 | 94 |
ifeq ($(PROFILE), ) |
95 |
NOT_JRE_BIN_FILES := \ |
|
96 |
appletviewer$(EXE_SUFFIX) \ |
|
97 |
extcheck$(EXE_SUFFIX) \ |
|
98 |
idlj$(EXE_SUFFIX) \ |
|
99 |
jar$(EXE_SUFFIX) \ |
|
100 |
jarsigner$(EXE_SUFFIX) \ |
|
101 |
java-rmi.cgi \ |
|
102 |
javac$(EXE_SUFFIX) \ |
|
103 |
javadoc$(EXE_SUFFIX) \ |
|
104 |
javah$(EXE_SUFFIX) \ |
|
105 |
javap$(EXE_SUFFIX) \ |
|
106 |
jdeps$(EXE_SUFFIX) \ |
|
107 |
jcmd$(EXE_SUFFIX) \ |
|
108 |
jdb$(EXE_SUFFIX) \ |
|
109 |
jps$(EXE_SUFFIX) \ |
|
110 |
jrunscript$(EXE_SUFFIX) \ |
|
111 |
jstat$(EXE_SUFFIX) \ |
|
112 |
jstatd$(EXE_SUFFIX) \ |
|
113 |
jstack$(EXE_SUFFIX) \ |
|
114 |
packagebean$(SCRIPT_SUFFIX) \ |
|
115 |
rmic$(EXE_SUFFIX) \ |
|
116 |
serialver$(EXE_SUFFIX) \ |
|
117 |
unregbean$(EXE_SUFFIX) \ |
|
118 |
jconsole$(EXE_SUFFIX) \ |
|
119 |
jinfo$(EXE_SUFFIX) \ |
|
120 |
jmap$(EXE_SUFFIX) \ |
|
121 |
native2ascii$(EXE_SUFFIX) \ |
|
122 |
xjc$(EXE_SUFFIX) \ |
|
123 |
wsgen$(EXE_SUFFIX) \ |
|
124 |
wsimport$(EXE_SUFFIX) \ |
|
125 |
schemagen$(EXE_SUFFIX) \ |
|
126 |
jsadebugd$(EXE_SUFFIX) \ |
|
127 |
jhat$(EXE_SUFFIX) |
|
15681 | 128 |
endif |
12892 | 129 |
|
130 |
WINDOWS_JDK_BIN_FILES = \ |
|
20547 | 131 |
$(EXE_SUFFIX) \ |
132 |
$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \ |
|
133 |
$(notdir $(MSVCR_DLL)) |
|
13702 | 134 |
|
135 |
WINDOWS_JDKJRE_BIN_FILES := \ |
|
20547 | 136 |
$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \ |
137 |
$(SALIB_NAME) |
|
12892 | 138 |
|
139 |
# Find all files in bin dir |
|
20547 | 140 |
ALL_BIN_LIST := $(call CacheFind, $(JDK_OUTPUTDIR)/bin) |
13164 | 141 |
|
14231 | 142 |
# Prevent sjavac from entering the images. |
20547 | 143 |
ALL_BIN_LIST := $(filter-out %/sjavac, $(ALL_BIN_LIST)) |
14231 | 144 |
|
13702 | 145 |
# For unknown reason the debuginfo files for executables are not put into images |
13164 | 146 |
# e.g filter them out |
20547 | 147 |
ifneq ($(OPENJDK_TARGET_OS), windows) |
148 |
ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST)) |
|
13702 | 149 |
else |
20547 | 150 |
# On windows, the libraries are in the bin dir, only filter out debuginfo files |
151 |
# for executables. "java" is both a library and executable. |
|
152 |
ALL_BIN_EXEC_FILES := $(filter-out java.exe, $(notdir $(filter %.exe, $(ALL_BIN_LIST)))) |
|
153 |
ALL_BIN_DEBUG_FILTER := $(addprefix %, $(patsubst %.exe, %.debuginfo, $(ALL_BIN_EXEC_FILES)) \ |
|
154 |
$(patsubst %.exe, %.diz, $(ALL_BIN_EXEC_FILES))) %.pdb |
|
155 |
ALL_BIN_LIST := $(filter-out $(ALL_BIN_DEBUG_FILTER), $(ALL_BIN_LIST)) |
|
13702 | 156 |
endif |
13164 | 157 |
|
20547 | 158 |
JDKJRE_BIN_LIST := $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES)), $(ALL_BIN_LIST)) |
159 |
JRE_BIN_LIST := $(filter-out $(addprefix %, $(WINDOWS_JDKJRE_BIN_FILES)), $(JDKJRE_BIN_LIST)) |
|
14231 | 160 |
|
20547 | 161 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
162 |
JDK_BIN_LIST := $(filter $(addprefix %, $(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST)) |
|
163 |
# On windows x86, the server jvm is filtered out from the j2re image. This could possibly |
|
164 |
# be handled by profiles in the future. If no client jvm is built, leave server in. |
|
165 |
ifeq ($(OPENJDK_TARGET_CPU), x86) |
|
166 |
ifeq ($(JVM_VARIANT_CLIENT), true) |
|
167 |
JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST)) |
|
14231 | 168 |
endif |
20547 | 169 |
endif |
12892 | 170 |
else |
20547 | 171 |
JDK_BIN_LIST := $(ALL_BIN_LIST) |
12892 | 172 |
endif |
13702 | 173 |
|
20547 | 174 |
ifneq ($(OPENJDK_TARGET_CPU_ISADIR), ) |
175 |
OVERLAY_FILTER := $(JDK_OUTPUTDIR)/bin$(OPENJDK_TARGET_CPU_ISADIR)% |
|
13702 | 176 |
endif |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
177 |
|
20547 | 178 |
$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JRE_BIN_LIST)), \ |
14231 | 179 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_BIN_TARGETS))) |
20547 | 180 |
$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDK_BIN_LIST)), \ |
14231 | 181 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_BIN_TARGETS))) |
20547 | 182 |
$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)), \ |
14231 | 183 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS))) |
13702 | 184 |
|
20547 | 185 |
$(foreach f,$(filter $(OVERLAY_FILTER),$(JRE_BIN_LIST)), \ |
14231 | 186 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_BIN_TARGETS))) |
20547 | 187 |
$(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)), \ |
14231 | 188 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_BIN_TARGETS))) |
20547 | 189 |
$(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)), \ |
14231 | 190 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS))) |
12892 | 191 |
|
192 |
################################################################################ |
|
193 |
# /lib dir |
|
13702 | 194 |
ifneq ($(OPENJDK_TARGET_OS), macosx) |
20547 | 195 |
JDKJRE_LIB_FILES := \ |
196 |
$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \ |
|
197 |
$(SALIB_NAME) |
|
13702 | 198 |
endif |
12892 | 199 |
|
20547 | 200 |
ifeq ($(PROFILE), ) |
201 |
NOT_JRE_LIB_FILES := \ |
|
202 |
tools.jar \ |
|
203 |
jconsole.jar \ |
|
204 |
sa-jdi.jar \ |
|
205 |
dt.jar \ |
|
206 |
orb.idl \ |
|
207 |
ir.idl \ |
|
208 |
ct.sym |
|
12892 | 209 |
|
20547 | 210 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
211 |
NOT_JRE_LIB_FILES += jawt.lib jvm.lib |
|
212 |
endif |
|
13702 | 213 |
endif |
214 |
||
12892 | 215 |
JDK_LIB_FILES := $(NOT_JRE_LIB_FILES) |
13164 | 216 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
20547 | 217 |
JDK_LIB_FILES += jexec |
12892 | 218 |
endif |
219 |
||
20812 | 220 |
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),) # If Linux or Solaris |
221 |
JDK_LIB_FILES += $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \ |
|
222 |
$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) |
|
223 |
endif |
|
224 |
||
14231 | 225 |
# 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
|
226 |
# Jar files are not expected to be here |
20547 | 227 |
ALL_JDKOUT_LIB_LIST := $(call not-containing,_the., $(filter-out %.jar, \ |
228 |
$(call CacheFind, $(JDK_OUTPUTDIR)/lib))) |
|
14231 | 229 |
# 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
|
230 |
# This is were the jar files are and might not exist if building overlay-images |
20547 | 231 |
ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib), ) |
232 |
ALL_IMAGES_LIB_LIST := $(call not-containing,_the., \ |
|
233 |
$(call CacheFind, $(IMAGES_OUTPUTDIR)/lib)) |
|
14231 | 234 |
endif |
235 |
||
236 |
# Filter files to copy for each destination |
|
20547 | 237 |
JRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \ |
238 |
$(ALL_JDKOUT_LIB_LIST)) |
|
239 |
JDKJRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES)), $(ALL_JDKOUT_LIB_LIST)) |
|
240 |
JDK_JDKOUT_LIB_LIST := $(filter $(addprefix %, $(JDK_LIB_FILES)), $(ALL_JDKOUT_LIB_LIST)) |
|
14231 | 241 |
|
20547 | 242 |
JRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \ |
243 |
$(ALL_IMAGES_LIB_LIST)) |
|
244 |
JDKJRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES)), $(ALL_IMAGES_LIB_LIST)) |
|
245 |
JDK_IMAGES_LIB_LIST := $(filter $(addprefix %, $(JDK_LIB_FILES)), $(ALL_IMAGES_LIB_LIST)) |
|
12892 | 246 |
|
14231 | 247 |
# Iterate over files to copy to create rules for each one |
20547 | 248 |
$(foreach f,$(JRE_JDKOUT_LIB_LIST), \ |
14231 | 249 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS))) |
20547 | 250 |
$(foreach f,$(JDK_JDKOUT_LIB_LIST), \ |
14231 | 251 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS))) |
20547 | 252 |
$(foreach f,$(JDKJRE_JDKOUT_LIB_LIST), \ |
14231 | 253 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS))) |
12892 | 254 |
|
20547 | 255 |
$(foreach f,$(JRE_IMAGES_LIB_LIST), \ |
14231 | 256 |
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS))) |
20547 | 257 |
$(foreach f,$(JDK_IMAGES_LIB_LIST), \ |
14231 | 258 |
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS))) |
20547 | 259 |
$(foreach f,$(JDKJRE_IMAGES_LIB_LIST), \ |
14231 | 260 |
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS))) |
261 |
||
20547 | 262 |
$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JRE_JDKOUT_LIB_LIST)), \ |
14231 | 263 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_OVERLAY_LIB_TARGETS))) |
20547 | 264 |
$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDK_JDKOUT_LIB_LIST)), \ |
14231 | 265 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_OVERLAY_LIB_TARGETS))) |
20547 | 266 |
$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDKJRE_JDKOUT_LIB_LIST)), \ |
14231 | 267 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_OVERLAY_LIB_TARGETS))) |
13702 | 268 |
|
20547 | 269 |
ifneq ($(PROFILE), ) |
270 |
# Files in lib$(PROFILE) are excluded from the generic copying routines so |
|
271 |
# we have to add them back in here |
|
272 |
$(foreach f,$(CUSTOM_PROFILE_JARS), \ |
|
273 |
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR)/lib$(PROFILE),$(JRE_IMAGE_DIR)/lib,$f,JRE_LIB_TARGETS))) |
|
15885
1729959f3994
8009695: embedded/GP/RI: This intermittent error happens too often, makes the build unstable, and waste machine
erikj
parents:
15823
diff
changeset
|
274 |
endif |
1729959f3994
8009695: embedded/GP/RI: This intermittent error happens too often, makes the build unstable, and waste machine
erikj
parents:
15823
diff
changeset
|
275 |
|
12892 | 276 |
# CTE plugin security change require new empty directory lib/applet |
20547 | 277 |
$(JRE_IMAGE_DIR)/lib/applet: |
14231 | 278 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 279 |
$(MKDIR) -p $@ |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
280 |
|
20547 | 281 |
$(JDK_IMAGE_DIR)/jre/lib/applet: |
14231 | 282 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 283 |
$(MKDIR) -p $@ |
284 |
||
285 |
$(JRE_IMAGE_DIR)/lib/meta-index: $(JRE_LIB_TARGETS) |
|
14231 | 286 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
22307 | 287 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
12892 | 288 |
|
289 |
$(JDK_IMAGE_DIR)/jre/lib/meta-index: $(JDKJRE_LIB_TARGETS) |
|
14231 | 290 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
22307 | 291 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
12892 | 292 |
|
293 |
$(JRE_IMAGE_DIR)/lib/ext/meta-index: $(JRE_LIB_TARGETS) |
|
14231 | 294 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 295 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
296 |
|
13702 | 297 |
$(JDK_IMAGE_DIR)/jre/lib/ext/meta-index: $(JDKJRE_LIB_TARGETS) |
14231 | 298 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 299 |
$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar |
300 |
||
301 |
################################################################################ |
|
302 |
# /man dir |
|
23602 | 303 |
# |
304 |
# All variables in this section are assigned with simple =, without :, to enable |
|
305 |
# more selective overriding from the custom version of this file. |
|
306 |
# |
|
14231 | 307 |
# Avoid evaluating this whole section on windows for speed and stability |
20547 | 308 |
ifneq ($(OPENJDK_TARGET_OS), windows) |
23602 | 309 |
JRE_MAN_PAGES = \ |
20547 | 310 |
java.1 \ |
23601
d15e005afb07
8031300: No jdeps.1 and jjs.1 man pages in jdk8 b122 build and jvisualvm.1 and jcmd.1 missing on macosx
erikj
parents:
23600
diff
changeset
|
311 |
jjs.1 \ |
20547 | 312 |
keytool.1 \ |
313 |
orbd.1 \ |
|
314 |
pack200.1 \ |
|
315 |
policytool.1 \ |
|
316 |
rmid.1 \ |
|
317 |
rmiregistry.1 \ |
|
318 |
servertool.1 \ |
|
319 |
tnameserv.1 \ |
|
320 |
unpack200.1 |
|
12892 | 321 |
|
20547 | 322 |
ifndef OPENJDK |
20550
f9e9b021bee7
8026500: [infra] remove extraneous docs in solaris images
ksrini
parents:
20547
diff
changeset
|
323 |
ifneq ($(OPENJDK_TARGET_OS), solaris) |
f9e9b021bee7
8026500: [infra] remove extraneous docs in solaris images
ksrini
parents:
20547
diff
changeset
|
324 |
JRE_MAN_PAGES += javaws.1 |
f9e9b021bee7
8026500: [infra] remove extraneous docs in solaris images
ksrini
parents:
20547
diff
changeset
|
325 |
endif |
20547 | 326 |
endif |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
327 |
|
20547 | 328 |
JDK_MAN_PAGES = \ |
329 |
$(JRE_MAN_PAGES) \ |
|
330 |
appletviewer.1 \ |
|
331 |
extcheck.1 \ |
|
332 |
idlj.1 \ |
|
333 |
jar.1 \ |
|
334 |
jarsigner.1 \ |
|
335 |
javac.1 \ |
|
336 |
javadoc.1 \ |
|
337 |
javah.1 \ |
|
338 |
javap.1 \ |
|
339 |
jconsole.1 \ |
|
340 |
jcmd.1 \ |
|
341 |
jdb.1 \ |
|
23601
d15e005afb07
8031300: No jdeps.1 and jjs.1 man pages in jdk8 b122 build and jvisualvm.1 and jcmd.1 missing on macosx
erikj
parents:
23600
diff
changeset
|
342 |
jdeps.1 \ |
20547 | 343 |
jhat.1 \ |
344 |
jinfo.1 \ |
|
345 |
jmap.1 \ |
|
346 |
jps.1 \ |
|
347 |
jrunscript.1 \ |
|
348 |
jsadebugd.1 \ |
|
349 |
jstack.1 \ |
|
350 |
jstat.1 \ |
|
351 |
jstatd.1 \ |
|
352 |
native2ascii.1 \ |
|
353 |
rmic.1 \ |
|
354 |
schemagen.1 \ |
|
355 |
serialver.1 \ |
|
356 |
wsgen.1 \ |
|
357 |
wsimport.1 \ |
|
358 |
xjc.1 |
|
12892 | 359 |
|
20547 | 360 |
# This variable is potentially overridden in the closed makefile. |
361 |
MAN_SRC_BASEDIR ?= $(JDK_TOPDIR)/src |
|
17049
a7caf0d4cb98
8013552: Add build support for different man pages for OpenJDK and OracleJDK
erikj
parents:
16511
diff
changeset
|
362 |
|
20547 | 363 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
23602 | 364 |
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/linux/doc |
365 |
MAN1_SUBDIR = man |
|
20547 | 366 |
endif |
367 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
23602 | 368 |
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/solaris/doc |
369 |
MAN1_SUBDIR = sun/man/man1 |
|
20547 | 370 |
endif |
371 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
23602 | 372 |
MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/bsd/doc |
373 |
MAN1_SUBDIR = man |
|
20547 | 374 |
endif |
13164 | 375 |
|
20547 | 376 |
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% |
14231 | 377 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 378 |
$(install-file) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
379 |
|
20547 | 380 |
$(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% |
14231 | 381 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 382 |
$(install-file) |
383 |
||
20547 | 384 |
$(JRE_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/% |
14231 | 385 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 386 |
$(install-file) |
387 |
||
20547 | 388 |
$(JDK_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/% |
14231 | 389 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 390 |
$(install-file) |
391 |
||
20547 | 392 |
define install-ja-manpage |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
393 |
$(MKDIR) -p $(@D) |
12892 | 394 |
$(CAT) $< \ |
20547 | 395 |
| $(NATIVE2ASCII) -encoding eucJP \ |
396 |
| $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \ |
|
397 |
| $(NATIVE2ASCII) -reverse -encoding $1 \ |
|
398 |
> $@ |
|
399 |
endef |
|
12892 | 400 |
|
20547 | 401 |
$(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
14231 | 402 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
20547 | 403 |
$(call install-ja-manpage, UTF-8) |
12892 | 404 |
|
20547 | 405 |
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
14231 | 406 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
20547 | 407 |
$(call install-ja-manpage, UTF-8) |
12892 | 408 |
|
20547 | 409 |
$(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
14231 | 410 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
20547 | 411 |
$(call install-ja-manpage, PCK) |
12892 | 412 |
|
20547 | 413 |
$(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
14231 | 414 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
20547 | 415 |
$(call install-ja-manpage, PCK) |
12892 | 416 |
|
20547 | 417 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
418 |
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
|
419 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
420 |
$(install-file) |
|
12892 | 421 |
|
20547 | 422 |
$(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% |
423 |
$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
424 |
$(install-file) |
|
425 |
endif |
|
12892 | 426 |
|
20547 | 427 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
428 |
$(JRE_IMAGE_DIR)/man/ja: |
|
429 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
430 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
13164 | 431 |
|
20547 | 432 |
$(JDK_IMAGE_DIR)/man/ja: |
433 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
434 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
435 |
endif |
|
13164 | 436 |
|
20547 | 437 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
438 |
$(JRE_IMAGE_DIR)/man/ja: |
|
439 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
440 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
12892 | 441 |
|
20547 | 442 |
$(JDK_IMAGE_DIR)/man/ja: |
443 |
$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
|
444 |
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja |
|
445 |
endif |
|
12892 | 446 |
|
20547 | 447 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
23602 | 448 |
JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \ |
20547 | 449 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \ |
450 |
$(JRE_IMAGE_DIR)/man/ja |
|
12892 | 451 |
|
23602 | 452 |
JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \ |
20547 | 453 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \ |
23601
d15e005afb07
8031300: No jdeps.1 and jjs.1 man pages in jdk8 b122 build and jvisualvm.1 and jcmd.1 missing on macosx
erikj
parents:
23600
diff
changeset
|
454 |
$(JDK_IMAGE_DIR)/man/ja |
20547 | 455 |
endif |
12892 | 456 |
|
20547 | 457 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
23602 | 458 |
JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \ |
20547 | 459 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/, $(JRE_MAN_PAGES)) \ |
460 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \ |
|
461 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JRE_MAN_PAGES)) |
|
12892 | 462 |
|
23602 | 463 |
JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \ |
20547 | 464 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/, $(JDK_MAN_PAGES)) \ |
465 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \ |
|
466 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JDK_MAN_PAGES)) |
|
467 |
endif |
|
12892 | 468 |
|
20547 | 469 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
23602 | 470 |
JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \ |
20547 | 471 |
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \ |
472 |
$(JRE_IMAGE_DIR)/man/ja |
|
13164 | 473 |
|
23602 | 474 |
JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \ |
20547 | 475 |
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \ |
476 |
$(JDK_IMAGE_DIR)/man/ja |
|
477 |
endif |
|
14231 | 478 |
|
479 |
endif # Windows |
|
13164 | 480 |
|
12892 | 481 |
################################################################################ |
482 |
# /demo dir |
|
483 |
||
13702 | 484 |
# FIXME: demo/applets/GraphLayout/GraphPanel$2.class is sometimes not copied. |
12892 | 485 |
|
20547 | 486 |
# The db demo contains an empty dir that needs to be copied. The other |
487 |
# directories will always trigger the rule for recompile since |
|
488 |
# _the.list_of_packages files are touched. |
|
14231 | 489 |
$(JDK_IMAGE_DIR)/demo/%: $(JDK_OUTPUTDIR)/demo/% |
12892 | 490 |
if [ ! -d "$@" ]; then \ |
14231 | 491 |
$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \ |
12892 | 492 |
$(MKDIR) -p $(@D); \ |
493 |
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \ |
|
494 |
fi |
|
495 |
||
20547 | 496 |
# Find all files including directories |
497 |
JDK_DEMO_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/demo/%, $(JDK_IMAGE_DIR)/demo/%, \ |
|
498 |
$(shell $(FIND) $(JDK_OUTPUTDIR)/demo ! \( -name "_the*" -o -name "javac_state" \) )) |
|
13702 | 499 |
|
500 |
||
501 |
||
14231 | 502 |
# Param 1 is source file |
503 |
define CreateOverlayDemoRule |
|
20547 | 504 |
$1_TARGET := $$(subst $(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR), \ |
505 |
$$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1)) |
|
506 |
$$($1_TARGET): $1 |
|
507 |
$(ECHO) $(LOG_INFO) Copying '$$(patsubst $(OUTPUT_ROOT)/%,%,$$@)' |
|
508 |
$$(call install-file) |
|
13702 | 509 |
|
20547 | 510 |
JDK_OVERLAY_DEMO_TARGETS += $$($1_TARGET) |
14231 | 511 |
endef |
20547 | 512 |
JDK_OVERLAY_DEMO_SOURCES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(JDK_OUTPUTDIR)/demo)) |
513 |
$(foreach lib, $(JDK_OVERLAY_DEMO_SOURCES), $(eval $(call CreateOverlayDemoRule, $(lib)))) |
|
12892 | 514 |
|
515 |
################################################################################ |
|
516 |
# /sample dir |
|
517 |
||
20547 | 518 |
$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/sample), \ |
14231 | 519 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_SAMPLE_TARGETS))) |
12892 | 520 |
|
521 |
################################################################################ |
|
522 |
# /db dir |
|
523 |
||
524 |
ifndef OPENJDK |
|
25859 | 525 |
DB_ZIP_DIR := $(wildcard $(JDK_TOPDIR)/src/closed/db) |
526 |
||
527 |
$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(DB_ZIP_DIR)/% |
|
12892 | 528 |
$(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<) |
25859 | 529 |
$(RM) -r $(JDK_IMAGE_DIR)/db |
12892 | 530 |
$(MKDIR) -p $(JDK_IMAGE_DIR)/db |
17428 | 531 |
cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -q -o $< -x */index.html */KEYS */test/* *javadoc/* */docs/* */demo/* 2> /dev/null |
532 |
cd $(JDK_IMAGE_DIR)/db && $(MV) db-derby-*-bin/* . && $(RM) -r db-derby-*-bin |
|
12892 | 533 |
$(MKDIR) -p $(@D) |
534 |
$(TOUCH) $@ |
|
535 |
||
25859 | 536 |
$(JDK_IMAGE_DIR)/db/README-JDK.html: $(DB_ZIP_DIR)/README-JDK.html |
14231 | 537 |
$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' |
20544 | 538 |
$(MKDIR) -p $(@D) |
25859 | 539 |
$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@ |
17428 | 540 |
|
25859 | 541 |
$(JDK_IMAGE_DIR)/db/3RDPARTY: $(DB_ZIP_DIR)/3RDPARTY |
17428 | 542 |
$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)' |
20544 | 543 |
$(MKDIR) -p $(@D) |
25859 | 544 |
$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@ |
12892 | 545 |
|
25859 | 546 |
JDK_DB_TARGETS := $(patsubst $(DB_ZIP_DIR)/%, $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped, \ |
547 |
$(wildcard $(DB_ZIP_DIR)/*.zip)) \ |
|
20547 | 548 |
$(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/3RDPARTY |
12892 | 549 |
|
550 |
endif |
|
551 |
||
552 |
################################################################################ |
|
553 |
# /include dir |
|
554 |
||
20547 | 555 |
$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/include), \ |
14231 | 556 |
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_INCLUDE_TARGETS))) |
12892 | 557 |
|
558 |
################################################################################ |
|
559 |
# doc files |
|
560 |
||
561 |
ifdef OPENJDK |
|
20547 | 562 |
JRE_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README |
563 |
JDK_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README |
|
564 |
JRE_DOC_LOCATION := $(JDK_TOPDIR) |
|
565 |
JDK_DOC_LOCATION := $(JDK_TOPDIR) |
|
12892 | 566 |
else |
20547 | 567 |
JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt |
568 |
JDK_DOC_FILES := COPYRIGHT README.html LICENSE THIRDPARTYLICENSEREADME.txt |
|
569 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
570 |
JRE_DOC_FILES += README.txt |
|
571 |
else |
|
572 |
JRE_DOC_FILES += README |
|
573 |
endif |
|
574 |
JDK_DOC_FILES += demo/DEMOS_LICENSE sample/SAMPLES_LICENSE |
|
25859 | 575 |
JRE_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/doc/jre |
576 |
JDK_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/doc/jdk |
|
12892 | 577 |
endif |
20547 | 578 |
JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/, $(JRE_DOC_FILES)) |
579 |
JDKJRE_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/jre/, $(JRE_DOC_FILES)) |
|
580 |
JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/, $(JDK_DOC_FILES)) |
|
12892 | 581 |
|
582 |
$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/% |
|
13702 | 583 |
$(process-doc-file) |
12892 | 584 |
|
585 |
$(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/% |
|
13702 | 586 |
$(process-doc-file) |
12892 | 587 |
|
588 |
$(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README |
|
13702 | 589 |
$(process-doc-file) |
12892 | 590 |
|
591 |
$(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README |
|
13702 | 592 |
$(process-doc-file) |
12892 | 593 |
|
594 |
$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/% |
|
13702 | 595 |
$(process-doc-file) |
12892 | 596 |
|
597 |
$(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/% |
|
13702 | 598 |
$(process-doc-file) |
12892 | 599 |
|
600 |
$(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/% |
|
13702 | 601 |
$(process-doc-file) |
12892 | 602 |
|
603 |
JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release |
|
604 |
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release |
|
605 |
||
13702 | 606 |
JRE_OVERLAY_INFO_FILE := $(JRE_OVERLAY_IMAGE_DIR)/release |
607 |
JDK_OVERLAY_INFO_FILE := $(JDK_OVERLAY_IMAGE_DIR)/release |
|
608 |
||
12892 | 609 |
# Common way to emit a line into the release or info file |
610 |
define info-file-item # name value |
|
20547 | 611 |
$(PRINTF) '%s="%s"\n' $1 $2 >> $@ |
12892 | 612 |
endef |
613 |
||
13702 | 614 |
define create-info-file |
615 |
$(MKDIR) -p $(@D) |
|
616 |
$(RM) $@ |
|
617 |
$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)") |
|
20547 | 618 |
$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)") |
619 |
$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)") |
|
620 |
$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)") |
|
16041
b9d38accf302
8005545: Add System property to identify ARCH specific details such as ARM hard-float binaries
vladidan
parents:
15693
diff
changeset
|
621 |
if [ -n "$(JDK_ARCH_ABI_PROP_NAME)" ]; then $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"); fi |
20547 | 622 |
$(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)") |
13702 | 623 |
endef |
624 |
||
12892 | 625 |
ALL_SOURCE_TIPS = $(shell \ |
20547 | 626 |
if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \ |
627 |
$(CAT) $(OUTPUT_ROOT)/source_tips ; \ |
|
628 |
fi) |
|
12892 | 629 |
|
630 |
$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
14231 | 631 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 632 |
$(call create-info-file) |
20547 | 633 |
ifneq ($(PROFILE), ) |
634 |
$(call info-file-item, "JAVA_PROFILE", "$(call profile_name, $(call profile_number, $(PROFILE)))") |
|
635 |
endif |
|
12892 | 636 |
|
637 |
$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
14231 | 638 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 639 |
$(call create-info-file) |
640 |
||
641 |
$(JRE_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
14231 | 642 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 643 |
$(call create-info-file) |
644 |
||
645 |
$(JDK_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips |
|
14231 | 646 |
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
13702 | 647 |
$(call create-info-file) |
12892 | 648 |
|
649 |
$(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip |
|
14231 | 650 |
$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) |
12892 | 651 |
$(install-file) |
652 |
||
653 |
################################################################################ |
|
654 |
# Post processing (strip etc) |
|
655 |
||
20547 | 656 |
ifneq ($(POST_STRIP_CMD), ) |
657 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
658 |
EXEC_LIST_BIN := $(filter-out %$(notdir $(MSVCR_DLL)), $(filter %.exe %.dll, $(ALL_BIN_LIST))) |
|
659 |
else |
|
660 |
# Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed |
|
661 |
EXEC_LIST_BIN := $(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX) ! -name \*.debuginfo` \ |
|
662 |
| $(EGREP) 'ELF' | $(CUT) -d':' -f1) |
|
663 |
# On mac, the old build searches for static libraries for stripping instead of shared. |
|
664 |
# Not clear if it's intentional. |
|
665 |
ifneq ($(OPENJDK_TARGET_OS), macosx) |
|
666 |
EXEC_LIST_LIB := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX)) |
|
12892 | 667 |
endif |
20547 | 668 |
endif |
669 |
# Filter out sjavac |
|
670 |
EXEC_LIST_BIN := $(filter-out %sjavac$(EXE_SUFFIX), $(EXEC_LIST_BIN)) |
|
13702 | 671 |
|
20547 | 672 |
# Filter out the overlay specific bin files |
673 |
EXEC_LIST := $(filter-out $(OVERLAY_FILTER), $(EXEC_LIST_BIN)) $(EXEC_LIST_LIB) |
|
674 |
EXEC_LIST_OVERLAY := $(filter $(OVERLAY_FILTER), $(EXEC_LIST_BIN)) $(EXEC_LIST_LIB) |
|
13702 | 675 |
|
20547 | 676 |
# Filter out non JRE files and convert to unique touch files to depend on |
677 |
JRE_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, $(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped, \ |
|
678 |
$(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \ |
|
679 |
$(EXEC_LIST))) |
|
13164 | 680 |
|
20547 | 681 |
JDKJRE_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \ |
682 |
$(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \ |
|
683 |
$(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST))) |
|
12892 | 684 |
|
20547 | 685 |
JDK_BIN_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \ |
686 |
$(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \ |
|
687 |
$(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST))) |
|
13164 | 688 |
|
20547 | 689 |
# Do the same for overlay image |
690 |
JRE_OVERLAY_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, $(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped, \ |
|
691 |
$(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \ |
|
692 |
$(EXEC_LIST_OVERLAY))) |
|
13702 | 693 |
|
20547 | 694 |
JDKJRE_OVERLAY_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \ |
695 |
$(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/jre/%.stripped, \ |
|
696 |
$(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST_OVERLAY))) |
|
13702 | 697 |
|
20547 | 698 |
JDK_OVERLAY_BIN_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \ |
699 |
$(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped, \ |
|
700 |
$(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST_OVERLAY))) |
|
13702 | 701 |
|
20547 | 702 |
define mcs-file |
703 |
$(if $(POST_MCS_CMD), $(POST_MCS_CMD) $<) |
|
704 |
endef |
|
13702 | 705 |
|
20547 | 706 |
define strip-file |
14231 | 707 |
$(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<) |
13702 | 708 |
$(CHMOD) u+w $< |
709 |
$(POST_STRIP_CMD) $< |
|
710 |
$(call mcs-file) |
|
711 |
$(CHMOD) go-w $< |
|
712 |
$(MKDIR) -p $(@D) |
|
713 |
$(TOUCH) $@ |
|
20547 | 714 |
endef |
13702 | 715 |
|
20547 | 716 |
# Setup a rule for stripping files based on touch files |
717 |
$(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped: $(JRE_IMAGE_DIR)/% |
|
13702 | 718 |
$(call strip-file) |
719 |
||
20547 | 720 |
$(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/% |
13702 | 721 |
$(call strip-file) |
13164 | 722 |
|
20547 | 723 |
$(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped: $(JRE_OVERLAY_IMAGE_DIR)/% |
13702 | 724 |
$(call strip-file) |
13164 | 725 |
|
20547 | 726 |
$(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped: $(JDK_OVERLAY_IMAGE_DIR)/% |
13702 | 727 |
$(call strip-file) |
13164 | 728 |
|
12892 | 729 |
endif |
730 |
||
731 |
################################################################################ |
|
23602 | 732 |
|
733 |
# Include the custom makefile right here, after all variables have been defined |
|
734 |
# so that they may be overridden, but before the main targets are declared, so |
|
735 |
# that overriding has an effect. |
|
736 |
$(eval $(call IncludeCustomExtension, jdk, Images.gmk)) |
|
737 |
||
738 |
################################################################################ |
|
12892 | 739 |
# Main targets |
740 |
||
741 |
jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \ |
|
20547 | 742 |
$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \ |
743 |
$(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST) \ |
|
744 |
$(JRE_BIN_ISADIR_LINK_TARGETS) |
|
12892 | 745 |
|
746 |
jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \ |
|
20547 | 747 |
$(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \ |
748 |
$(JDK_IMAGE_DIR)/jre/lib/applet \ |
|
749 |
$(JDK_DEMO_TARGETS) \ |
|
750 |
$(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \ |
|
751 |
$(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \ |
|
752 |
$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \ |
|
753 |
$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \ |
|
754 |
$(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \ |
|
755 |
$(JDK_IMAGE_DIR)/src.zip \ |
|
756 |
$(JDK_BIN_ISADIR_LINK_TARGETS) $(JDKJRE_BIN_ISADIR_LINK_TARGETS) |
|
12892 | 757 |
|
13702 | 758 |
jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \ |
20547 | 759 |
$(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST) |
13702 | 760 |
|
761 |
jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \ |
|
20547 | 762 |
$(JDK_OVERLAY_LIB_TARGETS) $(JDKJRE_OVERLAY_LIB_TARGETS) \ |
763 |
$(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \ |
|
764 |
$(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST) |
|
13702 | 765 |
|
20547 | 766 |
ifneq ($(PROFILE), ) |
767 |
PROFILE_IMAGE_JARS := $(filter %.jar, $(JRE_LIB_TARGETS)) |
|
15693
ba31a578f948
8007097: (profiles) Build needs test to ensure that profile definitions are updated
alanb
parents:
15681
diff
changeset
|
768 |
|
20547 | 769 |
PROFILE_IMAGE_JARS_CHECKED := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_jars_checked |
15693
ba31a578f948
8007097: (profiles) Build needs test to ensure that profile definitions are updated
alanb
parents:
15681
diff
changeset
|
770 |
|
20547 | 771 |
$(PROFILE_IMAGE_JARS_CHECKED) : $(PROFILE_IMAGE_JARS) |
15693
ba31a578f948
8007097: (profiles) Build needs test to ensure that profile definitions are updated
alanb
parents:
15681
diff
changeset
|
772 |
$(TOOL_CHECKDEPS) $(JRE_IMAGE_DIR) \ |
ba31a578f948
8007097: (profiles) Build needs test to ensure that profile definitions are updated
alanb
parents:
15681
diff
changeset
|
773 |
$(call profile_name, $(call profile_number, $(PROFILE))) |
ba31a578f948
8007097: (profiles) Build needs test to ensure that profile definitions are updated
alanb
parents:
15681
diff
changeset
|
774 |
$(TOUCH) $@ |
ba31a578f948
8007097: (profiles) Build needs test to ensure that profile definitions are updated
alanb
parents:
15681
diff
changeset
|
775 |
|
20547 | 776 |
profile-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) \ |
15681 | 777 |
$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \ |
15693
ba31a578f948
8007097: (profiles) Build needs test to ensure that profile definitions are updated
alanb
parents:
15681
diff
changeset
|
778 |
$(JRE_INFO_FILE) $(JRE_STRIP_LIST) $(PROFILE_IMAGE_JARS_CHECKED) |
15681 | 779 |
|
20547 | 780 |
.PHONY: profile-image |
15681 | 781 |
|
782 |
endif # Profile |
|
783 |
||
12892 | 784 |
################################################################################ |
785 |
||
786 |
.PHONY: default images jre-image jdk-image |