Images.gmk 29.8 KB
Newer Older
1
#
2
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include Setup.gmk

31
default: images
32

33 34 35 36 37 38 39 40 41
# Prepare the find cache. Only used if running on windows.
$(eval $(call FillCacheFind,\
    $(wildcard $(JDK_OUTPUTDIR)/bin \
               $(JDK_OUTPUTDIR)/lib \
               $(IMAGES_OUTPUTDIR)/lib \
               $(JDK_OUTPUTDIR)/include \
               $(JDK_OUTPUTDIR)/sample \
               $(JDK_OUTPUTDIR)/demo)))

42 43
include Tools.gmk

44 45
include Profiles.gmk

46 47 48 49 50 51 52
# Note: This double-colon rule is intentional, to support
# custom make file integration.
images:: jre-image jdk-image

overlay-images: jre-overlay-image jdk-overlay-image


53

54 55 56
# Processing license files from source area to image area
# These will be modified to have the platform specific EOL chars.
define process-doc-file
O
ohair 已提交
57
	$(ECHO) $(LOG_INFO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@)
58 59
	$(MKDIR) -p $(@D)
	$(RM) $@
60
	LC_ALL=C $(SED) 's/$$//g' $< > $@
61 62 63
	$(CHMOD) 444 $@
endef

O
ohair 已提交
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
define AddFileToCopy
  # Param 1 - src root dir
  # Param 2 - dest root dir
  # Param 3 - src file
  # Param 4 - variable to add targets to

  # Remove src dir root from src file
  $2_$3_FILE := $$(patsubst $1/%,%,$3)

  $2/$$($2_$3_FILE): $3
	$(ECHO) $(LOG_INFO) Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
	$$(install-file)

  $4 += $2/$$($2_$3_FILE)
endef
79

80 81 82 83 84
################################################################################
#
# JRE and JDK build rules
#
################################################################################
85 86
#
# Variable prefixes explained:
87
# JRE_ refers to files in the j2re-*-image.
88 89 90
# JDK_ refers to files in the j2sdk-image outside of the jre subdir.
# JDKJRE_ refers to files in the j2sdk-image inside the jre subdir.
#
91 92 93 94

################################################################################
# /bin dir

95 96
ifeq ($(PROFILE),)
    NOT_JRE_BIN_FILES := \
97 98 99 100 101 102 103 104 105 106
	appletviewer$(EXE_SUFFIX) \
	extcheck$(EXE_SUFFIX) \
	idlj$(EXE_SUFFIX) \
	jar$(EXE_SUFFIX) \
	jarsigner$(EXE_SUFFIX) \
	java-rmi.cgi \
	javac$(EXE_SUFFIX) \
	javadoc$(EXE_SUFFIX) \
	javah$(EXE_SUFFIX) \
	javap$(EXE_SUFFIX) \
107
	jdeps$(EXE_SUFFIX) \
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
	jcmd$(EXE_SUFFIX) \
	jdb$(EXE_SUFFIX) \
	jps$(EXE_SUFFIX) \
	jrunscript$(EXE_SUFFIX) \
	jstat$(EXE_SUFFIX) \
	jstatd$(EXE_SUFFIX) \
	jstack$(EXE_SUFFIX) \
	packagebean$(SCRIPT_SUFFIX) \
	rmic$(EXE_SUFFIX) \
	serialver$(EXE_SUFFIX) \
	unregbean$(EXE_SUFFIX) \
	jconsole$(EXE_SUFFIX) \
	jinfo$(EXE_SUFFIX) \
	jmap$(EXE_SUFFIX) \
	native2ascii$(EXE_SUFFIX) \
	xjc$(EXE_SUFFIX) \
	wsgen$(EXE_SUFFIX) \
	wsimport$(EXE_SUFFIX) \
        schemagen$(EXE_SUFFIX) \
	jsadebugd$(EXE_SUFFIX) \
	jhat$(EXE_SUFFIX)
129
endif
130 131 132

WINDOWS_JDK_BIN_FILES = \
	$(EXE_SUFFIX) \
133
	$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
O
ohair 已提交
134
	$(notdir $(MSVCR_DLL))
135 136 137 138

WINDOWS_JDKJRE_BIN_FILES := \
	$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
	$(SALIB_NAME)
139 140

# Find all files in bin dir
141
ALL_BIN_LIST := $(call CacheFind,$(JDK_OUTPUTDIR)/bin)
142

O
ohair 已提交
143 144 145
# Prevent sjavac from entering the images.
ALL_BIN_LIST := $(filter-out %/sjavac,$(ALL_BIN_LIST))

146
# For unknown reason the debuginfo files for executables are not put into images
147
# e.g filter them out
148 149 150 151 152
ifneq ($(OPENJDK_TARGET_OS),windows)
    ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST))
else
# On windows, the libraries are in the bin dir, only filter out debuginfo files
# for executables. "java" is both a library and executable.
153
    ALL_BIN_EXEC_FILES := $(filter-out java.exe,$(notdir $(filter %.exe,$(ALL_BIN_LIST))))
154 155 156 157
    ALL_BIN_DEBUG_FILTER := $(addprefix %,$(patsubst %.exe,%.debuginfo,$(ALL_BIN_EXEC_FILES)) \
					   $(patsubst %.exe,%.diz,$(ALL_BIN_EXEC_FILES))) %.pdb
    ALL_BIN_LIST := $(filter-out $(ALL_BIN_DEBUG_FILTER),$(ALL_BIN_LIST))
endif
158

O
ohair 已提交
159 160 161
JDKJRE_BIN_LIST := $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES)), $(ALL_BIN_LIST))
JRE_BIN_LIST := $(filter-out $(addprefix %,$(WINDOWS_JDKJRE_BIN_FILES)), $(JDKJRE_BIN_LIST))

162
ifeq ($(OPENJDK_TARGET_OS),windows)
163
    JDK_BIN_LIST := $(filter $(addprefix %,$(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
O
ohair 已提交
164 165 166 167 168 169 170
    # On windows x86, the server jvm is filtered out from the j2re image. This could possibly 
    # be handled by profiles in the future. If no client jvm is built, leave server in.
    ifeq ($(OPENJDK_TARGET_CPU),x86)
        ifeq ($(JVM_VARIANT_CLIENT),true)
            JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%,$(JRE_BIN_LIST))
	endif
    endif
171 172 173
else
    JDK_BIN_LIST := $(ALL_BIN_LIST)
endif
174 175 176 177 178

ifneq ($(OPENJDK_TARGET_CPU_ISADIR),)
    OVERLAY_FILTER := $(JDK_OUTPUTDIR)/bin$(OPENJDK_TARGET_CPU_ISADIR)%
endif

O
ohair 已提交
179 180 181 182 183 184
$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JRE_BIN_LIST)),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_BIN_TARGETS)))
$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
185

O
ohair 已提交
186 187 188 189 190 191
$(foreach f,$(filter $(OVERLAY_FILTER),$(JRE_BIN_LIST)),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_BIN_TARGETS)))
$(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
$(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
192

193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
  define AddIsadirLink
    # Param 1 - src file
    # Param 2 - variable to add targets to

    $1_LINK := $$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1)

    $$($1_LINK):
	$(ECHO) $(LOG_INFO) Creating link $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
	$(MKDIR) -p $$(@D)
	$(LN) -s ../$$(@F) $$@

    $2 += $$($1_LINK)
  endef

  $(foreach f,$(JRE_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JRE_BIN_ISADIR_LINK_TARGETS)))
  $(foreach f,$(JDK_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JDK_BIN_ISADIR_LINK_TARGETS)))
  $(foreach f,$(JDKJRE_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JDKJRE_BIN_ISADIR_LINK_TARGETS)))
endif

213 214
################################################################################
# /lib dir
215 216 217
ifneq ($(OPENJDK_TARGET_OS), macosx)
    JDKJRE_LIB_FILES := \
	$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
218
	$(SALIB_NAME)
219
endif
220

221 222
ifeq ($(PROFILE),)
    NOT_JRE_LIB_FILES := \
223 224 225 226 227 228 229 230
	tools.jar \
	jconsole.jar \
	sa-jdi.jar \
	dt.jar \
	orb.idl \
	ir.idl \
	ct.sym

231 232 233
    ifeq ($(OPENJDK_TARGET_OS), windows)
      NOT_JRE_LIB_FILES += jawt.lib jvm.lib
    endif
234 235
endif

236
JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
237
ifeq ($(OPENJDK_TARGET_OS), linux)
238 239 240
    JDK_LIB_FILES += jexec
endif

O
ohair 已提交
241
# Find all files to copy from $(JDK_OUTPUTDIR)/lib
242
# Jar files are not expected to be here
243 244
ALL_JDKOUT_LIB_LIST := $(call not-containing,_the.,$(filter-out %.jar,\
                            $(call CacheFind,$(JDK_OUTPUTDIR)/lib)))
O
ohair 已提交
245
# Find all files to copy from $(IMAGES_OUTPUTDIR)/lib
246
# This is were the jar files are and might not exist if building overlay-images
O
ohair 已提交
247
ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib),)
248 249
    ALL_IMAGES_LIB_LIST := $(call not-containing,_the.,\
                            $(call CacheFind,$(IMAGES_OUTPUTDIR)/lib))
O
ohair 已提交
250
endif
251

O
ohair 已提交
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
# Filter files to copy for each destination
JRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
                       $(ALL_JDKOUT_LIB_LIST))
JDKJRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_JDKOUT_LIB_LIST))
JDK_JDKOUT_LIB_LIST := $(filter $(addprefix %,$(JDK_LIB_FILES)),$(ALL_JDKOUT_LIB_LIST))

JRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
                       $(ALL_IMAGES_LIB_LIST))
JDKJRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_IMAGES_LIB_LIST))
JDK_IMAGES_LIB_LIST := $(filter $(addprefix %,$(JDK_LIB_FILES)),$(ALL_IMAGES_LIB_LIST))

# Iterate over files to copy to create rules for each one
$(foreach f,$(JRE_JDKOUT_LIB_LIST),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS)))
$(foreach f,$(JDK_JDKOUT_LIB_LIST),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS)))
$(foreach f,$(JDKJRE_JDKOUT_LIB_LIST),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS)))

$(foreach f,$(JRE_IMAGES_LIB_LIST),\
    $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS)))
$(foreach f,$(JDK_IMAGES_LIB_LIST),\
    $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS)))
$(foreach f,$(JDKJRE_IMAGES_LIB_LIST),\
    $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS)))

$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JRE_JDKOUT_LIB_LIST)),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_OVERLAY_LIB_TARGETS)))
$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDK_JDKOUT_LIB_LIST)),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_OVERLAY_LIB_TARGETS)))
$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDKJRE_JDKOUT_LIB_LIST)),\
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_OVERLAY_LIB_TARGETS)))
284

285 286 287 288 289 290 291
ifneq ($(PROFILE),)
# Files in lib$(PROFILE) are excluded from the generic copying routines so 
# we have to add them back in here
$(foreach f,$(CUSTOM_PROFILE_JARS),\
    $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR)/lib$(PROFILE),$(JRE_IMAGE_DIR)/lib,$f,JRE_LIB_TARGETS)))
endif

292 293
# CTE plugin security change require new empty directory lib/applet
$(JRE_IMAGE_DIR)/lib/applet: 
O
ohair 已提交
294
	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
295 296 297
	$(MKDIR) -p $@

$(JDK_IMAGE_DIR)/jre/lib/applet: 
O
ohair 已提交
298
	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
299 300
	$(MKDIR) -p $@

301
# In the old build, JObjC.jar is not part of the meta-index
302
$(JRE_IMAGE_DIR)/lib/meta-index: $(JRE_LIB_TARGETS)
O
ohair 已提交
303
	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
304
	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index `$(LS) *.jar | $(SED) 's/JObjC\.jar//g'`
305 306

$(JDK_IMAGE_DIR)/jre/lib/meta-index: $(JDKJRE_LIB_TARGETS)
O
ohair 已提交
307
	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
308
	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index `$(LS) *.jar | $(SED) 's/JObjC\.jar//g'`
309 310

$(JRE_IMAGE_DIR)/lib/ext/meta-index: $(JRE_LIB_TARGETS)
O
ohair 已提交
311
	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
312 313
	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar

314
$(JDK_IMAGE_DIR)/jre/lib/ext/meta-index: $(JDKJRE_LIB_TARGETS)
O
ohair 已提交
315
	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
316 317 318 319
	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar

################################################################################
# /man dir
O
ohair 已提交
320 321 322
# Avoid evaluating this whole section on windows for speed and stability
ifneq ($(OPENJDK_TARGET_OS),windows)
    JRE_MAN_PAGES := \
