1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/Jprt.gmk Wed Apr 27 01:39:08 2016 +0800 1.3 @@ -0,0 +1,254 @@ 1.4 +# 1.5 +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. Oracle designates this 1.11 +# particular file as subject to the "Classpath" exception as provided 1.12 +# by Oracle in the LICENSE file that accompanied this code. 1.13 +# 1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 +# version 2 for more details (a copy is included in the LICENSE file that 1.18 +# accompanied this code). 1.19 +# 1.20 +# You should have received a copy of the GNU General Public License version 1.21 +# 2 along with this work; if not, write to the Free Software Foundation, 1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 +# 1.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 +# or visit www.oracle.com if you need additional information or have any 1.26 +# questions. 1.27 +# 1.28 + 1.29 +# This file is included by the root NewerMakefile and contains targets 1.30 +# and utilities needed by JPRT. 1.31 + 1.32 +# Utilities used in this Makefile. Most of this makefile executes without 1.33 +# the context of a spec file from configure. 1.34 +CAT=cat 1.35 +CMP=cmp 1.36 +CP=cp 1.37 +ECHO=echo 1.38 +MKDIR=mkdir 1.39 +PRINTF=printf 1.40 +PWD=pwd 1.41 +# Insure we have a path that looks like it came from pwd 1.42 +# (This is mostly for Windows sake and drive letters) 1.43 +define UnixPath # path 1.44 +$(shell (cd "$1" && $(PWD))) 1.45 +endef 1.46 + 1.47 +BUILD_DIR_ROOT:=$(root_dir)/build 1.48 + 1.49 +ifdef OPENJDK 1.50 + OPEN_BUILD=true 1.51 +else 1.52 + OPEN_BUILD := $(if $(or $(wildcard $(root_dir)/jdk/src/closed), \ 1.53 + $(wildcard $(root_dir)/jdk/make/closed), \ 1.54 + $(wildcard $(root_dir)/jdk/test/closed), \ 1.55 + $(wildcard $(root_dir)/hotspot/src/closed), \ 1.56 + $(wildcard $(root_dir)/hotspot/make/closed), \ 1.57 + $(wildcard $(root_dir)/hotspot/test/closed)), \ 1.58 + false,true) 1.59 +endif 1.60 + 1.61 +HOTSPOT_AVAILABLE := $(if $(wildcard $(root_dir)/hotspot),true,false) 1.62 + 1.63 +########################################################################### 1.64 +# To help in adoption of the new configure&&make build process, a bridge 1.65 +# build will use the old settings to run configure and do the build. 1.66 + 1.67 +# Build with the configure bridge. After running configure, restart make 1.68 +# to parse the new spec file. 1.69 +BRIDGE_TARGETS := all 1.70 +# Add bootcycle-images target if legacy variable is set. 1.71 +ifeq ($(SKIP_BOOT_CYCLE),false) 1.72 + BRIDGE_TARGETS += bootcycle-images 1.73 +endif 1.74 +bridgeBuild: bridge2configure 1.75 + @cd $(root_dir) && $(MAKE) -f Makefile $(BRIDGE_TARGETS) 1.76 + 1.77 +# Bridge from old Makefile ALT settings to configure options 1.78 +bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts 1.79 + bash ./configure $(strip $(shell $(CAT) $<)) 1.80 + 1.81 +# Create a file with configure options created from old Makefile mechanisms. 1.82 +$(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest 1.83 + $(RM) $@ 1.84 + $(CP) $< $@ 1.85 + 1.86 +# Use this file to only change when obvious things have changed 1.87 +$(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC 1.88 + $(RM) $@.tmp 1.89 + $(MKDIR) -p $(BUILD_DIR_ROOT) 1.90 + @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp 1.91 + ifdef ARCH_DATA_MODEL 1.92 + @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp 1.93 + endif 1.94 + ifeq ($(ARCH_DATA_MODEL),32) 1.95 + @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp 1.96 + endif 1.97 + ifdef ALT_PARALLEL_COMPILE_JOBS 1.98 + @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp 1.99 + endif 1.100 + ifdef ALT_BOOTDIR 1.101 + @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp 1.102 + endif 1.103 + ifdef ALT_CUPS_HEADERS_PATH 1.104 + @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp 1.105 + endif 1.106 + ifdef ALT_FREETYPE_HEADERS_PATH 1.107 + @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp 1.108 + endif 1.109 + ifdef ENABLE_SJAVAC 1.110 + @$(ECHO) " --enable-sjavac" >> $@.tmp 1.111 + endif 1.112 + ifdef JDK_UPDATE_VERSION 1.113 + @$(ECHO) " --with-update-version=$(JDK_UPDATE_VERSION)" >> $@.tmp 1.114 + endif 1.115 + ifeq ($(HOTSPOT_AVAILABLE),false) 1.116 + ifdef ALT_JDK_IMPORT_PATH 1.117 + @$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> $@.tmp 1.118 + endif 1.119 + endif 1.120 + ifeq ($(OPEN_BUILD),true) 1.121 + @$(ECHO) " --enable-openjdk-only " >> $@.tmp 1.122 + else 1.123 +# Todo: move to closed? 1.124 + ifdef ALT_MOZILLA_HEADERS_PATH 1.125 + @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp 1.126 + endif 1.127 + ifdef ALT_JUNIT_DIR 1.128 + @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp 1.129 + endif 1.130 + ifdef ANT_HOME 1.131 + @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp 1.132 + endif 1.133 + ifdef ALT_JAVAFX_ZIP_DIR 1.134 + @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp 1.135 + endif 1.136 + ifdef ALT_JMC_ZIP_DIR 1.137 + @$(ECHO) " --with-jmc-zip-dir=$(call UnixPath,$(ALT_JMC_ZIP_DIR)) " >> $@.tmp 1.138 + endif 1.139 + ifdef ALT_WIXDIR 1.140 + @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp 1.141 + endif 1.142 + ifdef ALT_INSTALL_LZMA_PATH 1.143 + @$(ECHO) " --with-lzma-path=$(call UnixPath,$(ALT_INSTALL_LZMA_PATH)) " >> $@.tmp 1.144 + endif 1.145 + ifdef ALT_INSTALL_UPX_PATH 1.146 + @$(ECHO) " --with-upx-path=$(call UnixPath,$(ALT_INSTALL_UPX_PATH)) " >> $@.tmp 1.147 + endif 1.148 + ifdef ALT_INSTALL_UPX_FILENAME 1.149 + @$(ECHO) " --with-upx-filename=$(call UnixPath,$(ALT_INSTALL_UPX_FILENAME)) " >> $@.tmp 1.150 + endif 1.151 + ifdef ALT_BSDIFF_DIR 1.152 + @$(ECHO) " --with-bsdiff-dir=$(call UnixPath,$(ALT_BSDIFF_DIR)) " >> $@.tmp 1.153 + endif 1.154 + ifdef ALT_CCSS_SIGNING_DIR 1.155 + @$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp 1.156 + endif 1.157 + ifdef ALT_SLASH_JAVA 1.158 + @$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp 1.159 + endif 1.160 + ifdef ALT_SPARKLE_FRAMEWORK_DIR 1.161 + @$(ECHO) " --with-sparkle-framework=$(call UnixPath,$(ALT_SPARKLE_FRAMEWORK_DIR)) " >> $@.tmp 1.162 + endif 1.163 + endif 1.164 + @if [ -f $@ ] ; then \ 1.165 + if ! $(CMP) $@ $@.tmp > /dev/null ; then \ 1.166 + $(CP) $@.tmp $@ ; \ 1.167 + fi ; \ 1.168 + else \ 1.169 + $(CP) $@.tmp $@ ; \ 1.170 + fi 1.171 + $(RM) $@.tmp 1.172 + 1.173 +PHONY_LIST += bridge2configure bridgeBuild 1.174 + 1.175 +########################################################################### 1.176 +# JPRT targets 1.177 + 1.178 +ifndef JPRT_ARCHIVE_BUNDLE 1.179 + JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip 1.180 +endif 1.181 +ifndef JPRT_ARCHIVE_INSTALL_BUNDLE 1.182 + JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip 1.183 +endif 1.184 + 1.185 +# These targets execute in a SPEC free context, before calling bridgeBuild 1.186 +# to generate the SPEC. 1.187 +jprt_build_product: DEBUG_LEVEL=release 1.188 +jprt_build_product: BUILD_DIRNAME=*-release 1.189 +jprt_build_product: jprt_build_generic 1.190 + 1.191 +jprt_build_fastdebug: DEBUG_LEVEL=fastdebug 1.192 +jprt_build_fastdebug: BUILD_DIRNAME=*-fastdebug 1.193 +jprt_build_fastdebug: jprt_build_generic 1.194 + 1.195 +jprt_build_debug: DEBUG_LEVEL=slowdebug 1.196 +jprt_build_debug: BUILD_DIRNAME=*-debug 1.197 +jprt_build_debug: jprt_build_generic 1.198 + 1.199 +jprt_build_generic: BRIDGE_TARGETS+=jprt_bundle 1.200 +jprt_build_generic: bridgeBuild 1.201 + 1.202 +# This target must be called in the context of a SPEC file 1.203 +jprt_bundle: $(JPRT_ARCHIVE_BUNDLE) 1.204 + @$(call CheckIfMakeAtEnd) 1.205 + 1.206 +# This target must be called in the context of a SPEC file 1.207 +$(JPRT_ARCHIVE_BUNDLE): bundles 1.208 + $(MKDIR) -p $(@D) 1.209 + $(RM) $@ 1.210 + $(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@ 1.211 + 1.212 +SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR) 1.213 +SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR) 1.214 +SRC_JDK_BUNDLE_DIR := $(JDK_BUNDLE_DIR) 1.215 +SRC_JRE_BUNDLE_DIR := $(JRE_BUNDLE_DIR) 1.216 + 1.217 +# Bundle up the images 1.218 +bundles: all bundles-only 1.219 +bundles-only: start-make 1.220 + @$(call TargetEnter) 1.221 + $(MKDIR) -p $(BUILD_OUTPUT)/bundles 1.222 + $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip . 1.223 + $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip . 1.224 + if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \ 1.225 + $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \ 1.226 + fi 1.227 + @$(call TargetExit) 1.228 + 1.229 +# Copy images to one unified location regardless of platform etc. 1.230 +final-images: all final-images-only 1.231 +final-images-only: start-make 1.232 + @$(call TargetEnter) 1.233 + $(RM) -r $(BUILD_OUTPUT)/final-images 1.234 + $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR) 1.235 + $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR) 1.236 + $(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/ 1.237 + $(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/ 1.238 + ifeq ($(OPENJDK_TARGET_OS),macosx) 1.239 + $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR) 1.240 + $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR) 1.241 + $(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/ 1.242 + $(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/ 1.243 + endif 1.244 + @$(call TargetExit) 1.245 + 1.246 + 1.247 +# Keep track of phony targets 1.248 +PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \ 1.249 + jprt_build_generic bundles jprt_bundle \ 1.250 + final-images final-images-only 1.251 + 1.252 +########################################################################### 1.253 +# Phony targets 1.254 +.PHONY: $(PHONY_LIST) 1.255 + 1.256 +# Force target 1.257 +FRC: