erikj@559: # erikj@559: # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. erikj@559: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. erikj@559: # erikj@559: # This code is free software; you can redistribute it and/or modify it erikj@559: # under the terms of the GNU General Public License version 2 only, as erikj@559: # published by the Free Software Foundation. Oracle designates this erikj@559: # particular file as subject to the "Classpath" exception as provided erikj@559: # by Oracle in the LICENSE file that accompanied this code. erikj@559: # erikj@559: # This code is distributed in the hope that it will be useful, but WITHOUT erikj@559: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or erikj@559: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License erikj@559: # version 2 for more details (a copy is included in the LICENSE file that erikj@559: # accompanied this code). erikj@559: # erikj@559: # You should have received a copy of the GNU General Public License version erikj@559: # 2 along with this work; if not, write to the Free Software Foundation, erikj@559: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. erikj@559: # erikj@559: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA erikj@559: # or visit www.oracle.com if you need additional information or have any erikj@559: # questions. erikj@559: # erikj@559: erikj@559: # This file is included by the root NewerMakefile and contains targets erikj@559: # and utilities needed by JPRT. erikj@559: erikj@578: # Utilities used in this Makefile. Most of this makefile executes without erikj@578: # the context of a spec file from configure. erikj@559: CAT=cat erikj@559: CMP=cmp erikj@559: CP=cp erikj@559: ECHO=echo erikj@559: MKDIR=mkdir erikj@559: PRINTF=printf erikj@559: PWD=pwd erikj@559: # Insure we have a path that looks like it came from pwd erikj@559: # (This is mostly for Windows sake and drive letters) erikj@559: define UnixPath # path erikj@559: $(shell (cd "$1" && $(PWD))) erikj@559: endef erikj@559: erikj@559: BUILD_DIR_ROOT:=$(root_dir)/build erikj@559: erikj@567: ifdef OPENJDK erikj@567: OPEN_BUILD=true erikj@588: else erikj@588: OPEN_BUILD := $(if $(or $(wildcard $(root_dir)/jdk/src/closed), \ erikj@588: $(wildcard $(root_dir)/jdk/make/closed), \ erikj@588: $(wildcard $(root_dir)/jdk/test/closed), \ erikj@588: $(wildcard $(root_dir)/hotspot/src/closed), \ erikj@588: $(wildcard $(root_dir)/hotspot/make/closed), \ erikj@588: $(wildcard $(root_dir)/hotspot/test/closed)), \ erikj@588: false,true) erikj@567: endif erikj@567: erikj@588: HOTSPOT_AVAILABLE := $(if $(wildcard $(root_dir)/hotspot),true,false) erikj@588: erikj@559: ########################################################################### erikj@559: # To help in adoption of the new configure&&make build process, a bridge erikj@559: # build will use the old settings to run configure and do the build. erikj@559: erikj@559: # Build with the configure bridge. After running configure, restart make erikj@559: # to parse the new spec file. erikj@559: BRIDGE_TARGETS := all erikj@559: bridgeBuild: bridge2configure erikj@559: @cd $(root_dir) && $(MAKE) -f NewMakefile.gmk $(BRIDGE_TARGETS) erikj@559: erikj@559: # Bridge from old Makefile ALT settings to configure options erikj@559: bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts erikj@559: bash ./configure $(strip $(shell $(CAT) $<)) erikj@559: erikj@559: # Create a file with configure options created from old Makefile mechanisms. erikj@559: $(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest erikj@559: $(RM) $@ erikj@559: $(CP) $< $@ erikj@559: erikj@559: # Use this file to only change when obvious things have changed erikj@559: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC erikj@559: $(RM) $@.tmp erikj@559: $(MKDIR) -p $(BUILD_DIR_ROOT) erikj@559: @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp erikj@559: ifdef ARCH_DATA_MODEL erikj@559: @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp erikj@559: endif erikj@559: ifeq ($(ARCH_DATA_MODEL),32) erikj@559: @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp erikj@559: endif erikj@559: ifdef ALT_PARALLEL_COMPILE_JOBS erikj@559: @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp erikj@559: endif erikj@559: ifdef ALT_BOOTDIR erikj@559: @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp erikj@559: endif erikj@559: ifdef ALT_CUPS_HEADERS_PATH erikj@559: @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp erikj@559: endif erikj@559: ifdef ALT_FREETYPE_HEADERS_PATH erikj@559: @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp erikj@559: endif erikj@588: ifeq ($(HOTSPOT_AVAILABLE),false) erikj@588: ifdef ALT_JDK_IMPORT_PATH erikj@588: @$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> $@.tmp erikj@588: endif erikj@588: endif erikj@567: ifeq ($(OPEN_BUILD),true) erikj@559: @$(ECHO) " --enable-openjdk-only " >> $@.tmp erikj@567: else erikj@567: # Todo: move to closed? erikj@567: ifdef ALT_MOZILLA_HEADERS_PATH erikj@559: @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp erikj@567: endif erikj@567: ifdef ALT_JUNIT_DIR erikj@559: @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp erikj@567: endif erikj@567: ifdef ANT_HOME erikj@559: @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp erikj@567: endif erikj@567: ifdef ALT_JAVAFX_ZIP_DIR erikj@564: @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp erikj@567: endif erikj@567: ifdef ALT_WIXDIR erikj@564: @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp erikj@567: endif erikj@567: ifdef ALT_CCSS_SIGNING_DIR erikj@564: @$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp erikj@567: endif erikj@567: ifdef ALT_SLASH_JAVA erikj@559: @$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp erikj@567: endif erikj@587: ifdef ALT_SPARKLE_FRAMEWORK_DIR erikj@587: @$(ECHO) " --with-sparkle-framework=$(call UnixPath,$(ALT_SPARKLE_FRAMEWORK_DIR)) " >> $@.tmp erikj@587: endif erikj@559: endif erikj@559: @if [ -f $@ ] ; then \ erikj@559: if ! $(CMP) $@ $@.tmp > /dev/null ; then \ erikj@559: $(CP) $@.tmp $@ ; \ erikj@559: fi ; \ erikj@559: else \ erikj@559: $(CP) $@.tmp $@ ; \ erikj@559: fi erikj@559: $(RM) $@.tmp erikj@559: erikj@559: PHONY_LIST += bridge2configure bridgeBuild erikj@559: erikj@559: ########################################################################### erikj@559: # JPRT targets erikj@559: erikj@559: ifndef JPRT_ARCHIVE_BUNDLE erikj@559: JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip erikj@559: endif tbell@589: ifndef JPRT_ARCHIVE_INSTALL_BUNDLE tbell@589: JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip tbell@589: endif erikj@559: erikj@559: # These targets execute in a SPEC free context, before calling bridgeBuild erikj@559: # to generate the SPEC. erikj@559: jprt_build_product: DEBUG_LEVEL=release erikj@559: jprt_build_product: BUILD_DIRNAME=*-release erikj@559: jprt_build_product: jprt_build_generic erikj@559: erikj@559: jprt_build_fastdebug: DEBUG_LEVEL=fastdebug erikj@559: jprt_build_fastdebug: BUILD_DIRNAME=*-fastdebug erikj@559: jprt_build_fastdebug: jprt_build_generic erikj@559: erikj@559: jprt_build_debug: DEBUG_LEVEL=slowdebug erikj@559: jprt_build_debug: BUILD_DIRNAME=*-debug erikj@559: jprt_build_debug: jprt_build_generic erikj@559: erikj@559: jprt_build_generic: BRIDGE_TARGETS+=jprt_bundle erikj@559: jprt_build_generic: bridgeBuild erikj@559: erikj@559: # This target must be called in the context of a SPEC file erikj@559: jprt_bundle: $(JPRT_ARCHIVE_BUNDLE) erikj@559: @$(call CheckIfMakeAtEnd) erikj@559: erikj@559: # This target must be called in the context of a SPEC file erikj@559: $(JPRT_ARCHIVE_BUNDLE): bundles erikj@559: $(MKDIR) -p $(@D) erikj@559: $(RM) $@ erikj@610: $(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@ erikj@559: erikj@610: ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64) erikj@610: SRC_JDK_IMAGE_DIR := $(JDK_OVERLAY_IMAGE_DIR) erikj@610: SRC_JRE_IMAGE_DIR := $(JRE_OVERLAY_IMAGE_DIR) erikj@610: else erikj@610: SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR) erikj@610: SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR) erikj@610: endif erikj@610: SRC_JDK_BUNDLE_DIR := $(JDK_BUNDLE_DIR) erikj@610: SRC_JRE_BUNDLE_DIR := $(JRE_BUNDLE_DIR) erikj@610: erikj@610: # Bundle up the images erikj@610: bundles: all bundles-only erikj@610: bundles-only: start-make erikj@559: @$(call TargetEnter) erikj@559: $(MKDIR) -p $(BUILD_OUTPUT)/bundles erikj@610: $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip . erikj@610: $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip . tbell@589: if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \ tbell@589: $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \ tbell@589: fi erikj@610: @$(call TargetExit) erikj@610: erikj@610: # Copy images to one unified location regardless of platform etc. erikj@610: final-images: all final-images-only erikj@610: final-images-only: start-make erikj@610: @$(call TargetEnter) erikj@610: $(RM) -r $(BUILD_OUTPUT)/final-images erikj@610: $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR) erikj@610: $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR) erikj@610: $(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/ erikj@610: $(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/ erikj@610: ifeq ($(OPENJDK_TARGET_OS),macosx) erikj@610: $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR) erikj@610: $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR) erikj@610: $(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/ erikj@610: $(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/ erikj@578: endif erikj@559: @$(call TargetExit) erikj@559: erikj@610: erikj@559: # Keep track of phony targets erikj@559: PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \ erikj@610: jprt_build_generic bundles jprt_bundle \ erikj@610: final-images final-images-only erikj@559: erikj@559: ########################################################################### erikj@559: # Phony targets erikj@559: .PHONY: $(PHONY_LIST) erikj@559: erikj@559: # Force target erikj@559: FRC: