7116322: enhance javac make rule with a little bit of instrumentation
authorsmarks
Wed, 30 Nov 2011 13:11:16 -0800
changeset 11118 5935bcaa1e5c
parent 11117 b6e68b1344d4
child 11119 6ff03c1202ce
7116322: enhance javac make rule with a little bit of instrumentation Reviewed-by: dholmes, ohair
jdk/make/common/Rules.gmk
--- a/jdk/make/common/Rules.gmk	Wed Nov 30 12:42:26 2011 +0000
+++ b/jdk/make/common/Rules.gmk	Wed Nov 30 13:11:16 2011 -0800
@@ -233,13 +233,15 @@
 	@$(MKDIR) -p $(CLASSDESTDIR)
 	@$(RM) $<.filtered
 	@$(CAT) $< | $(NAWK) 'length>0' | $(SORT) -u > $<.filtered
-	@if [ `$(CAT) $<.filtered | $(WC) -l` -ge 1 ] ; then \
-	  $(ECHO) "# Java sources to be compiled: (listed in file $<)"; \
-	  $(CAT) $<.filtered; \
-	  $(ECHO) "# Running javac:"; \
-	  $(ECHO) $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
-	  $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
-	fi
+	@numfiles=`$(WC) -l < $<.filtered` ; \
+	  if [ $$numfiles -ge 1 ] ; then \
+	    $(ECHO) "# Java sources to be compiled: (listed in file $<)"; \
+	    $(CAT) $<.filtered; \
+	    $(ECHO) "# Running javac: $$numfiles files; in $(CURDIR)"; \
+	    $(ECHO) $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
+	    $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
+	    $(ECHO) "# javac finished"; \
+	  fi
 	@$(java-vm-cleanup)
 
 clobber clean::