make/Jprt.gmk
changeset 38707 1b9837ca28f4
parent 37972 e1fa5c2e62a0
child 41458 f285e333e8db
equal deleted inserted replaced
38706:01e5e74d3e4e 38707:1b9837ca28f4
    30   # If we get JPRT_ARCHIVE_*BUNDLE externally, make sure they have /cygdrive
    30   # If we get JPRT_ARCHIVE_*BUNDLE externally, make sure they have /cygdrive
    31   # style paths
    31   # style paths
    32   ifdef JPRT_ARCHIVE_BUNDLE
    32   ifdef JPRT_ARCHIVE_BUNDLE
    33     override JPRT_ARCHIVE_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_BUNDLE))
    33     override JPRT_ARCHIVE_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_BUNDLE))
    34   endif
    34   endif
    35   ifdef JPRT_ARCHIVE_INSTALL_BUNDLE
       
    36     override JPRT_ARCHIVE_INSTALL_BUNDLE := \
       
    37         $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_INSTALL_BUNDLE))
       
    38   endif
       
    39   ifdef JPRT_ARCHIVE_MODULES_BUNDLE
       
    40     override JPRT_ARCHIVE_MODULES_BUNDLE := \
       
    41         $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_MODULES_BUNDLE))
       
    42   endif
       
    43   ifdef JPRT_ARCHIVE_TEST_BUNDLE
    35   ifdef JPRT_ARCHIVE_TEST_BUNDLE
    44     override JPRT_ARCHIVE_TEST_BUNDLE := \
    36     override JPRT_ARCHIVE_TEST_BUNDLE := \
    45         $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_TEST_BUNDLE))
    37         $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_TEST_BUNDLE))
    46   endif
    38   endif
    47   ifdef JPRT_ARCHIVE_SYMBOLS_BUNDLE
    39   ifdef JPRT_ARCHIVE_SYMBOLS_BUNDLE
    53 # When running in JPRT these will be provided. Need defaults so that this makefile
    45 # When running in JPRT these will be provided. Need defaults so that this makefile
    54 # is valid anyway.
    46 # is valid anyway.
    55 ifndef JPRT_ARCHIVE_BUNDLE
    47 ifndef JPRT_ARCHIVE_BUNDLE
    56   JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/jdk-image.zip
    48   JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/jdk-image.zip
    57 endif
    49 endif
    58 ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
       
    59   JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
       
    60 endif
       
    61 ifndef JPRT_ARCHIVE_MODULES_BUNDLE
       
    62   JPRT_ARCHIVE_MODULES_BUNDLE=/tmp/jprt_bundles/modules.zip
       
    63 endif
       
    64 ifndef JPRT_ARCHIVE_TEST_BUNDLE
    50 ifndef JPRT_ARCHIVE_TEST_BUNDLE
    65   JPRT_ARCHIVE_TEST_BUNDLE=/tmp/jprt_bundles/test-image.zip
    51   JPRT_ARCHIVE_TEST_BUNDLE=/tmp/jprt_bundles/test-image.zip
    66 endif
    52 endif
    67 ifndef JPRT_ARCHIVE_SYMBOLS_BUNDLE
    53 ifndef JPRT_ARCHIVE_SYMBOLS_BUNDLE
    68   JPRT_ARCHIVE_SYMBOLS_BUNDLE=/tmp/jprt_bundles/symbols-image.zip
    54   JPRT_ARCHIVE_SYMBOLS_BUNDLE=/tmp/jprt_bundles/symbols-image.zip
    70 
    56 
    71 ifeq ($(SKIP_BOOT_CYCLE), false)
    57 ifeq ($(SKIP_BOOT_CYCLE), false)
    72   jprt_bundle: bootcycle-images
    58   jprt_bundle: bootcycle-images
    73 endif
    59 endif
    74 
    60 
    75 # This target must be called in the context of a SPEC file
    61 ################################################################################
    76 jprt_bundle: $(JPRT_ARCHIVE_BUNDLE) $(JPRT_ARCHIVE_TEST_BUNDLE) \
    62 # JPRT specific bundling targets
    77     $(JPRT_ARCHIVE_MODULES_BUNDLE)
    63 JPRT_TARGET ?= $(DEFAULT_MAKE_TARGET)
       
    64 ifeq ($(JPRT_TARGET), $(DEFAULT_MAKE_TARGET))
       
    65   jprt_bundle: $(DEFAULT_MAKE_TARGET) $(JPRT_ARCHIVE_BUNDLE) \
       
    66       $(JPRT_ARCHIVE_TEST_BUNDLE)
    78 
    67 
    79 ifeq ($(GCOV_ENABLED), true)
    68   SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
    80   jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
    69   SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR)
    81 endif
       
    82 
    70 
    83 # This target must be called in the context of a SPEC file
    71   # This target must be called in the context of a SPEC file
    84 $(JPRT_ARCHIVE_BUNDLE): bundles
    72   $(JPRT_ARCHIVE_BUNDLE): product-images
    85 	$(MKDIR) -p $(@D)
    73 	$(call MakeDir, $(@D))
    86 	$(RM) $@
    74 	$(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $@ .
    87 	$(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@
       
    88 
    75 
    89 $(JPRT_ARCHIVE_MODULES_BUNDLE): bundles
    76   $(JPRT_ARCHIVE_TEST_BUNDLE): test-image
    90 	$(MKDIR) -p $(@D)
    77 	$(call MakeDir, $(@D))
    91 	$(RM) $@
    78 	$(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIP) -y -q -r $@ .
    92 	$(CP) $(BUILD_OUTPUT)/bundles/modules.zip $@
       
    93 
    79 
    94 $(JPRT_ARCHIVE_TEST_BUNDLE): bundles
    80   ##############################################################################
    95 	$(MKDIR) -p $(@D)
    81   # Optional symbols bundle
    96 	$(RM) $@
    82   ifeq ($(GCOV_ENABLED), true)
    97 	$(CP) $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip $@
    83     jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
       
    84     zip-bundles: $(SYMBOLS_ZIP_BUNDLE)
    98 
    85 
    99 $(JPRT_ARCHIVE_SYMBOLS_BUNDLE): bundles
    86     $(JPRT_ARCHIVE_SYMBOLS_BUNDLE): product-images
   100 	$(MKDIR) -p $(@D)
    87 	$(call MakeDir, $(@D))
   101 	$(RM) $@
    88 	$(CD) $(SYMBOLS_IMAGE_DIR) && $(ZIP) -y -q -r $@ .
   102 	$(CP) $(BUILD_OUTPUT)/bundles/$(SYMBOLS_IMAGE_SUBDIR).zip $@
       
   103 
    89 
   104 SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
    90   endif
   105 SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
       
   106 SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR)
       
   107 SRC_JDK_MACOSX_BUNDLE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
       
   108 SRC_JRE_MACOSX_BUNDLE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
       
   109 
    91 
   110 # Bundle up the images
    92   ##############################################################################
   111 JPRT_TARGET ?= default
    93 
   112 ifeq ($(JPRT_TARGET), default)
    94 else
   113   bundles: $(JPRT_TARGET)
    95   # Just fake the main bundle to satisfy JPRT
       
    96   jprt_bundle: $(JPRT_TARGET)
   114 	@$(call TargetEnter)
    97 	@$(call TargetEnter)
   115 	$(MKDIR) -p $(BUILD_OUTPUT)/bundles
    98 	$(MKDIR) -p $(BUILD_OUTPUT)/bundles
   116 	$(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r \
    99 	$(CD) $(TOPDIR) && $(TAR) cf - README | $(GZIP) > \
   117 	    $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
   100 	    $(JPRT_ARCHIVE_BUNDLE)
   118 	$(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r \
       
   119 	    $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
       
   120 	$(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIP) -y -q -r \
       
   121 	    $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip .
       
   122 	$(CD) $(IMAGES_OUTPUTDIR)/jmods && $(ZIP) -y -q -r \
       
   123 	    $(BUILD_OUTPUT)/bundles/modules.zip .
       
   124 	if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
       
   125 	  $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r \
       
   126 	      $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
       
   127 	fi
       
   128 	if [ -d $(SYMBOLS_IMAGE_DIR) ] ; then \
       
   129 	  $(CD) $(SYMBOLS_IMAGE_DIR) && $(ZIP) -y -q -r \
       
   130 	      $(BUILD_OUTPUT)/bundles/$(SYMBOLS_IMAGE_SUBDIR).zip . ; \
       
   131 	fi
       
   132 	@$(call TargetExit)
       
   133 else
       
   134   # Just fake the bundles
       
   135   bundles: $(JPRT_TARGET)
       
   136 	@$(call TargetEnter)
       
   137 	$(MKDIR) -p $(BUILD_OUTPUT)/bundles
       
   138 	$(CD) $(TOPDIR) &&  $(ZIP) -y -q -r \
       
   139 	    $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip README
       
   140 	$(CD) $(TOPDIR) &&  $(ZIP) -y -q -r \
       
   141 	    $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip README
       
   142 	$(CD) $(TOPDIR) &&  $(ZIP) -y -q -r \
       
   143 	    $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip README
       
   144 	$(CD) $(TOPDIR) &&  $(ZIP) -y -q -r \
       
   145 	    $(BUILD_OUTPUT)/bundles/modules.zip README
       
   146 	@$(call TargetExit)
   101 	@$(call TargetExit)
   147 endif
   102 endif
   148 
   103 
   149 # Copy images to one unified location regardless of platform etc.
   104 ALL_TARGETS += jprt_bundle
   150 final-images: $(JPRT_TARGET)
       
   151 	@$(call TargetEnter)
       
   152 	$(RM) -r $(BUILD_OUTPUT)/final-images
       
   153 	$(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)
       
   154 	$(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)
       
   155 	$(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/
       
   156 	$(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/
       
   157         ifeq ($(OPENJDK_TARGET_OS),macosx)
       
   158 	  $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR)
       
   159 	  $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR)
       
   160 	  $(CP) -R -P $(SRC_JDK_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR)/
       
   161 	  $(CP) -R -P $(SRC_JRE_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR)/
       
   162         endif
       
   163 	@$(call TargetExit)
       
   164 
   105 
   165 ALL_TARGETS += jprt_bundle bundles final-images
   106 ################################################################################
       
   107 
       
   108 $(eval $(call IncludeCustomExtension, , Jprt.gmk))