1 #
   2 # Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 # This file is contains targets utilities needed by JPRT.
  27 
  28 ifndef JPRT_ARCHIVE_BUNDLE
  29   JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip
  30 endif
  31 ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
  32   JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
  33 endif
  34 
  35 ifeq ($(SKIP_BOOT_CYCLE), false)
  36 jprt_bundle: bootcycle-images
  37 endif
  38 
  39 # This target must be called in the context of a SPEC file
  40 jprt_bundle: $(JPRT_ARCHIVE_BUNDLE)
  41         @$(call CheckIfMakeAtEnd)
  42 
  43 # This target must be called in the context of a SPEC file
  44 $(JPRT_ARCHIVE_BUNDLE): bundles
  45         $(MKDIR) -p $(@D)
  46         $(RM) $@
  47         $(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@
  48 
  49 SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
  50 SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
  51 SRC_JDK_BUNDLE_DIR := $(JDK_BUNDLE_DIR)
  52 SRC_JRE_BUNDLE_DIR := $(JRE_BUNDLE_DIR)
  53 
  54 # Bundle up the images
  55 bundles: all bundles-only
  56 bundles-only: start-make
  57         @$(call TargetEnter)
  58         $(MKDIR) -p $(BUILD_OUTPUT)/bundles
  59         $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
  60         $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
  61         if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
  62           $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
  63         fi
  64         @$(call TargetExit)
  65 
  66 # Copy images to one unified location regardless of platform etc.
  67 final-images: all final-images-only
  68 final-images-only: start-make
  69         @$(call TargetEnter)
  70         $(RM) -r $(BUILD_OUTPUT)/final-images
  71         $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)
  72         $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)
  73         $(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/
  74         $(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/
  75         ifeq ($(OPENJDK_TARGET_OS),macosx)
  76           $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)
  77           $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)
  78           $(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/
  79           $(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/
  80         endif
  81         @$(call TargetExit)
  82 
  83 
  84 ###########################################################################
  85 # Phony targets
  86 .PHONY: jprt_bundle bundles bundles-only final-images final-images-only