Images.gmk 18.0 KB
Newer Older
C
chegar 已提交
1
#
2
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
C
chegar 已提交
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
# 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.
#

default: all

include $(SPEC)
include MakeBase.gmk
30
include Modules.gmk
C
chegar 已提交
31 32

TOOL_TARGETS :=
33
JDK_TARGETS :=
C
chegar 已提交
34 35 36 37 38 39 40 41
JRE_TARGETS :=

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, , Images-pre.gmk))

############################################################################

MAIN_MODULES += java.se java.smartcardio jdk.httpserver jdk.sctp \
42
               jdk.security.auth jdk.security.jgss jdk.pack200 jdk.xml.dom \
43 44
               jdk.accessibility jdk.internal.le jdk.dynalink \
               jdk.scripting.nashorn jdk.scripting.nashorn.shell \
45
               jdk.vm.ci jdk.management jdk.jsobject
C
chegar 已提交
46 47

# providers
48 49
PROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk.jvmstat.rmi \
               jdk.localedata jdk.naming.dns jdk.naming.rmi jdk.zipfs
C
chegar 已提交
50 51

# tools
52
TOOLS_MODULES += jdk.attach jdk.compiler jdk.dev \
A
Merge  
amurillo 已提交
53
               jdk.javadoc jdk.jcmd jdk.jconsole jdk.hotspot.agent jdk.jartool \
54 55
               jdk.jdeps jdk.jdi jdk.jdwp.agent jdk.jshell jdk.policytool jdk.rmic \
               jdk.xml.bind jdk.xml.ws
C
chegar 已提交
56 57 58 59 60 61 62 63 64

ifeq ($(OPENJDK_TARGET_OS), windows)
  PROVIDER_MODULES += jdk.crypto.mscapi
endif

ifeq ($(OPENJDK_TARGET_OS), solaris)
  PROVIDER_MODULES += jdk.crypto.ucrypto
endif

65 66
JRE_MODULES := $(filter-out $(MODULES_FILTER), $(MAIN_MODULES) $(PROVIDER_MODULES))
JDK_MODULES := $(filter-out $(MODULES_FILTER), $(JRE_MODULES) $(TOOLS_MODULES))
C
chegar 已提交
67 68 69

# compact3 builds have additional modules
JDK_COMPACT3_MODULES := java.compact3 java.smartcardio jdk.httpserver jdk.naming.dns \
70
                       jdk.naming.rmi jdk.sctp jdk.security.auth jdk.management
C
chegar 已提交
71 72

# Replacing double-comma with a single comma is to workaround the issue
73
# with some version of make on windows that doesn't substitute spaces
C
chegar 已提交
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
# with one comma properly as with make 4.0
define SubstComma
  $(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1)))
endef
JRE_MODULES_LIST := $(call SubstComma, $(JRE_MODULES))
JDK_MODULES_LIST := $(call SubstComma, $(JDK_MODULES))

################################################################################

JRE_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/jre-sorted-modules
JDK_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/jdk-sorted-modules
JRE_COMPACT1_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact1-sorted-modules
JRE_COMPACT2_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact2-sorted-modules
JRE_COMPACT3_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact3-sorted-modules


MODULES_CMDS := $(SUPPORT_OUTPUTDIR)/modules_cmds-stripped
MODULES_LIBS := $(SUPPORT_OUTPUTDIR)/modules_libs-stripped
MODULES_CONF := $(SUPPORT_OUTPUTDIR)/modules_conf

JIMAGE_TOOL := $(JAVA_SMALL) \
    -Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \
    -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.module.ImageBuilder \
    --cmds $(MODULES_CMDS) \
    --libs $(MODULES_LIBS) \
    --configs $(MODULES_CONF) \
    --classes $(JDK_OUTPUTDIR)/modules \
    --endian $(OPENJDK_TARGET_CPU_ENDIAN) \
    #

