Images.gmk revision 1620:8d59a6070b98
11556Srgrimes#
21556Srgrimes# Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
31556Srgrimes# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41556Srgrimes#
51556Srgrimes# This code is free software; you can redistribute it and/or modify it
61556Srgrimes# under the terms of the GNU General Public License version 2 only, as
71556Srgrimes# published by the Free Software Foundation.  Oracle designates this
81556Srgrimes# particular file as subject to the "Classpath" exception as provided
91556Srgrimes# by Oracle in the LICENSE file that accompanied this code.
101556Srgrimes#
111556Srgrimes# This code is distributed in the hope that it will be useful, but WITHOUT
121556Srgrimes# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
131556Srgrimes# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
141556Srgrimes# version 2 for more details (a copy is included in the LICENSE file that
151556Srgrimes# accompanied this code).
161556Srgrimes#
171556Srgrimes# You should have received a copy of the GNU General Public License version
181556Srgrimes# 2 along with this work; if not, write to the Free Software Foundation,
191556Srgrimes# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201556Srgrimes#
211556Srgrimes# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
221556Srgrimes# or visit www.oracle.com if you need additional information or have any
231556Srgrimes# questions.
241556Srgrimes#
251556Srgrimes
261556Srgrimesdefault: all
271556Srgrimes
281556Srgrimesinclude $(SPEC)
291556Srgrimesinclude MakeBase.gmk
301556Srgrimes
311556SrgrimesTOOL_TARGETS :=
321556SrgrimesJDK_TARGETS :=
331556SrgrimesJRE_TARGETS :=
341556Srgrimes
3536049Scharnier# Hook to include the corresponding custom file, if present.
3636049Scharnier$(eval $(call IncludeCustomExtension, , Images-pre.gmk))
3736049Scharnier
381556Srgrimes############################################################################
3999110Sobrien
4099110SobrienMAIN_MODULES += java.se java.smartcardio jdk.httpserver jdk.sctp \
411556Srgrimes               jdk.security.auth jdk.security.jgss jdk.pack200 jdk.xml.dom \
421556Srgrimes               jdk.accessibility jdk.internal.le jdk.scripting.nashorn.shell
431556Srgrimes
441556Srgrimes# providers
451556SrgrimesPROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk.localedata \
461556Srgrimes               jdk.naming.dns jdk.naming.rmi jdk.scripting.nashorn jdk.zipfs
471556Srgrimes
481556Srgrimes# tools
491556SrgrimesTOOLS_MODULES += jdk.attach jdk.compiler jdk.dev \
501556Srgrimes               jdk.javadoc jdk.jcmd jdk.jconsole jdk.hotspot.agent jdk.jartool \
511556Srgrimes               jdk.jdeps jdk.jdi jdk.jdwp.agent jdk.policytool jdk.rmic jdk.xml.bind jdk.xml.ws
521556Srgrimes
531556Srgrimesifeq ($(OPENJDK_TARGET_OS), windows)
541556Srgrimes  PROVIDER_MODULES += jdk.crypto.mscapi
551556Srgrimesendif
561556Srgrimes
571556Srgrimesifeq ($(OPENJDK_TARGET_OS), solaris)
581556Srgrimes  PROVIDER_MODULES += jdk.crypto.ucrypto
591556Srgrimesendif
601556Srgrimes
611556Srgrimesifeq ($(OPENJDK_TARGET_OS), macosx)
621556Srgrimes  MAIN_MODULES += jdk.deploy.osx
631556Srgrimesendif
641556Srgrimes
651556SrgrimesJRE_MODULES := $(MAIN_MODULES) $(PROVIDER_MODULES)
661556SrgrimesJDK_MODULES := $(JRE_MODULES) $(TOOLS_MODULES)
671556Srgrimes
681556Srgrimes# compact3 builds have additional modules
691556SrgrimesJDK_COMPACT3_MODULES := java.compact3 java.smartcardio jdk.httpserver jdk.naming.dns \
701556Srgrimes                       jdk.naming.rmi jdk.sctp jdk.security.auth jdk.management
711556Srgrimes
721556Srgrimes# Replacing double-comma with a single comma is to workaround the issue
731556Srgrimes# with some version of make on windows that doesn't substitute spaces
741556Srgrimes# with one comma properly as with make 4.0
751556Srgrimesdefine SubstComma
761556Srgrimes  $(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1)))
771556Srgrimesendef
781556SrgrimesJRE_MODULES_LIST := $(call SubstComma, $(JRE_MODULES))
791556SrgrimesJDK_MODULES_LIST := $(call SubstComma, $(JDK_MODULES))
801556Srgrimes
811556Srgrimes################################################################################
821556Srgrimes
831556SrgrimesJRE_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/jre-sorted-modules
841556SrgrimesJDK_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/jdk-sorted-modules
851556SrgrimesJRE_COMPACT1_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact1-sorted-modules
8676017SkrisJRE_COMPACT2_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact2-sorted-modules
871556SrgrimesJRE_COMPACT3_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact3-sorted-modules
881556Srgrimes
891556Srgrimes
901556SrgrimesMODULES_CMDS := $(SUPPORT_OUTPUTDIR)/modules_cmds-stripped
911556SrgrimesMODULES_LIBS := $(SUPPORT_OUTPUTDIR)/modules_libs-stripped
921556SrgrimesMODULES_CONF := $(SUPPORT_OUTPUTDIR)/modules_conf
931556Srgrimes
941556SrgrimesJIMAGE_TOOL := $(JAVA_SMALL) \
951556Srgrimes    -Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \
961556Srgrimes    -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.module.ImageBuilder \
971556Srgrimes    --cmds $(MODULES_CMDS) \
981556Srgrimes    --libs $(MODULES_LIBS) \
991556Srgrimes    --configs $(MODULES_CONF) \
1001556Srgrimes    --classes $(JDK_OUTPUTDIR)/modules \
1011556Srgrimes    --endian $(OPENJDK_TARGET_CPU_ENDIAN) \
1021556Srgrimes    #
1031556Srgrimes
1041556SrgrimesMODULES_XML += $(SRC_ROOT)/modules.xml
1051556SrgrimesDEPENDENCIES := $(call CacheFind, \
1061556Srgrimes    $(SUPPORT_OUTPUTDIR)/modules_cmds \
1071556Srgrimes    $(SUPPORT_OUTPUTDIR)/modules_conf \
1081556Srgrimes    $(SUPPORT_OUTPUTDIR)/modules_libs) \
1091556Srgrimes    $(wildcard $(JDK_OUTPUTDIR)/modules/*/_*) \
11076017Skris    $(MODULES_XML)
1111556Srgrimes    #
1121556Srgrimes
1131556Srgrimes# Use this file inside the image as target for make rule
1141556SrgrimesJIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX)
1151556Srgrimes
1161556Srgrimes$(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
1171556Srgrimes    $(call DependOnVariable, JDK_MODULES_LIST)
1181556Srgrimes	$(ECHO) Creating jdk jimage
1191556Srgrimes	$(RM) -r $(JDK_IMAGE_DIR) $(JDK_SORTED_MODULES)
1201556Srgrimes	$(JIMAGE_TOOL) --mods $(JDK_MODULES_LIST) --output $(JDK_IMAGE_DIR) \
1211556Srgrimes	    $(MODULES_XML) > $(JDK_SORTED_MODULES)
1221556Srgrimes	$(TOUCH) $@
1231556Srgrimes
1241556Srgrimes$(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
1251556Srgrimes    $(call DependOnVariable, JRE_MODULES_LIST)
1261556Srgrimes	$(ECHO) Creating jre jimage
1271556Srgrimes	$(RM) -r $(JRE_IMAGE_DIR) $(JRE_SORTED_MODULES)
1281556Srgrimes	$(JIMAGE_TOOL) --mods $(JRE_MODULES_LIST) --output $(JRE_IMAGE_DIR) \
1291556Srgrimes	    $(MODULES_XML) > $(JRE_SORTED_MODULES)
1301556Srgrimes	$(TOUCH) $@
1311556Srgrimes
1321556SrgrimesJRE_COMPACT1_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact1
1331556SrgrimesJRE_COMPACT2_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact2
13476017SkrisJRE_COMPACT3_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact3
1351556Srgrimes
1361556SrgrimesCOMPACT_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec
1371556Srgrimes
1381556Srgrimes$(JRE_COMPACT1_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
1391556Srgrimes    $(call DependOnVariable, JRE_COMPACT1_MODULES_LIST)
1401556Srgrimes	$(ECHO) Creating jre compact1 jimage
1411556Srgrimes	$(RM) -r $(JRE_COMPACT1_IMAGE_DIR) $(JRE_COMPACT1_SORTED_MODULES)
1421556Srgrimes	$(JIMAGE_TOOL) \
1431556Srgrimes	    --mods $(call SubstComma, java.compact1 $(COMPACT_EXTRA_MODULES)) \
1441556Srgrimes	    --output $(JRE_COMPACT1_IMAGE_DIR) \
1451556Srgrimes	    $(MODULES_XML) > $(JRE_COMPACT1_SORTED_MODULES)
1461556Srgrimes	$(TOUCH) $@
1471556Srgrimes
1481556Srgrimes$(JRE_COMPACT2_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
1491556Srgrimes    $(call DependOnVariable, JRE_COMPACT2_MODULES_LIST)
1501556Srgrimes	$(ECHO) Creating jre compact2 jimage
1511556Srgrimes	$(RM) -r $(JRE_COMPACT2_IMAGE_DIR) $(JRE_COMPACT2_SORTED_MODULES)
1521556Srgrimes	$(JIMAGE_TOOL) \
1531556Srgrimes	    --mods $(call SubstComma, java.compact2 $(COMPACT_EXTRA_MODULES)) \
1541556Srgrimes	    --output $(JRE_COMPACT2_IMAGE_DIR) \
1551556Srgrimes	    $(MODULES_XML) > $(JRE_COMPACT2_SORTED_MODULES)
1561556Srgrimes	$(TOUCH) $@
1571556Srgrimes
15876017Skris$(JRE_COMPACT3_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
1591556Srgrimes    $(call DependOnVariable, JRE_COMPACT3_MODULES_LIST)
1601556Srgrimes	$(ECHO) Creating jre compact3 jimage
1611556Srgrimes	$(RM) -r $(JRE_COMPACT3_IMAGE_DIR) $(JRE_COMPACT3_SORTED_MODULES)
1621556Srgrimes	$(JIMAGE_TOOL) \
1631556Srgrimes	    --mods $(call SubstComma, $(JDK_COMPACT3_MODULES) $(COMPACT_EXTRA_MODULES)) \
1641556Srgrimes	    --output $(JRE_COMPACT3_IMAGE_DIR) \
1651556Srgrimes	    $(MODULES_XML) > $(JRE_COMPACT3_SORTED_MODULES)
1661556Srgrimes	$(TOUCH) $@
1671556Srgrimes
1681556SrgrimesTOOL_JRE_TARGETS := $(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
169108533SschweikhTOOL_JDK_TARGETS := $(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
1701556SrgrimesTOOL_JRE_COMPACT1_TARGETS := $(JRE_COMPACT1_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
1711556SrgrimesTOOL_JRE_COMPACT2_TARGETS := $(JRE_COMPACT2_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
172114583SmarkmTOOL_JRE_COMPACT3_TARGETS := $(JRE_COMPACT3_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
1731556Srgrimes
1741556Srgrimes################################################################################
17590113Simp# /man dir
17690113Simp#
1771556Srgrimes# All variables in this section are assigned with simple =, without :, to enable
1781556Srgrimes# more selective overriding from the custom version of this file.
1791556Srgrimes#
1801556Srgrimes# Avoid evaluating this whole section on windows for speed and stability
1811556Srgrimesifneq ($(OPENJDK_TARGET_OS), windows)
1821556Srgrimes  JRE_MAN_PAGES += \
1831556Srgrimes      java.1 \
1841556Srgrimes      jjs.1 \
1851556Srgrimes      keytool.1 \
1861556Srgrimes      orbd.1 \
1871556Srgrimes      pack200.1 \
1881556Srgrimes      rmid.1 \
1891556Srgrimes      rmiregistry.1 \
1901556Srgrimes      servertool.1 \
1911556Srgrimes      tnameserv.1 \
1921556Srgrimes      unpack200.1
1931556Srgrimes
1941556Srgrimes  ifndef OPENJDK
1951556Srgrimes    ifneq ($(OPENJDK_TARGET_OS), solaris)
1961556Srgrimes      JRE_MAN_PAGES += javaws.1
1971556Srgrimes    endif
1981556Srgrimes  endif
1991556Srgrimes
2001556Srgrimes  JDK_MAN_PAGES += \
2011556Srgrimes      $(JRE_MAN_PAGES) \
202127055Scperciva      appletviewer.1 \
2031556Srgrimes      idlj.1 \
2041556Srgrimes      jar.1 \
2051556Srgrimes      jarsigner.1 \
2061556Srgrimes      javac.1 \
20746684Skris      javadoc.1 \
2081556Srgrimes      javah.1 \
2091556Srgrimes      javap.1 \
2101556Srgrimes      jconsole.1 \
2111556Srgrimes      jcmd.1 \
2121556Srgrimes      jdb.1 \
2131556Srgrimes      jdeps.1 \
21476017Skris      jinfo.1 \
2151556Srgrimes      jmap.1 \
21676017Skris      jps.1 \
21776017Skris      jrunscript.1 \
2181556Srgrimes      jsadebugd.1 \
2191556Srgrimes      jstack.1 \
2201556Srgrimes      jstat.1 \
2211556Srgrimes      jstatd.1 \
2221556Srgrimes      policytool.1 \
2231556Srgrimes      rmic.1 \
2241556Srgrimes      schemagen.1 \
2251556Srgrimes      serialver.1 \
2261556Srgrimes      wsgen.1 \
2271556Srgrimes      wsimport.1 \
22826363Scharnier      xjc.1
2291556Srgrimes
2301556Srgrimes  # This variable is potentially overridden in the closed makefile.
2311556Srgrimes  MAN_SRC_BASEDIR ?= $(JDK_TOPDIR)/src
2321556Srgrimes
2331556Srgrimes  ifeq ($(OPENJDK_TARGET_OS), linux)
2341556Srgrimes    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/linux/doc
2351556Srgrimes    MAN1_SUBDIR = man
2361556Srgrimes  endif
2371556Srgrimes  ifeq ($(OPENJDK_TARGET_OS), solaris)
2381556Srgrimes    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/solaris/doc
2391556Srgrimes    MAN1_SUBDIR = sun/man/man1
240108533Sschweikh  endif
2411556Srgrimes  ifeq ($(OPENJDK_TARGET_OS), macosx)
2421556Srgrimes    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/bsd/doc
243114583Smarkm    MAN1_SUBDIR = man
2441556Srgrimes  endif
2451556Srgrimes
24690113Simp  $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
24790113Simp	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
2481556Srgrimes	$(install-file)
2491556Srgrimes
2501556Srgrimes  $(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
2511556Srgrimes	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
2521556Srgrimes	$(install-file)
2531556Srgrimes
2541556Srgrimes  $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
2551556Srgrimes	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
2561556Srgrimes	$(install-file)
2571556Srgrimes
2581556Srgrimes  $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
2591556Srgrimes	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
2601556Srgrimes	$(install-file)
2611556Srgrimes
2621556Srgrimes  ifeq ($(OPENJDK_TARGET_OS), solaris)
2631556Srgrimes    $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
2641556Srgrimes	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
2651556Srgrimes	$(install-file)
2661556Srgrimes
2671556Srgrimes    $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
2681556Srgrimes	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
2691556Srgrimes	$(install-file)
2701556Srgrimes  endif
2711556Srgrimes
2721556Srgrimes  ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
273127055Scperciva    $(JRE_IMAGE_DIR)/man/ja:
2741556Srgrimes	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
2751556Srgrimes	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
2761556Srgrimes
2771556Srgrimes    $(JDK_IMAGE_DIR)/man/ja:
27846684Skris	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
2791556Srgrimes	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
2801556Srgrimes  endif
2811556Srgrimes
2821556Srgrimes  ifeq ($(OPENJDK_TARGET_OS), solaris)
2831556Srgrimes    JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
2841556Srgrimes        $(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/, $(JRE_MAN_PAGES)) \
28576017Skris        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
2861556Srgrimes        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JRE_MAN_PAGES))
28776017Skris
28876017Skris    JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
2891556Srgrimes        $(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/, $(JDK_MAN_PAGES)) \
2901556Srgrimes        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
2911556Srgrimes        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JDK_MAN_PAGES))
2921556Srgrimes  endif
2931556Srgrimes
2941556Srgrimes  ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
2951556Srgrimes    JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
2961556Srgrimes        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
2971556Srgrimes        $(JRE_IMAGE_DIR)/man/ja
2981556Srgrimes
29926363Scharnier    JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
3001556Srgrimes        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
3011556Srgrimes        $(JDK_IMAGE_DIR)/man/ja
3021556Srgrimes  endif
3031556Srgrimes
3041556Srgrimes  JRE_TARGETS += $(JRE_MAN_PAGE_LIST)
3051556Srgrimes  JDK_TARGETS += $(JDK_MAN_PAGE_LIST)
3061556Srgrimesendif # Windows
3071556Srgrimes
3081556Srgrimes################################################################################
3091556Srgrimes# /include dir
3101556Srgrimes
3111556Srgrimes$(eval $(call SetupCopyFiles,COPY_INCLUDES, \
3121556Srgrimes    SRC := $(JDK_OUTPUTDIR)/include, \
3131556Srgrimes    DEST := $(JDK_IMAGE_DIR)/include, \
3141556Srgrimes    FILES := $(call CacheFind,$(JDK_OUTPUTDIR)/include)))
3151556Srgrimes
31690113SimpJDK_TARGETS += $(COPY_INCLUDES)
31790113Simp
31890113Simp################################################################################
3191556Srgrimes# doc files
3201556Srgrimes
3211556SrgrimesJRE_DOC_FILES ?= LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
3221556SrgrimesJDK_DOC_FILES ?= LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
3231556SrgrimesJRE_DOC_LOCATION ?= $(JDK_TOPDIR)
3241556SrgrimesJDK_DOC_LOCATION ?= $(JDK_TOPDIR)
3251556Srgrimes
3261556SrgrimesJRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/, $(JRE_DOC_FILES))
3271556SrgrimesJDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/, $(JDK_DOC_FILES))
3281556Srgrimes
3291556Srgrimes# Processing license files from source area to image area
3301556Srgrimes# These are modified to have the platform specific EOL chars.
3311556Srgrimesdefine process-doc-file
3321556Srgrimes	$(ECHO) $(LOG_INFO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@)
3331556Srgrimes	$(MKDIR) -p $(@D)
3341556Srgrimes	$(RM) $@
3351556Srgrimes	LC_ALL=C $(SED) 's/$$//g' $< > $@
3361556Srgrimes	$(CHMOD) 444 $@
3371556Srgrimesendef
3381556Srgrimes
3391556Srgrimes$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
3401556Srgrimes	$(process-doc-file)
3411556Srgrimes
3421556Srgrimes$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
3431556Srgrimes	$(process-doc-file)
3441556Srgrimes
3451556SrgrimesJRE_TARGETS += $(JRE_DOC_TARGETS)
34676351SkrisJDK_TARGETS += $(JDK_DOC_TARGETS)
34776351Skris
3481556Srgrimes################################################################################
3491556Srgrimes# Release file
3501556Srgrimes
3511556SrgrimesJRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
3521556SrgrimesJDK_INFO_FILE := $(JDK_IMAGE_DIR)/release
3531556SrgrimesJRE_COMPACT1_INFO_FILE := $(JRE_COMPACT1_IMAGE_DIR)/release
3541556SrgrimesJRE_COMPACT2_INFO_FILE := $(JRE_COMPACT2_IMAGE_DIR)/release
3551556SrgrimesJRE_COMPACT3_INFO_FILE := $(JRE_COMPACT3_IMAGE_DIR)/release
3561556Srgrimes
3571556Srgrimes# Common way to emit a line into the release or info file
3581556Srgrimesdefine info-file-item # name value
35926363Scharnier  $(PRINTF) '%s="%s"\n' $1 $2 >> $@
3601556Srgrimesendef
3611556Srgrimes
3621556Srgrimes# Param 1 - The file containing the MODULES list
3631556Srgrimesdefine create-info-file
3641556Srgrimes  $(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)")
3651556Srgrimes  $(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)")
3661556Srgrimes  $(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)")
3671556Srgrimes  $(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)")
3681556Srgrimes  $(if $(JDK_ARCH_ABI_PROP_NAME), \
3691556Srgrimes    $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
3701556Srgrimes  $(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)")
3711556Srgrimes  $(call info-file-item, "MODULES", "`$(CAT) $1`")
3721556Srgrimesendef
3731556Srgrimes
3741556Srgrimes# Param 1 - The file containing the MODULES list
3751556Srgrimesdefine prepare-info-file
3761556Srgrimes  $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
3771556Srgrimes  $(MKDIR) -p $(@D)
3781556Srgrimes  $(RM) $@
3791556Srgrimesendef
38090113Simp
38190113Simpdefine info-file
38290113Simp  $(call prepare-info-file, $1)
3831556Srgrimes  $(call create-info-file, $1)
3841556Srgrimesendef
3851556Srgrimes
3861556Srgrimes# Create a variable dependency file common for all release info files. The
3871556Srgrimes# sorted module list will only change if the image is regenerated, which will
3881556Srgrimes# trigger a rebuild of these files anyway.
3891556SrgrimesINFO_FILE_VARDEPS := $(call DependOnVariable, create-info-file)
3901556Srgrimes
3911556SrgrimesALL_SOURCE_TIPS = $(shell \
3921556Srgrimes    if [ -f $(SUPPORT_OUTPUTDIR)/source_tips ] ; then \
3931556Srgrimes      $(CAT) $(SUPPORT_OUTPUTDIR)/source_tips ; \
3941556Srgrimes    fi)
3951556Srgrimes
3961556Srgrimes$(JRE_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
3971556Srgrimes	$(call info-file, $(JRE_SORTED_MODULES))
3981556Srgrimes
3991556Srgrimes$(JDK_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
4001556Srgrimes	$(call info-file, $(JDK_SORTED_MODULES))
4011556Srgrimes
4021556Srgrimes$(JRE_COMPACT1_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
4031556Srgrimes	$(call info-file, $(JRE_COMPACT1_SORTED_MODULES))
4041556Srgrimes	$(call info-file-item, "JAVA_PROFILE", "compact1")
4051556Srgrimes
4061556Srgrimes$(JRE_COMPACT2_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
4071556Srgrimes	$(call info-file, $(JRE_COMPACT2_SORTED_MODULES))
4081556Srgrimes	$(call info-file-item, "JAVA_PROFILE", "compact2")
40976351Skris
41076351Skris$(JRE_COMPACT3_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
4111556Srgrimes	$(call info-file, $(JRE_COMPACT3_SORTED_MODULES))
4121556Srgrimes	$(call info-file-item, "JAVA_PROFILE", "compact3")
4131556Srgrimes
4141556SrgrimesJRE_TARGETS += $(JRE_INFO_FILE)
4151556SrgrimesJDK_TARGETS += $(JDK_INFO_FILE)
4161556SrgrimesJRE_COMPACT1_TARGETS += $(JRE_COMPACT1_INFO_FILE)
4171556SrgrimesJRE_COMPACT2_TARGETS += $(JRE_COMPACT2_INFO_FILE)
4181556SrgrimesJRE_COMPACT3_TARGETS += $(JRE_COMPACT3_INFO_FILE)
4191556Srgrimes
4201556Srgrimes################################################################################
4211556Srgrimes# src.zip
4221556Srgrimes
42326363Scharnier$(JDK_IMAGE_DIR)/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
4241556Srgrimes	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
4251556Srgrimes	$(install-file)
4261556Srgrimes
4271556SrgrimesJDK_TARGETS += $(JDK_IMAGE_DIR)/src.zip
4281556Srgrimes
4291556Srgrimes################################################################################
4301556Srgrimes# /demo dir
4311556Srgrimes
4321556Srgrimes# The db demo contains an empty dir that needs to be copied. The other
433# directories will always trigger the rule for recompile since
434# _the.list_of_packages files are touched.
435ifneq ($(findstring images, $(MAKECMDGOALS)), )
436  $(JDK_IMAGE_DIR)/demo/%: $(SUPPORT_OUTPUTDIR)/demo/image/%
437	if [ ! -d "$@" ]; then \
438	  $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \
439	  $(MKDIR) -p $(@D); \
440	  if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \
441	fi
442
443  # Find all files including directories
444  JDK_DEMO_TARGETS := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/demo/image), \
445      $(patsubst $(SUPPORT_OUTPUTDIR)/demo/image/%, $(JDK_IMAGE_DIR)/demo/%, \
446      $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demo/image \
447          ! \( -name "_the*" -o -name "javac_state" \) )))
448
449  JDK_TARGETS += $(JDK_DEMO_TARGETS)
450endif
451
452################################################################################
453# /sample dir
454
455$(eval $(call SetupCopyFiles,COPY_SAMPLES, \
456    SRC := $(SUPPORT_OUTPUTDIR)/sample/image, \
457    DEST := $(JDK_IMAGE_DIR)/sample, \
458    FILES := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/sample/image), \
459        $(call CacheFind,$(SUPPORT_OUTPUTDIR)/sample/image))))
460
461JDK_TARGETS += $(COPY_SAMPLES)
462
463################################################################################
464# jrt-fs.jar
465
466$(eval $(call SetupCopyFiles,COPY_JRTFS_JAR, \
467    SRC := $(SUPPORT_OUTPUTDIR), \
468    DEST := $(JDK_IMAGE_DIR), \
469    FILES := $(SUPPORT_OUTPUTDIR)/jrt-fs.jar))
470
471JDK_TARGETS += $(COPY_JRTFS_JAR)
472
473################################################################################
474# Code coverage data files
475
476ifeq ($(GCOV_ENABLED), true)
477
478  GCOV_FIND_EXPR := -type f -name "*.gcno"
479
480  $(eval $(call SetupCopyFiles,COPY_HOTSPOT_GCOV_GCNO, \
481      SRC := $(OUTPUT_ROOT), \
482      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
483      FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR) $(GCOV_FIND_EXPR))))
484
485  SYMBOLS_TARGETS += $(COPY_HOTSPOT_GCOV_GCNO)
486
487  $(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
488      SRC := $(OUTPUT_ROOT), \
489      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
490      FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))
491
492  SYMBOLS_TARGETS += $(COPY_JDK_GCOV_GCNO)
493
494endif
495
496################################################################################
497
498# Include custom post hook here to make it possible to augment the target lists
499# before actual target prerequisites are declared.
500$(eval $(call IncludeCustomExtension, , Images-post.gmk))
501
502################################################################################
503
504$(JRE_TARGETS): $(TOOL_JRE_TARGETS)
505$(JDK_TARGETS): $(TOOL_JDK_TARGETS)
506
507jimages: $(TOOL_JRE_TARGETS) $(TOOL_JDK_TARGETS) $(JRE_TARGETS) $(JDK_TARGETS) \
508    $(SYMBOLS_TARGETS)
509
510
511$(JRE_COMPACT1_TARGETS): $(TOOL_JRE_COMPACT1_TARGETS)
512$(JRE_COMPACT2_TARGETS): $(TOOL_JRE_COMPACT2_TARGETS)
513$(JRE_COMPACT3_TARGETS): $(TOOL_JRE_COMPACT3_TARGETS)
514
515profiles: $(TOOL_JRE_COMPACT1_TARGETS) \
516    $(TOOL_JRE_COMPACT2_TARGETS) \
517    $(TOOL_JRE_COMPACT3_TARGETS) \
518    $(JRE_COMPACT1_TARGETS) \
519    $(JRE_COMPACT2_TARGETS) \
520    $(JRE_COMPACT3_TARGETS)
521
522.PHONY: default all jimages profiles
523