323 324 325 326 327 328 329 330 331 332 333
	java.1		\
	keytool.1	\
	orbd.1          \
	pack200.1	\
	policytool.1    \
	rmid.1		\
	rmiregistry.1	\
	servertool.1    \
	tnameserv.1     \
	unpack200.1

O
ohair 已提交
334 335 336
    ifndef OPENJDK
        JRE_MAN_PAGES += javaws.1
    endif
337

O
ohair 已提交
338
    JDK_MAN_PAGES =        \
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
	$(JRE_MAN_PAGES)   \
	appletviewer.1     \
	extcheck.1         \
	idlj.1             \
	jar.1              \
	jarsigner.1        \
	javac.1            \
	javadoc.1          \
	javah.1            \
	javap.1            \
	jconsole.1         \
	jcmd.1             \
	jdb.1              \
	jhat.1             \
        jinfo.1            \
        jmap.1             \
        jps.1              \
	jrunscript.1       \
        jsadebugd.1        \
        jstack.1           \
        jstat.1            \
        jstatd.1           \
	native2ascii.1     \
	rmic.1             \
        schemagen.1        \
	serialver.1        \
        wsgen.1            \
        wsimport.1         \
        xjc.1

O
ohair 已提交
369 370 371
    ifndef OPENJDK
        JDK_MAN_PAGES += jvisualvm.1
    endif
372

373 374
    # This variable is potentially overridden in the closed makefile.
    MAN_SRC_BASEDIR ?= $(JDK_TOPDIR)/src
375

O
ohair 已提交
376
    ifeq ($(OPENJDK_TARGET_OS), linux)
377
        MAN_SRC_DIR:=$(MAN_SRC_BASEDIR)/linux/doc
O
ohair 已提交
378 379 380
        MAN1_SUBDIR:=man
    endif
    ifeq ($(OPENJDK_TARGET_OS), solaris)
381
        MAN_SRC_DIR:=$(MAN_SRC_BASEDIR)/solaris/doc
O
ohair 已提交
382 383 384
        MAN1_SUBDIR:=sun/man/man1
    endif
    ifeq ($(OPENJDK_TARGET_OS), macosx)
385
        MAN_SRC_DIR:=$(MAN_SRC_BASEDIR)/bsd/doc
O
ohair 已提交
386 387 388 389
        MAN1_SUBDIR:=man
        JDK_MAN_PAGES := $(filter-out jcmd.1, $(JDK_MAN_PAGES))
        JDK_MAN_PAGES := $(filter-out jvisualvm.1, $(JDK_MAN_PAGES))
    endif
390

391

O
ohair 已提交
392 393
    $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
394 395
	$(install-file)

O
ohair 已提交
396 397
    $(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
398 399
	$(install-file)

O
ohair 已提交
400 401
    $(JRE_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
402 403
	$(install-file)

O
ohair 已提交
404 405
    $(JDK_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
406 407
	$(install-file)

O
ohair 已提交
408
    define install-ja-manpage
409 410 411 412 413 414
	$(MKDIR) -p $(@D)
	$(CAT) $< \
		| $(NATIVE2ASCII) -encoding eucJP \
		| $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \
		| $(NATIVE2ASCII) -reverse -encoding $1 \
		> $@
O
ohair 已提交
415
    endef
416

O
ohair 已提交
417 418
    $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
419 420
	$(call install-ja-manpage,UTF-8)

O
ohair 已提交
421 422
    $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
423 424
	$(call install-ja-manpage,UTF-8)

O
ohair 已提交
425 426
    $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
427 428
	$(call install-ja-manpage,PCK)

O
ohair 已提交
429 430
    $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
431 432
	$(call install-ja-manpage,PCK)

O
ohair 已提交
433 434 435 436
    ifeq ($(OPENJDK_TARGET_OS), solaris)
        $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
		$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
		$(install-file)
437

O
ohair 已提交
438 439 440 441
        $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
		$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
		$(install-file)
    endif
442

O
ohair 已提交
443 444 445
    # Old build creates empty man page for this, mimicing behaviour.
    $(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:
	$(ECHO) $(LOG_INFO) Creating dummy $(patsubst $(OUTPUT_ROOT)/%,%,$@)
446 447 448
	$(MKDIR) -p $(@D)
	$(TOUCH) $@

O
ohair 已提交
449 450 451 452
    ifeq ($(OPENJDK_TARGET_OS), linux)
        $(JRE_IMAGE_DIR)/man/ja:
		$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
		$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
453

O
ohair 已提交
454 455 456 457
        $(JDK_IMAGE_DIR)/man/ja:
		$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
		$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
    endif
458

O
ohair 已提交
459 460 461 462
    ifeq ($(OPENJDK_TARGET_OS), macosx)
        $(JRE_IMAGE_DIR)/man/ja:
		$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
		$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
463

O
ohair 已提交
464 465 466 467
        $(JDK_IMAGE_DIR)/man/ja:
		$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
		$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
    endif
468

O
ohair 已提交
469 470 471 472
    ifeq ($(OPENJDK_TARGET_OS), linux)
        JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
                             $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
                             $(JRE_IMAGE_DIR)/man/ja
473

O
ohair 已提交
474 475 476 477
        JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
                             $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
                             $(JDK_IMAGE_DIR)/man/ja
    endif
478

O
ohair 已提交
479 480 481 482 483
    ifeq ($(OPENJDK_TARGET_OS), solaris)
        JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
                             $(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/,$(JRE_MAN_PAGES)) \
                             $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
                             $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JRE_MAN_PAGES))
484

O
ohair 已提交
485 486 487 488 489
        JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
                             $(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/,$(JDK_MAN_PAGES)) \
                             $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
                             $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JDK_MAN_PAGES))
    endif
