PATCH: Tired of waiting for rt.jar to build?

Martin Buchholz martinrb at google.com
Tue Apr 28 23:30:09 UTC 2009


On Tue, Apr 28, 2009 at 16:27, Martin Buchholz <martinrb at google.com> wrote:
> On Mon, Apr 27, 2009 at 17:54, Martin Buchholz <martinrb at google.com> wrote:
>> Someone who cares about the Makefiles can also try to remove the
>> 16000 gratuitous -C flags that makes jar's life "jar hell".
>
> Hmmm.... Apparently I care enough.
>
> Kelly (or Tim?), please review.

Let's try that again.

http://cr.openjdk.java.net/~martin/dashJ

diff --git a/make/common/Release.gmk b/make/common/Release.gmk
--- a/make/common/Release.gmk
+++ b/make/common/Release.gmk
@@ -94,7 +94,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)))
@@ -399,7 +399,7 @@
 	sun/tools/jstack        \
 	sun/tools/jinfo         \
 	sun/tools/jmap
-	
+
 # classes that go into jsse.jar
 JSSE_CLASSES_DIRS = \
 	sun/security/provider/Sun.class \
@@ -644,7 +644,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) >> $@
@@ -652,25 +652,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
@@ -712,15 +709,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

@@ -943,10 +937,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



More information about the core-libs-dev mailing list