--- a/make/Jprt.gmk Wed May 25 23:45:17 2016 +0200
+++ b/make/Jprt.gmk Thu May 26 14:24:50 2016 -0700
@@ -32,14 +32,6 @@
ifdef JPRT_ARCHIVE_BUNDLE
override JPRT_ARCHIVE_BUNDLE := $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_BUNDLE))
endif
- ifdef JPRT_ARCHIVE_INSTALL_BUNDLE
- override JPRT_ARCHIVE_INSTALL_BUNDLE := \
- $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_INSTALL_BUNDLE))
- endif
- ifdef JPRT_ARCHIVE_MODULES_BUNDLE
- override JPRT_ARCHIVE_MODULES_BUNDLE := \
- $(shell $(CYGPATH) -u $(JPRT_ARCHIVE_MODULES_BUNDLE))
- endif
ifdef JPRT_ARCHIVE_TEST_BUNDLE
override JPRT_ARCHIVE_TEST_BUNDLE := \
$(shell $(CYGPATH) -u $(JPRT_ARCHIVE_TEST_BUNDLE))
@@ -55,12 +47,6 @@
ifndef JPRT_ARCHIVE_BUNDLE
JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/jdk-image.zip
endif
-ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
- JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
-endif
-ifndef JPRT_ARCHIVE_MODULES_BUNDLE
- JPRT_ARCHIVE_MODULES_BUNDLE=/tmp/jprt_bundles/modules.zip
-endif
ifndef JPRT_ARCHIVE_TEST_BUNDLE
JPRT_ARCHIVE_TEST_BUNDLE=/tmp/jprt_bundles/test-image.zip
endif
@@ -72,94 +58,51 @@
jprt_bundle: bootcycle-images
endif
-# This target must be called in the context of a SPEC file
-jprt_bundle: $(JPRT_ARCHIVE_BUNDLE) $(JPRT_ARCHIVE_TEST_BUNDLE) \
- $(JPRT_ARCHIVE_MODULES_BUNDLE)
-
-ifeq ($(GCOV_ENABLED), true)
- jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
-endif
+################################################################################
+# JPRT specific bundling targets
+JPRT_TARGET ?= $(DEFAULT_MAKE_TARGET)
+ifeq ($(JPRT_TARGET), $(DEFAULT_MAKE_TARGET))
+ jprt_bundle: $(DEFAULT_MAKE_TARGET) $(JPRT_ARCHIVE_BUNDLE) \
+ $(JPRT_ARCHIVE_TEST_BUNDLE)
-# This target must be called in the context of a SPEC file
-$(JPRT_ARCHIVE_BUNDLE): bundles
- $(MKDIR) -p $(@D)
- $(RM) $@
- $(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@
+ SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
+ SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR)
-$(JPRT_ARCHIVE_MODULES_BUNDLE): bundles
- $(MKDIR) -p $(@D)
- $(RM) $@
- $(CP) $(BUILD_OUTPUT)/bundles/modules.zip $@
+ # This target must be called in the context of a SPEC file
+ $(JPRT_ARCHIVE_BUNDLE): product-images
+ $(call MakeDir, $(@D))
+ $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $@ .
-$(JPRT_ARCHIVE_TEST_BUNDLE): bundles
- $(MKDIR) -p $(@D)
- $(RM) $@
- $(CP) $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip $@
+ $(JPRT_ARCHIVE_TEST_BUNDLE): test-image
+ $(call MakeDir, $(@D))
+ $(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIP) -y -q -r $@ .
-$(JPRT_ARCHIVE_SYMBOLS_BUNDLE): bundles
- $(MKDIR) -p $(@D)
- $(RM) $@
- $(CP) $(BUILD_OUTPUT)/bundles/$(SYMBOLS_IMAGE_SUBDIR).zip $@
+ ##############################################################################
+ # Optional symbols bundle
+ ifeq ($(GCOV_ENABLED), true)
+ jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
+ zip-bundles: $(SYMBOLS_ZIP_BUNDLE)
-SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
-SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
-SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR)
-SRC_JDK_MACOSX_BUNDLE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
-SRC_JRE_MACOSX_BUNDLE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
+ $(JPRT_ARCHIVE_SYMBOLS_BUNDLE): product-images
+ $(call MakeDir, $(@D))
+ $(CD) $(SYMBOLS_IMAGE_DIR) && $(ZIP) -y -q -r $@ .
+
+ endif
-# Bundle up the images
-JPRT_TARGET ?= default
-ifeq ($(JPRT_TARGET), default)
- bundles: $(JPRT_TARGET)
+ ##############################################################################
+
+else
+ # Just fake the main bundle to satisfy JPRT
+ jprt_bundle: $(JPRT_TARGET)
@$(call TargetEnter)
$(MKDIR) -p $(BUILD_OUTPUT)/bundles
- $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r \
- $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
- $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r \
- $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
- $(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIP) -y -q -r \
- $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip .
- $(CD) $(IMAGES_OUTPUTDIR)/jmods && $(ZIP) -y -q -r \
- $(BUILD_OUTPUT)/bundles/modules.zip .
- if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
- $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r \
- $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
- fi
- if [ -d $(SYMBOLS_IMAGE_DIR) ] ; then \
- $(CD) $(SYMBOLS_IMAGE_DIR) && $(ZIP) -y -q -r \
- $(BUILD_OUTPUT)/bundles/$(SYMBOLS_IMAGE_SUBDIR).zip . ; \
- fi
- @$(call TargetExit)
-else
- # Just fake the bundles
- bundles: $(JPRT_TARGET)
- @$(call TargetEnter)
- $(MKDIR) -p $(BUILD_OUTPUT)/bundles
- $(CD) $(TOPDIR) && $(ZIP) -y -q -r \
- $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip README
- $(CD) $(TOPDIR) && $(ZIP) -y -q -r \
- $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip README
- $(CD) $(TOPDIR) && $(ZIP) -y -q -r \
- $(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip README
- $(CD) $(TOPDIR) && $(ZIP) -y -q -r \
- $(BUILD_OUTPUT)/bundles/modules.zip README
+ $(CD) $(TOPDIR) && $(TAR) cf - README | $(GZIP) > \
+ $(JPRT_ARCHIVE_BUNDLE)
@$(call TargetExit)
endif
-# Copy images to one unified location regardless of platform etc.
-final-images: $(JPRT_TARGET)
- @$(call TargetEnter)
- $(RM) -r $(BUILD_OUTPUT)/final-images
- $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)
- $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)
- $(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/
- $(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/
- ifeq ($(OPENJDK_TARGET_OS),macosx)
- $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR)
- $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR)
- $(CP) -R -P $(SRC_JDK_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR)/
- $(CP) -R -P $(SRC_JRE_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR)/
- endif
- @$(call TargetExit)
+ALL_TARGETS += jprt_bundle
-ALL_TARGETS += jprt_bundle bundles final-images
+################################################################################
+
+$(eval $(call IncludeCustomExtension, , Jprt.gmk))