Only output resulting jar, not build support files, in image. JEP-230-microbenchmarks-branch
authorihse
Wed, 03 Oct 2018 12:49:52 +0200
branchJEP-230-microbenchmarks-branch
changeset 56918 c331ac5bc80a
parent 56914 796f76953273
child 56919 fe0fad5aebf5
Only output resulting jar, not build support files, in image.
make/BuildMicrobenchmark.gmk
make/common/JarArchive.gmk
--- a/make/BuildMicrobenchmark.gmk	Tue Oct 02 11:54:15 2018 +0200
+++ b/make/BuildMicrobenchmark.gmk	Wed Oct 03 12:49:52 2018 +0200
@@ -43,6 +43,7 @@
 
 MICROBENCHMARK_OUTPUT := $(SUPPORT_OUTPUTDIR)/test/micro
 MICROBENCHMARK_CLASSES := $(MICROBENCHMARK_OUTPUT)/classes
+MICROBENCHMARK_JAR_BIN := $(MICROBENCHMARK_OUTPUT)/jar
 
 JMH_UNPACKED_DIR := $(MICROBENCHMARK_OUTPUT)/jmh_jars
 JMH_UNPACKED_JARS_DONE := $(JMH_UNPACKED_DIR)/_unpacked.marker
@@ -97,7 +98,8 @@
 # Create benchmarks JAR file with benchmarks for both the old and new JDK
 $(eval $(call SetupJarArchive, BUILD_JDK_JAR, \
     DEPENDENCIES := $(BUILD_JDK_MICROBENCHMARK) $(JMH_UNPACKED_JARS_DONE), \
-    SRCS := $(MICROBENCHMARK_CLASSES) $(JMH_UNPACKED_DIR) , \
+    SRCS := $(MICROBENCHMARK_CLASSES) $(JMH_UNPACKED_DIR), \
+    BIN := $(MICROBENCHMARK_JAR_BIN), \
     SUFFIXES := .*, \
     EXCLUDE_FILES:= _the.BUILD_JDK_MICROBENCHMARK_batch \
         _the.BUILD_JDK_MICROBENCHMARK.vardeps _unpacked.marker, \
--- a/make/common/JarArchive.gmk	Tue Oct 02 11:54:15 2018 +0200
+++ b/make/common/JarArchive.gmk	Wed Oct 03 12:49:52 2018 +0200
@@ -43,6 +43,7 @@
 #       For this to work, the source files must exist when the makefile is
 #       parsed.
 #   SRCS:=List of directories in where to find files to add to archive
+#   BIN:=Directory where to store build control files
 #   SUFFIXES:=File suffixes to include in jar
 #   INCLUDES:=List of directories/packages in SRCS that should be included
 #   EXCLUDES:=List of directories/packages in SRCS that should be excluded
@@ -62,10 +63,11 @@
 
   $1_JARMAIN:=$(strip $$($1_JARMAIN))
   $1_JARNAME:=$$(notdir $$($1_JAR))
-  $1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest
-  $1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess
-  $1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes
-  $1_BIN:=$$(dir $$($1_JAR))
+  $1_JAR_OUTPUT_DIR := $$(patsubst %/, %, $$(dir $$($1_JAR)))
+  $$(call SetIfEmpty, $1_BIN, $$($1_JAR_OUTPUT_DIR))
+  $1_MANIFEST_FILE:=$$($1_BIN)/_the.$$($1_JARNAME)_manifest
+  $1_DELETESS_FILE:=$$($1_BIN)/_the.$$($1_JARNAME)_deletess
+  $1_DELETES_FILE:=$$($1_BIN)/_the.$$($1_JARNAME)_deletes
   $$(call SetIfEmpty, $1_JAR_CMD, $$(JAR))
 
   ifeq (,$$($1_SUFFIXES))
@@ -231,11 +233,14 @@
   $1_VARDEPS := $$($1_JAR_CMD) $$($1_JAR_CREATE_OPTIONS) $$($1_MANIFEST) \
       $$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR) $$($1_ORIG_DEPS) $$($1_SRCS) \
       $$($1_INCLUDES) $$($1_EXCLUDES) $$($1_EXCLUDE_FILES) $$($1_EXTRA_FILES)
-  $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps)
+  $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$$($1_JARNAME).vardeps)
 
   # Here is the rule that creates/updates the jar file.
   $$($1_JAR) : $$($1_DEPENDENCIES) $$($1_MANIFEST) $$($1_VARDEPS_FILE)
 	$(MKDIR) -p $$($1_BIN)
+        ifneq ($$($1_JAR_OUTPUT_DIR), $$($1_BIN))
+	  $(MKDIR) -p $$($1_JAR_OUTPUT_DIR)
+        endif
 	$$($1_GREP_INCLUDE_OUTPUT)
 	$$($1_GREP_EXCLUDE_OUTPUT)
         # If the vardeps file is part of the newer prereq list, it means that