changeset 10836:2567991fddc2

Fixed dependencies for correct incremental build after partial clean in Gensrc-jdk.jdi.gmk
author erikj
date Fri, 17 Oct 2014 10:56:43 +0200
parents db0bbb6a4599
children c938abe68605
files make/gensrc/Gensrc-jdk.jdi.gmk
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/make/gensrc/Gensrc-jdk.jdi.gmk	Fri Oct 17 11:35:40 2014 +0100
+++ b/make/gensrc/Gensrc-jdk.jdi.gmk	Fri Oct 17 10:56:43 2014 +0200
@@ -30,16 +30,23 @@
 # and a JDWPCommands.h C-header file.
 
 JDWP_SPEC_FILE := $(JDK_TOPDIR)/make/data/jdwp/jdwp.spec
+HEADER_FILE := $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
+JAVA_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java
 
-$(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h: $(JDWP_SPEC_FILE)
+# Both the header and java file are created using the same recipe. By declaring
+# this rule and adding header file to dependencies for java file, both are 
+# rebuilt if either is missing
+$(HEADER_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK)
 
-$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java: \
-    $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK)
+# Touch the target of this rule at the end to avoid triggering false rebuilds
+$(JAVA_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK) $(HEADER_FILE)
 	$(MKDIR) -p $(@D)
 	$(MKDIR) -p $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent
 	$(RM) $@ $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
 	$(ECHO) $(LOG_INFO) Creating JDWP.java and JDWPCommands.h from jdwp.spec
-	$(TOOL_JDWPGEN) $< -jdi $@ -include $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
+	$(TOOL_JDWPGEN) $< -jdi $@ -include \
+	    $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
+	$(TOUCH) $@
 
 $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html: $(JDWP_SPEC_FILE) \
     $(BUILD_TOOLS_JDK)