< prev index next >

make/common/JarArchive.gmk

Print this page
rev 52573 : 8061281: Microbenchmark suite build support, directory layout and sample benchmarks
8061282: Migrate jmh-jdk-microbenchmarks into the JDK
Reviewed-by: ecaspole, mchung, erikj, ihse
Contributed-by: magnus.ihse.bursie@oracle.com, erik.joelsson@oracle.com, claes.redestad@oracle.com, sfriberg@kth.se

@@ -41,10 +41,11 @@
 #   DEPENDENCIES:=List of dependencies for the jar target. If left empty,
 #       dependencies are calculated automatically from the source files found.
 #       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
 #   EXCLUDE_FILES:=List of files in SRCS that should be excluded
 #   EXTRA_FILES:=List of files in SRCS that should be included regardless of suffix match.

@@ -60,14 +61,15 @@
 SetupJarArchive = $(NamedParamsMacroTemplate)
 define SetupJarArchiveBody
 
   $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))
     # No suffix was set, default to classes.
     $1_SUFFIXES:=.class

@@ -229,15 +231,16 @@
 
   # Include all variables of significance in the vardeps file
   $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)
         $$(call MakeTargetDir)
+        $$(call MakeDir, $$($1_BIN))
         $$($1_GREP_INCLUDE_OUTPUT)
         $$($1_GREP_EXCLUDE_OUTPUT)
         # If the vardeps file is part of the newer prereq list, it means that
         # either the jar file does not exist, or we need to recreate it from
         # from scratch anyway since a simple update will not catch all the
< prev index next >