Title: [120361] trunk/Source/WebCore
Revision
120361
Author
m...@apple.com
Date
2012-06-14 14:15:52 -0700 (Thu, 14 Jun 2012)

Log Message

The whole world rebuilds when you touch any IDL file
https://bugs.webkit.org/show_bug.cgi?id=89125

Reviewed by Sam Weinig.

No new tests; this only changes the build system and its dependencies.

* bindings/scripts/preprocess-idls.pl: Optionally generate the
dependencies for supplemental IDLs in Makefile format.
* DerivedSources.make: Use the new feature of preprocess-idls.pl to generate
the correct IDL dependencies created by Supplemental, then include it. This way,
we avoid the situation where every bindings file implicitly depends on every single
IDL file in the project.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (120360 => 120361)


--- trunk/Source/WebCore/ChangeLog	2012-06-14 20:41:02 UTC (rev 120360)
+++ trunk/Source/WebCore/ChangeLog	2012-06-14 21:15:52 UTC (rev 120361)
@@ -1,3 +1,19 @@
+2012-06-14  Maciej Stachowiak  <m...@apple.com>
+
+        The whole world rebuilds when you touch any IDL file
+        https://bugs.webkit.org/show_bug.cgi?id=89125
+
+        Reviewed by Sam Weinig.
+
+        No new tests; this only changes the build system and its dependencies.
+
+        * bindings/scripts/preprocess-idls.pl: Optionally generate the
+        dependencies for supplemental IDLs in Makefile format.
+        * DerivedSources.make: Use the new feature of preprocess-idls.pl to generate
+        the correct IDL dependencies created by Supplemental, then include it. This way,
+        we avoid the situation where every bindings file implicitly depends on every single
+        IDL file in the project.
+
 2012-06-14  Ian Vollick  <voll...@chromium.org>
 
         [chromium] Certain settings in CCSettings could be global

Modified: trunk/Source/WebCore/DerivedSources.make (120360 => 120361)


--- trunk/Source/WebCore/DerivedSources.make	2012-06-14 20:41:02 UTC (rev 120360)
+++ trunk/Source/WebCore/DerivedSources.make	2012-06-14 21:15:52 UTC (rev 120361)
@@ -615,6 +615,7 @@
 endif # BUILDING_WX
 
 all : \
+    $(SUPPLEMENTAL_DEPENDENCY_FILE) \
     $(JS_DOM_HEADERS) \
     $(WEB_DOM_HEADERS) \
     \
@@ -949,7 +950,8 @@
 
 JS_BINDINGS_SCRIPTS = $(GENERATE_SCRIPTS) bindings/scripts/CodeGeneratorJS.pm
 
-SUPPLEMENTAL_DEPENDENCY_FILE = ./supplemental_dependency.tmp
+SUPPLEMENTAL_DEPENDENCY_FILE = ./SupplementalDependencies.txt
+SUPPLEMENTAL_MAKEFILE_DEPS = ./SupplementalDependencies.dep
 IDL_FILES_TMP = ./idl_files.tmp
 ADDITIONAL_IDLS = $(WebCore)/inspector/_javascript_CallFrame.idl
 IDL_ATTRIBUTES_FILE = $(WebCore)/bindings/scripts/IDLAttributes.txt
@@ -959,14 +961,15 @@
 space :=
 space +=
 
-$(SUPPLEMENTAL_DEPENDENCY_FILE) : $(PREPROCESS_IDLS_SCRIPTS) $(BINDING_IDLS) $(ADDITIONAL_IDLS) $(IDL_ATTRIBUTES_FILE)
+$(SUPPLEMENTAL_MAKEFILE_DEPS) : $(PREPROCESS_IDLS_SCRIPTS) $(BINDING_IDLS) $(ADDITIONAL_IDLS) $(IDL_ATTRIBUTES_FILE)
 	printf "$(subst $(space),,$(patsubst %,%\n,$(BINDING_IDLS) $(ADDITIONAL_IDLS)))" > $(IDL_FILES_TMP)
-	$(call preprocess_idls_script, $(PREPROCESS_IDLS_SCRIPTS)) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_JAVASCRIPT" --idlFilesList $(IDL_FILES_TMP) --supplementalDependencyFile $@ --idlAttributesFile $(IDL_ATTRIBUTES_FILE)
+	$(call preprocess_idls_script, $(PREPROCESS_IDLS_SCRIPTS)) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_JAVASCRIPT" --idlFilesList $(IDL_FILES_TMP) --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) --supplementalMakefileDeps $@ --idlAttributesFile $(IDL_ATTRIBUTES_FILE)
 	rm -f $(IDL_FILES_TMP)
 
-JS%.h : %.idl $(JS_BINDINGS_SCRIPTS) $(SUPPLEMENTAL_DEPENDENCY_FILE)
+JS%.h : %.idl $(JS_BINDINGS_SCRIPTS)
 	$(call generator_script, $(JS_BINDINGS_SCRIPTS)) $(IDL_COMMON_ARGS) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_JAVASCRIPT" --generator JS --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) $<
 
+include $(SUPPLEMENTAL_MAKEFILE_DEPS)
 
 # Inspector interfaces generator
 
