changeset 1311:ff32c270102a

6853806: Prefer (cd $dir && jar) to jar -C for performance reasons Summary: Eliminate (most) uses of jar -C Reviewed-by: ohair
author martin
date Mon, 22 Jun 2009 21:07:20 -0700
parents ce55eb6668d9
children b3444a42fd40
files make/common/Release.gmk
diffstat 1 files changed, 23 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/Release.gmk	Mon Jun 22 20:47:51 2009 -0700
+++ b/make/common/Release.gmk	Mon Jun 22 21:07:20 2009 -0700
@@ -97,7 +97,7 @@
   ifeq ($(PLATFORM), windows)
     LICENSE_DOCLIST_JDK = $(subst $(LICENSE_VERSION),,\
 		   $(shell $(CD) $(SHARE_JDK_DOC_SRC) && \
- 		           $(LS) *LICENSE*$(LICENSE_VERSION)))
+		           $(LS) *LICENSE*$(LICENSE_VERSION)))
     LICENSE_DOCLIST_JRE = $(subst $(LICENSE_VERSION),,\
 		   $(shell $(CD) $(SHARE_JRE_DOC_SRC) && \
 		           $(LS) *LICENSE*$(LICENSE_VERSION)))
@@ -401,7 +401,7 @@
 	sun/tools/jstack        \
 	sun/tools/jinfo         \
 	sun/tools/jmap
-	
+
 # classes that go into jsse.jar
 JSSE_CLASSES_DIRS = \
 	sun/security/provider/Sun.class \
@@ -645,7 +645,7 @@
 	@$(java-vm-cleanup)
 
 # Create the manifest file.
-JAR_MANIFEST_FILE=$(TEMPDIR)/manifest.tmp
+JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/manifest.tmp
 $(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
 	$(prep-target)
 	$(SED) -e "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST) >> $@
@@ -653,25 +653,22 @@
 	$(CAT) $(BEANMANIFEST) >> $@
 
 # Create resources.jar containing non-class files
-RESOURCES_JAR=$(TEMPDIR)/resources-orig.jar
-RES_JAR_ARGLIST=$(RES_JAR_FILELIST)_args
-$(RES_JAR_ARGLIST): $(RES_JAR_FILELIST)
+RESOURCES_JAR=$(ABS_TEMPDIR)/resources-orig.jar
+$(RESOURCES_JAR): $(RES_JAR_FILELIST) $(JAR_MANIFEST_FILE)
 	$(prep-target)
-	$(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@
-$(RESOURCES_JAR): $(RES_JAR_ARGLIST) $(JAR_MANIFEST_FILE)
-	$(prep-target)
-	$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
-	    @$(RES_JAR_ARGLIST) $(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
+	$(CD) $(CLASSBINDIR) && \
+	    $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
+	        @$(RES_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
+	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
 
 # Create jsse.jar containing SunJSSE implementation classes
-JSSE_JAR=$(TEMPDIR)/jsse-orig.jar
+JSSE_JAR=$(ABS_TEMPDIR)/jsse-orig.jar
 $(JSSE_JAR): $(JAR_MANIFEST_FILE)
 	$(prep-target)
-	$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
-		$(JSSE_CLASSES_DIRS:%=-C $(CLASSBINDIR) %) \
-		$(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
+	$(CD) $(CLASSBINDIR) && \
+	    $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
+		$(JSSE_CLASSES_DIRS) $(BOOT_JAR_JFLAGS)
+	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
 
 # Create sec-bin.zip
 SEC_FILES_ZIP=$(ABS_TEMPDIR)/sec-bin.zip
@@ -713,15 +710,12 @@
 
 # Create rt.jar
 RT_JAR=$(ABS_TEMPDIR)/rt-orig.jar
-RT_JAR_ARGLIST=$(RT_JAR_FILELIST)_args
-$(RT_JAR_ARGLIST): $(RT_JAR_FILELIST)
+$(RT_JAR): $(RT_JAR_FILELIST) $(JAR_MANIFEST_FILE)
 	$(prep-target)
-	$(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@
-$(RT_JAR): $(RT_JAR_ARGLIST) $(JAR_MANIFEST_FILE)
-	$(prep-target)
-	$(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
-	    @$(RT_JAR_ARGLIST) $(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
+	$(CD) $(CLASSBINDIR) && \
+	    $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
+	        @$(RT_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
+	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
 
 # Meta-index construction to make core class loaders lazier
 
@@ -944,10 +938,10 @@
 	@#
 	@# lib/tools.jar
 	@#
-	$(BOOT_JAR_CMD) c0f $(LIBDIR)/tools.jar $(addprefix \
-		-C $(CLASSBINDIR) , $(TOOLS)) \
-	        $(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
+	$(CD) $(CLASSBINDIR) && \
+	    $(BOOT_JAR_CMD) c0f $(ABS_LIBDIR)/tools.jar \
+	        $(TOOLS) $(BOOT_JAR_JFLAGS)
+	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
 	$(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar
 	@#
 	@# lib/ct.sym