annotate makefiles/Images.gmk @ 9040:f8b097b01270

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