@@ -997,7 +1000,7 @@
 ifeq ($(findstring BUILDING_WX,$(FEATURE_DEFINES)), BUILDING_WX)
 CPP_BINDINGS_SCRIPTS = $(GENERATE_SCRIPTS) bindings/scripts/CodeGeneratorCPP.pm
 
-WebDOM%.h : %.idl $(CPP_BINDINGS_SCRIPTS) $(SUPPLEMENTAL_DEPENDENCY_FILE)
+WebDOM%.h : %.idl $(CPP_BINDINGS_SCRIPTS)
 	$(call generator_script, $(CPP_BINDINGS_SCRIPTS)) $(IDL_COMMON_ARGS) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_CPP" --generator CPP --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) $<
 endif # BUILDING_WX
 
@@ -1040,7 +1043,7 @@
 # Objective-C bindings
 
 DOM_BINDINGS_SCRIPTS = $(GENERATE_BINDING_SCRIPTS) bindings/scripts/CodeGeneratorObjC.pm
-DOM%.h : %.idl $(DOM_BINDINGS_SCRIPTS) $(SUPPLEMENTAL_DEPENDENCY_FILE) bindings/objc/PublicDOMInterfaces.h
+DOM%.h : %.idl $(DOM_BINDINGS_SCRIPTS) bindings/objc/PublicDOMInterfaces.h
 	$(call generator_script, $(DOM_BINDINGS_SCRIPTS)) $(IDL_COMMON_ARGS) --defines "$(FEATURE_DEFINES) $(ADDITIONAL_IDL_DEFINES) LANGUAGE_OBJECTIVE_C" --generator ObjC --supplementalDependencyFile $(SUPPLEMENTAL_DEPENDENCY_FILE) $<
 
 -include $(OBJC_DOM_HEADERS:.h=.dep)

Modified: trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl (120360 => 120361)


--- trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl	2012-06-14 20:41:02 UTC (rev 120360)
+++ trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl	2012-06-14 21:15:52 UTC (rev 120361)
@@ -32,13 +32,15 @@
 my $idlFilesList;
 my $idlAttributesFile;
 my $supplementalDependencyFile;
+my $supplementalMakefileDeps;
 
 GetOptions('defines=s' => \$defines,
            'preprocessor=s' => \$preprocessor,
            'verbose' => \$verbose,
            'idlFilesList=s' => \$idlFilesList,
            'idlAttributesFile=s' => \$idlAttributesFile,
-           'supplementalDependencyFile=s' => \$supplementalDependencyFile);
+           'supplementalDependencyFile=s' => \$supplementalDependencyFile,
+           'supplementalMakefileDeps=s' => \$supplementalMakefileDeps);
 
 die('Must specify #define macros using --defines.') unless defined($defines);
 die('Must specify an output file using --supplementalDependencyFile.') unless defined($supplementalDependencyFile);
@@ -56,11 +58,14 @@
 # Parse all IDL files.
 my %documents;
 my %interfaceNameToIdlFile;
+my %idlFileToInterfaceName;
 foreach my $idlFile (@idlFiles) {
     my $fullPath = Cwd::realpath($idlFile);
     my $parser = IDLParser->new(!$verbose);
     $documents{$fullPath} = $parser->Parse($idlFile, $defines, $preprocessor);
-    $interfaceNameToIdlFile{fileparse(basename($idlFile), ".idl")} = $fullPath;
+    my $interfaceName = fileparse(basename($idlFile), ".idl");
+    $interfaceNameToIdlFile{$interfaceName} = $fullPath;
+    $idlFileToInterfaceName{$fullPath} = $interfaceName;
 }
 
 # Runs the IDL attribute checker.
@@ -96,12 +101,35 @@
 # The above indicates that DOMWindow.idl is supplemented by P.idl, Q.idl and R.idl,
 # Document.idl is supplemented by S.idl, and Event.idl is supplemented by no IDLs.
 # The IDL that supplements another IDL (e.g. P.idl) never appears in the dependency file.
+
 open FH, "> $supplementalDependencyFile" or die "Cannot open $supplementalDependencyFile\n";
+
 foreach my $idlFile (sort keys %supplementals) {
     print FH $idlFile, " @{$supplementals{$idlFile}}\n";
 }
 close FH;
 
+
+if ($supplementalMakefileDeps) {
+    open MAKE_FH, "> $supplementalMakefileDeps" or die "Cannot open $supplementalMakefileDeps\n";
+    my @all_dependencies = [];
+    foreach my $idlFile (sort keys %supplementals) {
+        my $basename = $idlFileToInterfaceName{$idlFile};
+
+        my @dependencies = map { basename($_) } @{$supplementals{$idlFile}};
+
+        print MAKE_FH "JS${basename}.h: @{dependencies}\n";
+        print MAKE_FH "DOM${basename}.h: @{dependencies}\n";
+        print MAKE_FH "WebDOM${basename}.h: @{dependencies}\n";
+        foreach my $dependency (@dependencies) {
+            print MAKE_FH "${dependency}:\n";
+        }
+    }
+
+    close MAKE_FH;
+}
+
+
 sub loadIDLAttributes
 {
     my $idlAttributesFile = shift;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to