make/Jprt.gmk

Thu, 11 Sep 2014 11:38:23 -0700

author
asaha
date
Thu, 11 Sep 2014 11:38:23 -0700
changeset 1228
919a55b747bf
parent 1129
09eaef69f384
child 1133
50aaf272884f
child 1174
6cb876613230
permissions
-rw-r--r--

Merge

erikj@559 1 #
ksrini@806 2 # Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
erikj@559 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
erikj@559 4 #
erikj@559 5 # This code is free software; you can redistribute it and/or modify it
erikj@559 6 # under the terms of the GNU General Public License version 2 only, as
erikj@559 7 # published by the Free Software Foundation. Oracle designates this
erikj@559 8 # particular file as subject to the "Classpath" exception as provided
erikj@559 9 # by Oracle in the LICENSE file that accompanied this code.
erikj@559 10 #
erikj@559 11 # This code is distributed in the hope that it will be useful, but WITHOUT
erikj@559 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
erikj@559 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
erikj@559 14 # version 2 for more details (a copy is included in the LICENSE file that
erikj@559 15 # accompanied this code).
erikj@559 16 #
erikj@559 17 # You should have received a copy of the GNU General Public License version
erikj@559 18 # 2 along with this work; if not, write to the Free Software Foundation,
erikj@559 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
erikj@559 20 #
erikj@559 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
erikj@559 22 # or visit www.oracle.com if you need additional information or have any
erikj@559 23 # questions.
erikj@559 24 #
erikj@559 25
ihse@839 26 # This file is included by the root NewerMakefile and contains targets
erikj@559 27 # and utilities needed by JPRT.
erikj@559 28
erikj@578 29 # Utilities used in this Makefile. Most of this makefile executes without
erikj@578 30 # the context of a spec file from configure.
erikj@559 31 CAT=cat
erikj@559 32 CMP=cmp
erikj@559 33 CP=cp
erikj@559 34 ECHO=echo
erikj@559 35 MKDIR=mkdir
erikj@559 36 PRINTF=printf
erikj@559 37 PWD=pwd
erikj@559 38 # Insure we have a path that looks like it came from pwd
ihse@839 39 # (This is mostly for Windows sake and drive letters)
erikj@559 40 define UnixPath # path
erikj@559 41 $(shell (cd "$1" && $(PWD)))
erikj@559 42 endef
erikj@559 43
erikj@559 44 BUILD_DIR_ROOT:=$(root_dir)/build
erikj@559 45
erikj@567 46 ifdef OPENJDK
erikj@567 47 OPEN_BUILD=true
erikj@588 48 else
erikj@588 49 OPEN_BUILD := $(if $(or $(wildcard $(root_dir)/jdk/src/closed), \
ihse@839 50 $(wildcard $(root_dir)/jdk/make/closed), \
ihse@839 51 $(wildcard $(root_dir)/jdk/test/closed), \
ihse@839 52 $(wildcard $(root_dir)/hotspot/src/closed), \
ihse@839 53 $(wildcard $(root_dir)/hotspot/make/closed), \
ihse@839 54 $(wildcard $(root_dir)/hotspot/test/closed)), \
ihse@839 55 false,true)
erikj@567 56 endif
erikj@567 57
erikj@588 58 HOTSPOT_AVAILABLE := $(if $(wildcard $(root_dir)/hotspot),true,false)
erikj@588 59
erikj@559 60 ###########################################################################
erikj@559 61 # To help in adoption of the new configure&&make build process, a bridge
ihse@839 62 # build will use the old settings to run configure and do the build.
erikj@559 63
erikj@559 64 # Build with the configure bridge. After running configure, restart make
erikj@559 65 # to parse the new spec file.
erikj@559 66 BRIDGE_TARGETS := all
erikj@668 67 # Add bootcycle-images target if legacy variable is set.
erikj@668 68 ifeq ($(SKIP_BOOT_CYCLE),false)
erikj@668 69 BRIDGE_TARGETS += bootcycle-images
erikj@668 70 endif
erikj@559 71 bridgeBuild: bridge2configure
ihse@912 72 @cd $(root_dir) && $(MAKE) -f Makefile $(BRIDGE_TARGETS)
erikj@559 73
erikj@559 74 # Bridge from old Makefile ALT settings to configure options
erikj@559 75 bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts
erikj@559 76 bash ./configure $(strip $(shell $(CAT) $<))
erikj@559 77
erikj@559 78 # Create a file with configure options created from old Makefile mechanisms.
erikj@559 79 $(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest
erikj@559 80 $(RM) $@
erikj@559 81 $(CP) $< $@
erikj@559 82
erikj@559 83 # Use this file to only change when obvious things have changed
erikj@559 84 $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC
erikj@559 85 $(RM) $@.tmp
erikj@559 86 $(MKDIR) -p $(BUILD_DIR_ROOT)
erikj@559 87 @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp
ihse@839 88 ifdef ARCH_DATA_MODEL
ihse@839 89 @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp
ihse@839 90 endif
ihse@839 91 ifeq ($(ARCH_DATA_MODEL),32)
ihse@839 92 @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp
ihse@839 93 endif
ihse@839 94 ifdef ALT_PARALLEL_COMPILE_JOBS
ihse@839 95 @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp
ihse@839 96 endif
ihse@839 97 ifdef ALT_BOOTDIR
ihse@839 98 @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp
ihse@839 99 endif
ihse@839 100 ifdef ALT_CUPS_HEADERS_PATH
ihse@839 101 @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp
ihse@839 102 endif
ihse@839 103 ifdef ALT_FREETYPE_HEADERS_PATH
ihse@839 104 @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp
ihse@839 105 endif
ihse@839 106 ifdef ENABLE_SJAVAC
ihse@839 107 @$(ECHO) " --enable-sjavac" >> $@.tmp
ihse@839 108 endif
erikj@983 109 ifdef JDK_UPDATE_VERSION
erikj@983 110 @$(ECHO) " --with-update-version=$(JDK_UPDATE_VERSION)" >> $@.tmp
erikj@983 111 endif
ihse@839 112 ifeq ($(HOTSPOT_AVAILABLE),false)
ihse@839 113 ifdef ALT_JDK_IMPORT_PATH
ihse@839 114 @$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> $@.tmp
ihse@839 115 endif
ihse@839 116 endif
ihse@839 117 ifeq ($(OPEN_BUILD),true)
ihse@839 118 @$(ECHO) " --enable-openjdk-only " >> $@.tmp
ihse@839 119 else
ihse@839 120 # Todo: move to closed?
ihse@839 121 ifdef ALT_MOZILLA_HEADERS_PATH
ihse@839 122 @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp
ihse@839 123 endif
ihse@839 124 ifdef ALT_JUNIT_DIR
ihse@839 125 @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp
ihse@839 126 endif
ihse@839 127 ifdef ANT_HOME
ihse@839 128 @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp
ihse@839 129 endif
ihse@839 130 ifdef ALT_JAVAFX_ZIP_DIR
ihse@839 131 @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp
ihse@839 132 endif
ihse@839 133 ifdef ALT_JMC_ZIP_DIR
ihse@839 134 @$(ECHO) " --with-jmc-zip-dir=$(call UnixPath,$(ALT_JMC_ZIP_DIR)) " >> $@.tmp
ihse@839 135 endif
ihse@839 136 ifdef ALT_WIXDIR
ihse@839 137 @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp
ihse@839 138 endif
ihse@839 139 ifdef ALT_INSTALL_LZMA_PATH
ihse@839 140 @$(ECHO) " --with-lzma-path=$(call UnixPath,$(ALT_INSTALL_LZMA_PATH)) " >> $@.tmp
ihse@839 141 endif
ihse@839 142 ifdef ALT_INSTALL_UPX_PATH
ihse@839 143 @$(ECHO) " --with-upx-path=$(call UnixPath,$(ALT_INSTALL_UPX_PATH)) " >> $@.tmp
ihse@839 144 endif
ihse@839 145 ifdef ALT_INSTALL_UPX_FILENAME
ihse@839 146 @$(ECHO) " --with-upx-filename=$(call UnixPath,$(ALT_INSTALL_UPX_FILENAME)) " >> $@.tmp
ihse@839 147 endif
asaha@1129 148 ifdef ALT_BSDIFF_DIR
asaha@1129 149 @$(ECHO) " --with-bsdiff-dir=$(call UnixPath,$(ALT_BSDIFF_DIR)) " >> $@.tmp
asaha@1129 150 endif
ihse@839 151 ifdef ALT_CCSS_SIGNING_DIR
ihse@839 152 @$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp
ihse@839 153 endif
ihse@839 154 ifdef ALT_SLASH_JAVA
ihse@839 155 @$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp
ihse@839 156 endif
ihse@839 157 ifdef ALT_SPARKLE_FRAMEWORK_DIR
ihse@839 158 @$(ECHO) " --with-sparkle-framework=$(call UnixPath,$(ALT_SPARKLE_FRAMEWORK_DIR)) " >> $@.tmp
ihse@839 159 endif
ihse@839 160 endif
erikj@559 161 @if [ -f $@ ] ; then \
ihse@839 162 if ! $(CMP) $@ $@.tmp > /dev/null ; then \
ihse@839 163 $(CP) $@.tmp $@ ; \
ihse@839 164 fi ; \
ihse@839 165 else \
ihse@839 166 $(CP) $@.tmp $@ ; \
ihse@839 167 fi
erikj@559 168 $(RM) $@.tmp
erikj@559 169
erikj@559 170 PHONY_LIST += bridge2configure bridgeBuild
erikj@559 171
erikj@559 172 ###########################################################################
erikj@559 173 # JPRT targets
erikj@559 174
erikj@559 175 ifndef JPRT_ARCHIVE_BUNDLE
erikj@559 176 JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip
erikj@559 177 endif
tbell@589 178 ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
ihse@839 179 JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
tbell@589 180 endif
erikj@559 181
erikj@559 182 # These targets execute in a SPEC free context, before calling bridgeBuild
erikj@559 183 # to generate the SPEC.
erikj@559 184 jprt_build_product: DEBUG_LEVEL=release
erikj@559 185 jprt_build_product: BUILD_DIRNAME=*-release
erikj@559 186 jprt_build_product: jprt_build_generic
erikj@559 187
erikj@559 188 jprt_build_fastdebug: DEBUG_LEVEL=fastdebug
erikj@559 189 jprt_build_fastdebug: BUILD_DIRNAME=*-fastdebug
erikj@559 190 jprt_build_fastdebug: jprt_build_generic
erikj@559 191
erikj@559 192 jprt_build_debug: DEBUG_LEVEL=slowdebug
erikj@559 193 jprt_build_debug: BUILD_DIRNAME=*-debug
erikj@559 194 jprt_build_debug: jprt_build_generic
erikj@559 195
erikj@559 196 jprt_build_generic: BRIDGE_TARGETS+=jprt_bundle
erikj@559 197 jprt_build_generic: bridgeBuild
erikj@559 198
erikj@559 199 # This target must be called in the context of a SPEC file
erikj@559 200 jprt_bundle: $(JPRT_ARCHIVE_BUNDLE)
erikj@559 201 @$(call CheckIfMakeAtEnd)
erikj@559 202
erikj@559 203 # This target must be called in the context of a SPEC file
erikj@559 204 $(JPRT_ARCHIVE_BUNDLE): bundles
erikj@559 205 $(MKDIR) -p $(@D)
erikj@559 206 $(RM) $@
erikj@610 207 $(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@
erikj@559 208
ksrini@806 209 SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
ksrini@806 210 SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
erikj@610 211 SRC_JDK_BUNDLE_DIR := $(JDK_BUNDLE_DIR)
erikj@610 212 SRC_JRE_BUNDLE_DIR := $(JRE_BUNDLE_DIR)
erikj@610 213
erikj@610 214 # Bundle up the images
erikj@610 215 bundles: all bundles-only
erikj@610 216 bundles-only: start-make
erikj@559 217 @$(call TargetEnter)
erikj@559 218 $(MKDIR) -p $(BUILD_OUTPUT)/bundles
ksrini@806 219 $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
ksrini@806 220 $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
ihse@839 221 if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
ihse@839 222 $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
ihse@839 223 fi
erikj@610 224 @$(call TargetExit)
erikj@610 225
erikj@610 226 # Copy images to one unified location regardless of platform etc.
erikj@610 227 final-images: all final-images-only
erikj@610 228 final-images-only: start-make
erikj@610 229 @$(call TargetEnter)
erikj@610 230 $(RM) -r $(BUILD_OUTPUT)/final-images
erikj@610 231 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)
erikj@610 232 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)
erikj@610 233 $(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/
erikj@610 234 $(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/
ihse@839 235 ifeq ($(OPENJDK_TARGET_OS),macosx)
ihse@839 236 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)
ihse@839 237 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)
ihse@839 238 $(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/
ihse@839 239 $(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/
ihse@839 240 endif
erikj@559 241 @$(call TargetExit)
erikj@559 242
erikj@610 243
erikj@559 244 # Keep track of phony targets
erikj@559 245 PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \
ihse@839 246 jprt_build_generic bundles jprt_bundle \
ihse@839 247 final-images final-images-only
erikj@559 248
erikj@559 249 ###########################################################################
erikj@559 250 # Phony targets
erikj@559 251 .PHONY: $(PHONY_LIST)
erikj@559 252
erikj@559 253 # Force target
erikj@559 254 FRC:

mercurial