490

O
ohair 已提交
491 492 493 494
    ifeq ($(OPENJDK_TARGET_OS), macosx)
        JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
                             $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
                             $(JRE_IMAGE_DIR)/man/ja
495

O
ohair 已提交
496 497 498 499 500 501
        JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
                             $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
                             $(JDK_IMAGE_DIR)/man/ja
    endif

endif # Windows
502

503 504 505
################################################################################
# /demo dir

506
# FIXME: demo/applets/GraphLayout/GraphPanel$2.class is sometimes not copied.
507 508 509 510

#   The db demo contains an empty dir that needs to be copied. The other 
#   directories will always trigger the rule for recompile since 
#   _the.list_of_packages files are touched.
O
ohair 已提交
511
$(JDK_IMAGE_DIR)/demo/%: $(JDK_OUTPUTDIR)/demo/%
512
	if [ ! -d "$@" ]; then \
O
ohair 已提交
513
	  $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \
514 515 516 517 518
	  $(MKDIR) -p $(@D); \
	  if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \
	fi

#   Find all files including directories
O
ohair 已提交
519
JDK_DEMO_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/demo/%,$(JDK_IMAGE_DIR)/demo/%,\
520 521 522 523
			$(shell $(FIND) $(JDK_OUTPUTDIR)/demo ! \( -name "_the*" -o -name "javac_state" \) ))



O
ohair 已提交
524 525 526
# Param 1 is source file
define CreateOverlayDemoRule
    $1_TARGET:=$$(subst $(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),\
527
			$$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1))
O
ohair 已提交
528 529 530
    $$($1_TARGET): $1
		$(ECHO) $(LOG_INFO) Copying '$$(patsubst $(OUTPUT_ROOT)/%,%,$$@)'
		$$(call install-file)
531

O
ohair 已提交
532 533
    JDK_OVERLAY_DEMO_TARGETS += $$($1_TARGET)
endef
534
JDK_OVERLAY_DEMO_SOURCES := $(filter %$(SHARED_LIBRARY_SUFFIX),$(call CacheFind,$(JDK_OUTPUTDIR)/demo))
O
ohair 已提交
535
$(foreach lib,$(JDK_OVERLAY_DEMO_SOURCES),$(eval $(call CreateOverlayDemoRule,$(lib))))
536 537 538 539

################################################################################
# /sample dir

540
$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/sample),\
O
ohair 已提交
541
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_SAMPLE_TARGETS)))
542 543 544 545 546 547 548 549

################################################################################
# /db dir

ifndef OPENJDK
    $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/%
	$(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<)
	$(MKDIR) -p $(JDK_IMAGE_DIR)/db