MODULES_XML += $(SRC_ROOT)/modules.xml
DEPENDENCIES := $(call CacheFind, \
    $(SUPPORT_OUTPUTDIR)/modules_cmds \
E
erikj 已提交
107
    $(SUPPORT_OUTPUTDIR)/modules_conf \
C
chegar 已提交
108 109 110 111 112 113 114 115
    $(SUPPORT_OUTPUTDIR)/modules_libs) \
    $(wildcard $(JDK_OUTPUTDIR)/modules/*/_*) \
    $(MODULES_XML)
    #

# Use this file inside the image as target for make rule
JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX)

116 117
$(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
    $(call DependOnVariable, JDK_MODULES_LIST)
C
chegar 已提交
118 119 120 121 122 123
	$(ECHO) Creating jdk jimage
	$(RM) -r $(JDK_IMAGE_DIR) $(JDK_SORTED_MODULES)
	$(JIMAGE_TOOL) --mods $(JDK_MODULES_LIST) --output $(JDK_IMAGE_DIR) \
	    $(MODULES_XML) > $(JDK_SORTED_MODULES)
	$(TOUCH) $@

124 125
$(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
    $(call DependOnVariable, JRE_MODULES_LIST)
C
chegar 已提交
126 127 128 129 130 131 132 133 134 135 136 137
	$(ECHO) Creating jre jimage
	$(RM) -r $(JRE_IMAGE_DIR) $(JRE_SORTED_MODULES)
	$(JIMAGE_TOOL) --mods $(JRE_MODULES_LIST) --output $(JRE_IMAGE_DIR) \
	    $(MODULES_XML) > $(JRE_SORTED_MODULES)
	$(TOUCH) $@

JRE_COMPACT1_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact1
JRE_COMPACT2_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact2
JRE_COMPACT3_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact3

COMPACT_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec

138 139
$(JRE_COMPACT1_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
    $(call DependOnVariable, JRE_COMPACT1_MODULES_LIST)
C
chegar 已提交
140 141 142 143 144 145 146 147
	$(ECHO) Creating jre compact1 jimage
	$(RM) -r $(JRE_COMPACT1_IMAGE_DIR) $(JRE_COMPACT1_SORTED_MODULES)
	$(JIMAGE_TOOL) \
	    --mods $(call SubstComma, java.compact1 $(COMPACT_EXTRA_MODULES)) \
	    --output $(JRE_COMPACT1_IMAGE_DIR) \
	    $(MODULES_XML) > $(JRE_COMPACT1_SORTED_MODULES)
	$(TOUCH) $@

148 149
$(JRE_COMPACT2_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
    $(call DependOnVariable, JRE_COMPACT2_MODULES_LIST)
C
chegar 已提交
150 151 152 153 154 155 156 157
	$(ECHO) Creating jre compact2 jimage
	$(RM) -r $(JRE_COMPACT2_IMAGE_DIR) $(JRE_COMPACT2_SORTED_MODULES)
	$(JIMAGE_TOOL) \
	    --mods $(call SubstComma, java.compact2 $(COMPACT_EXTRA_MODULES)) \
	    --output $(JRE_COMPACT2_IMAGE_DIR) \
	    $(MODULES_XML) > $(JRE_COMPACT2_SORTED_MODULES)
	$(TOUCH) $@

158 159
$(JRE_COMPACT3_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
    $(call DependOnVariable, JRE_COMPACT3_MODULES_LIST)
C
chegar 已提交
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
	$(ECHO) Creating jre compact3 jimage
	$(RM) -r $(JRE_COMPACT3_IMAGE_DIR) $(JRE_COMPACT3_SORTED_MODULES)
	$(JIMAGE_TOOL) \
	    --mods $(call SubstComma, $(JDK_COMPACT3_MODULES) $(COMPACT_EXTRA_MODULES)) \
	    --output $(JRE_COMPACT3_IMAGE_DIR) \
	    $(MODULES_XML) > $(JRE_COMPACT3_SORTED_MODULES)
	$(TOUCH) $@

TOOL_JRE_TARGETS := $(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
TOOL_JDK_TARGETS := $(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
TOOL_JRE_COMPACT1_TARGETS := $(JRE_COMPACT1_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
TOOL_JRE_COMPACT2_TARGETS := $(JRE_COMPACT2_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
TOOL_JRE_COMPACT3_TARGETS := $(JRE_COMPACT3_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)

################################################################################
# /man dir
#
# All variables in this section are assigned with simple =, without :, to enable
# more selective overriding from the custom version of this file.
#
# Avoid evaluating this whole section on windows for speed and stability
ifneq ($(OPENJDK_TARGET_OS), windows)
  JRE_MAN_PAGES += \
      java.1 \
      jjs.1 \
      keytool.1 \
      orbd.1 \
      pack200.1 \
      rmid.1 \
      rmiregistry.1 \
      servertool.1 \
      tnameserv.1 \
      unpack200.1

  ifndef OPENJDK
    ifneq ($(OPENJDK_TARGET_OS), solaris)
      JRE_MAN_PAGES += javaws.1
    endif
  endif

  JDK_MAN_PAGES += \
      $(JRE_MAN_PAGES) \
      appletviewer.1 \
      idlj.1 \
      jar.1 \
      jarsigner.1 \
      javac.1 \
      javadoc.1 \
      javah.1 \
      javap.1 \
      jconsole.1 \
      jcmd.1 \
      jdb.1 \
      jdeps.1 \
      jinfo.1 \
      jmap.1 \
      jps.1 \
      jrunscript.1 \
      jsadebugd.1 \
      jstack.1 \
      jstat.1 \
      jstatd.1 \
222
      policytool.1 \
C
chegar 已提交
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
      rmic.1 \
      schemagen.1 \
      serialver.1 \
      wsgen.1 \
      wsimport.1 \
      xjc.1

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

  ifeq ($(OPENJDK_TARGET_OS), linux)
    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/linux/doc
    MAN1_SUBDIR = man
  endif
  ifeq ($(OPENJDK_TARGET_OS), solaris)
    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/solaris/doc
    MAN1_SUBDIR = sun/man/man1
  endif
  ifeq ($(OPENJDK_TARGET_OS), macosx)
    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/bsd/doc
    MAN1_SUBDIR = man
  endif

  $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
E
erikj 已提交
247
	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
C
chegar 已提交
248 249 250
	$(install-file)

  $(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
E
erikj 已提交
251
	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
C
chegar 已提交
252 253 254
	$(install-file)

  $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
E
erikj 已提交
255
	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
256
	$(install-file)
C
chegar 已提交
257 258

  $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
E
erikj 已提交
259
	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
260
	$(install-file)
C
chegar 已提交
261 262 263

  ifeq ($(OPENJDK_TARGET_OS), solaris)
    $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
E
erikj 已提交
264
	$(call LogInfo, Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@))
C
chegar 已提交
265 266 267
	$(install-file)

    $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
E
erikj 已提交
268
	$(call LogInfo, Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@))
C
chegar 已提交
269 270 271 272 273
	$(install-file)
  endif

  ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
    $(JRE_IMAGE_DIR)/man/ja:
E
erikj 已提交
274
	$(call LogInfo, Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@))
C
chegar 已提交
275 276 277
	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja

    $(JDK_IMAGE_DIR)/man/ja:
E
erikj 已提交
278
	$(call LogInfo, Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@))
C
chegar 已提交
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
  endif

  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))

    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

  ifneq ($(findstring $(OPENJDK_TARGET_OS), linux 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

    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

  JRE_TARGETS += $(JRE_MAN_PAGE_LIST)
  JDK_TARGETS += $(JDK_MAN_PAGE_LIST)
endif # Windows

################################################################################
# /include dir

$(eval $(call SetupCopyFiles,COPY_INCLUDES, \
    SRC := $(JDK_OUTPUTDIR)/include, \
    DEST := $(JDK_IMAGE_DIR)/include, \
    FILES := $(call CacheFind,$(JDK_OUTPUTDIR)/include)))

JDK_TARGETS += $(COPY_INCLUDES)

################################################################################
# doc files

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)

JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/, $(JRE_DOC_FILES))
JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/, $(JDK_DOC_FILES))

# Processing license files from source area to image area
# These are modified to have the platform specific EOL chars.
define process-doc-file
E
erikj 已提交
332
	$(call LogInfo, Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@))
C
chegar 已提交
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358
	$(MKDIR) -p $(@D)
	$(RM) $@
	LC_ALL=C $(SED) 's/$$//g' $< > $@
	$(CHMOD) 444 $@
endef

$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
	$(process-doc-file)

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

JRE_TARGETS += $(JRE_DOC_TARGETS)
JDK_TARGETS += $(JDK_DOC_TARGETS)

################################################################################
# Release file

JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release
JRE_COMPACT1_INFO_FILE := $(JRE_COMPACT1_IMAGE_DIR)/release
JRE_COMPACT2_INFO_FILE := $(JRE_COMPACT2_IMAGE_DIR)/release
JRE_COMPACT3_INFO_FILE := $(JRE_COMPACT3_IMAGE_DIR)/release

# Common way to emit a line into the release or info file
define info-file-item # name value
359
  $(PRINTF) '%s="%s"\n' $1 $2 >> $@
C
chegar 已提交
360 361 362 363
endef

# Param 1 - The file containing the MODULES list
define create-info-file
364 365
  $(call info-file-item, "JAVA_VERSION", "$(VERSION_NUMBER)")
  $(call info-file-item, "JAVA_FULL_VERSION", "$(VERSION_STRING)")
366 367 368 369 370
  $(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)")
  $(if $(JDK_ARCH_ABI_PROP_NAME), \
    $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
371
  $(call info-file-item, "SOURCE", "$(strip $(ALL_SOURCE_TIPS))")
372 373 374 375 376
  $(call info-file-item, "MODULES", "`$(CAT) $1`")
endef

# Param 1 - The file containing the MODULES list
define prepare-info-file
E
erikj 已提交
377
  $(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@))
378 379 380 381 382 383 384
  $(MKDIR) -p $(@D)
  $(RM) $@
endef

define info-file
  $(call prepare-info-file, $1)
  $(call create-info-file, $1)
C
chegar 已提交
385 386
endef

387 388 389 390 391
# Create a variable dependency file common for all release info files. The
# sorted module list will only change if the image is regenerated, which will
# trigger a rebuild of these files anyway.
INFO_FILE_VARDEPS := $(call DependOnVariable, create-info-file)

C
chegar 已提交
392 393 394 395 396
ALL_SOURCE_TIPS = $(shell \
    if [ -f $(SUPPORT_OUTPUTDIR)/source_tips ] ; then \
      $(CAT) $(SUPPORT_OUTPUTDIR)/source_tips ; \
    fi)

397 398
$(JRE_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
	$(call info-file, $(JRE_SORTED_MODULES))
C
chegar 已提交
399

400 401
$(JDK_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
	$(call info-file, $(JDK_SORTED_MODULES))
C
chegar 已提交
402

403 404
$(JRE_COMPACT1_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
	$(call info-file, $(JRE_COMPACT1_SORTED_MODULES))
C
chegar 已提交
405 406
	$(call info-file-item, "JAVA_PROFILE", "compact1")

407 408
$(JRE_COMPACT2_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
	$(call info-file, $(JRE_COMPACT2_SORTED_MODULES))
C
chegar 已提交
409 410
	$(call info-file-item, "JAVA_PROFILE", "compact2")

411 412
$(JRE_COMPACT3_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
	$(call info-file, $(JRE_COMPACT3_SORTED_MODULES))
C
chegar 已提交
413 414 415 416 417 418 419 420 421 422 423 424
	$(call info-file-item, "JAVA_PROFILE", "compact3")

JRE_TARGETS += $(JRE_INFO_FILE)
JDK_TARGETS += $(JDK_INFO_FILE)
JRE_COMPACT1_TARGETS += $(JRE_COMPACT1_INFO_FILE)
JRE_COMPACT2_TARGETS += $(JRE_COMPACT2_INFO_FILE)
JRE_COMPACT3_TARGETS += $(JRE_COMPACT3_INFO_FILE)

################################################################################
# src.zip

$(JDK_IMAGE_DIR)/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
E
erikj 已提交
425
	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
C
chegar 已提交
426 427 428 429 430 431 432
	$(install-file)

JDK_TARGETS += $(JDK_IMAGE_DIR)/src.zip

################################################################################
# /demo dir
ifneq ($(findstring images, $(MAKECMDGOALS)), )
E
erikj 已提交
433 434 435 436 437 438 439 440 441 442
  $(eval $(call SetupCopyFiles, JDK_COPY_DEMOS, \
      SRC := $(SUPPORT_OUTPUTDIR)/demos/image, \
      DEST := $(JDK_IMAGE_DIR)/demo, \
      FILES := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/demos/image), \
          $(call DoubleDollar, $(call DoubleDollar, \
          $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demos/image \
          -type f -a ! \( -name "_the*" -o -name "javac_state" \) )))), \
  ))

  JDK_TARGETS += $(JDK_COPY_DEMOS)
C
chegar 已提交
443 444 445 446 447
endif

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

E
erikj 已提交
448
$(eval $(call SetupCopyFiles, COPY_SAMPLES, \
E
erikj 已提交
449
    SRC := $(SUPPORT_OUTPUTDIR)/sample/image, \
C
chegar 已提交
450
    DEST := $(JDK_IMAGE_DIR)/sample, \
E
erikj 已提交
451 452
    FILES := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/sample/image), \
        $(call CacheFind,$(SUPPORT_OUTPUTDIR)/sample/image))))
C
chegar 已提交
453 454 455 456 457 458 459 460 461 462 463 464 465

JDK_TARGETS += $(COPY_SAMPLES)

################################################################################
# jrt-fs.jar

$(eval $(call SetupCopyFiles,COPY_JRTFS_JAR, \
    SRC := $(SUPPORT_OUTPUTDIR), \
    DEST := $(JDK_IMAGE_DIR), \
    FILES := $(SUPPORT_OUTPUTDIR)/jrt-fs.jar))

JDK_TARGETS += $(COPY_JRTFS_JAR)

466 467 468 469 470 471 472
################################################################################
# Code coverage data files

ifeq ($(GCOV_ENABLED), true)

  GCOV_FIND_EXPR := -type f -name "*.gcno"

473 474 475 476
  $(eval $(call SetupCopyFiles,COPY_HOTSPOT_GCOV_GCNO, \
      SRC := $(OUTPUT_ROOT), \
      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
      FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR) $(GCOV_FIND_EXPR))))
477

478
  SYMBOLS_TARGETS += $(COPY_HOTSPOT_GCOV_GCNO)
479 480

  $(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
481 482
      SRC := $(OUTPUT_ROOT), \
      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
483 484 485 486 487 488
      FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))

  SYMBOLS_TARGETS += $(COPY_JDK_GCOV_GCNO)

endif

C
chegar 已提交
489 490 491 492 493 494 495 496 497 498 499
################################################################################

# Include custom post hook here to make it possible to augment the target lists
# before actual target prerequisites are declared.
$(eval $(call IncludeCustomExtension, , Images-post.gmk))

################################################################################

$(JRE_TARGETS): $(TOOL_JRE_TARGETS)
$(JDK_TARGETS): $(TOOL_JDK_TARGETS)

500 501
jimages: $(TOOL_JRE_TARGETS) $(TOOL_JDK_TARGETS) $(JRE_TARGETS) $(JDK_TARGETS) \
    $(SYMBOLS_TARGETS)
C
chegar 已提交
502 503 504 505 506 507 508 509 510 511 512 513 514

$(JRE_COMPACT1_TARGETS): $(TOOL_JRE_COMPACT1_TARGETS)
$(JRE_COMPACT2_TARGETS): $(TOOL_JRE_COMPACT2_TARGETS)
$(JRE_COMPACT3_TARGETS): $(TOOL_JRE_COMPACT3_TARGETS)

profiles: $(TOOL_JRE_COMPACT1_TARGETS) \
    $(TOOL_JRE_COMPACT2_TARGETS) \
    $(TOOL_JRE_COMPACT3_TARGETS) \
    $(JRE_COMPACT1_TARGETS) \
    $(JRE_COMPACT2_TARGETS) \
    $(JRE_COMPACT3_TARGETS)

.PHONY: default all jimages profiles