550 551
	cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -q -o $< -x */index.html */KEYS */test/* *javadoc/* */docs/* */demo/* 2> /dev/null
	cd $(JDK_IMAGE_DIR)/db && $(MV) db-derby-*-bin/* . && $(RM) -r db-derby-*-bin
552 553 554 555
	$(MKDIR) -p $(@D)
	$(TOUCH) $@

    $(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html
O
ohair 已提交
556
	$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
557 558 559 560 561
	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@

    $(JDK_IMAGE_DIR)/db/3RDPARTY: $(JDK_TOPDIR)/src/closed/share/db/3RDPARTY
	$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
562 563

    JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\
564 565
			$(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip)) \
		      $(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/3RDPARTY
566

567
endif
568

569 570
################################################################################
# /include dir
571

572
$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/include),\
O
ohair 已提交
573
    $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_INCLUDE_TARGETS)))
574

575 576
################################################################################
# doc files
577

578 579 580 581 582 583 584 585
ifdef OPENJDK
    JRE_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
    JDK_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
    JRE_DOC_LOCATION := $(JDK_TOPDIR)
    JDK_DOC_LOCATION := $(JDK_TOPDIR)
else
    JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
    JDK_DOC_FILES := COPYRIGHT README.html  LICENSE THIRDPARTYLICENSEREADME.txt
586
    ifeq ($(OPENJDK_TARGET_OS), windows)
587 588 589 590
        JRE_DOC_FILES += README.txt
    else
        JRE_DOC_FILES += README
    endif
O
ohair 已提交
591
    JDK_DOC_FILES += demo/DEMOS_LICENSE sample/SAMPLES_LICENSE
592 593 594 595 596 597
    JRE_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jre
    JDK_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jdk
endif
JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/,$(JRE_DOC_FILES))
JDKJRE_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/jre/,$(JRE_DOC_FILES))
JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/,$(JDK_DOC_FILES))
598

599
$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
600
	$(process-doc-file)
601 602

$(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/%
603
	$(process-doc-file)
604 605

$(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README
606
	$(process-doc-file)
607 608

$(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README
609
	$(process-doc-file)
610 611

$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
612
	$(process-doc-file)
613 614

$(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/%
615
	$(process-doc-file)
616 617

$(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/%
618
	$(process-doc-file)
619 620 621 622

JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release

623 624 625
JRE_OVERLAY_INFO_FILE := $(JRE_OVERLAY_IMAGE_DIR)/release
JDK_OVERLAY_INFO_FILE := $(JDK_OVERLAY_IMAGE_DIR)/release

626 627 628 629 630
# Common way to emit a line into the release or info file
define info-file-item # name value
$(PRINTF) '%s="%s"\n' $1 $2 >> $@
endef

631 632 633 634 635 636 637
define create-info-file
	$(MKDIR) -p $(@D)
	$(RM) $@
	$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)")
	$(call info-file-item, "OS_NAME",      "$(REQUIRED_OS_NAME)")
	$(call info-file-item, "OS_VERSION",   "$(REQUIRED_OS_VERSION)")
	$(call info-file-item, "OS_ARCH",      "$(OPENJDK_TARGET_CPU_LEGACY)")
638
	if [ -n "$(JDK_ARCH_ABI_PROP_NAME)" ]; then $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"); fi
639 640 641
	$(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
endef

642 643 644 645 646 647
ALL_SOURCE_TIPS = $(shell \
  if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \
    $(CAT) $(OUTPUT_ROOT)/source_tips ; \
  fi)

$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
O
ohair 已提交
648
	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
649
	$(call create-info-file)
650 651 652
ifneq ($(PROFILE),)
	$(call info-file-item, "JAVA_PROFILE", "$(call profile_name, $(call profile_number, $(PROFILE)))")
endif
653 654

$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
O
ohair 已提交
655
	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
656 657 658
	$(call create-info-file)

$(JRE_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
O
ohair 已提交
659
	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
660 661 662
	$(call create-info-file)

$(JDK_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
O
ohair 已提交
663
	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
664
	$(call create-info-file)
665 666

$(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip
O
ohair 已提交
667
	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
668 669 670 671 672 673
	$(install-file)

################################################################################
# Post processing (strip etc)

ifneq ($(POST_STRIP_CMD),)
674
    ifeq ($(OPENJDK_TARGET_OS), windows)
675
        EXEC_LIST_BIN:=$(filter-out %$(notdir $(MSVCR_DLL)),$(filter %.exe %.dll,$(ALL_BIN_LIST)))
676 677
    else
        # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
678
        EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX) ! -name \*.debuginfo` \
679
		| $(EGREP) 'ELF' | $(CUT) -d':' -f1)
680 681 682 683 684
        # On mac, the old build searches for static libraries for stripping instead of shared.
        # Not clear if it's intentional.
	ifneq ($(OPENJDK_TARGET_OS), macosx)
            EXEC_LIST_LIB:=$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX))
	endif
685
    endif
O
ohair 已提交
686 687
    # Filter out sjavac
    EXEC_LIST_BIN:=$(filter-out %sjavac$(EXE_SUFFIX),$(EXEC_LIST_BIN))
688 689 690 691 692

    # Filter out the overlay specific bin files
    EXEC_LIST:=$(filter-out $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
    EXEC_LIST_OVERLAY:=$(filter $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)

693
    # Filter out non JRE files and convert to unique touch files to depend on
694
    JRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped,\
695 696
			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
				 $(EXEC_LIST)))
697

698
    JDKJRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
699 700 701
                        $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \
			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))

702
    JDK_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
703 704 705
                          $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \
                          $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST)))

706 707 708 709 710 711 712 713
    # Do the same for overlay image
    JRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped,\
			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
				 $(EXEC_LIST_OVERLAY)))

    JDKJRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
                        $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/jre/%.stripped, \
			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST_OVERLAY)))
714

715 716 717 718 719 720 721 722 723
    JDK_OVERLAY_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
                          $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped, \
                          $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST_OVERLAY)))

    define mcs-file
	$(if $(POST_MCS_CMD),$(POST_MCS_CMD) $<)
    endef

    define strip-file
O
ohair 已提交
724
	$(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<)
725 726
	$(CHMOD) u+w $<
	$(POST_STRIP_CMD) $<
727
	$(call mcs-file)
728 729 730
	$(CHMOD) go-w $<
	$(MKDIR) -p $(@D)
	$(TOUCH) $@
731
    endef
732

733
    # Setup a rule for stripping files based on touch files
734
    $(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped: $(JRE_IMAGE_DIR)/%
735 736 737 738 739 740 741 742 743 744
	$(call strip-file)

    $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/%
	$(call strip-file)

    $(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped: $(JRE_OVERLAY_IMAGE_DIR)/%
	$(call strip-file)

    $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped: $(JDK_OVERLAY_IMAGE_DIR)/%
	$(call strip-file)
745

746 747 748 749 750 751 752
endif

################################################################################
# Main targets

jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \
	$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
753 754
	$(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST) \
	$(JRE_BIN_ISADIR_LINK_TARGETS)
755 756 757 758 759 760 761 762 763

jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \
	$(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \
	$(JDK_IMAGE_DIR)/jre/lib/applet \
	$(JDK_DEMO_TARGETS) \
	$(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \
	$(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \
	$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
	$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
764
	$(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \
765 766
        $(JDK_IMAGE_DIR)/src.zip \
	$(JDK_BIN_ISADIR_LINK_TARGETS) $(JDKJRE_BIN_ISADIR_LINK_TARGETS)
767

768 769 770 771 772 773 774 775
jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \
	 $(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST)

jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \
	$(JDK_OVERLAY_LIB_TARGETS) $(JDKJRE_OVERLAY_LIB_TARGETS) \
	$(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \
	$(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST) 

776
ifneq ($(PROFILE),)
777 778 779 780 781 782 783 784 785
PROFILE_IMAGE_JARS := $(filter %.jar, $(JRE_LIB_TARGETS))

PROFILE_IMAGE_JARS_CHECKED := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_jars_checked

$(PROFILE_IMAGE_JARS_CHECKED) : $(PROFILE_IMAGE_JARS)
	$(TOOL_CHECKDEPS) $(JRE_IMAGE_DIR) \
	    $(call profile_name, $(call profile_number, $(PROFILE)))
	$(TOUCH) $@

786 787
profile-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) \
	$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
788
	$(JRE_INFO_FILE) $(JRE_STRIP_LIST) $(PROFILE_IMAGE_JARS_CHECKED)
789 790 791 792 793

.PHONY: profile-image

endif # Profile

794
################################################################################
795

796
.PHONY: default images jre-image jdk-image
797 798

-include $(CUSTOM_MAKE_DIR)/Images.gmk