[svn:parrot] r43256 - in trunk: config/gen/makefiles include/parrot src tools/dev

coke at svn.parrot.org coke at svn.parrot.org
Sun Dec 27 03:09:43 UTC 2009


Author: coke
Date: Sun Dec 27 03:09:42 2009
New Revision: 43256
URL: https://trac.parrot.org/parrot/changeset/43256

Log:
Fix deps on spf_render.o;

GENERAL_H_FILES kind of worked; Add PARROT_H_HEADERS to replace it; anything
that includes parrot.h is also including all these other files, so be 
explicit about it. Updating checkdepend so that it verifies all the
includes.

Fix this one file to use these updates: note that parrot.h already includes
one of the other depends used by this file, remove the duplication from the
.c file and the makefile.

Only 5311 failures left in checkdepend now. =-)

Modified:
   trunk/config/gen/makefiles/root.in
   trunk/include/parrot/context.h
   trunk/src/spf_render.c
   trunk/tools/dev/checkdepend.pl

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	Sat Dec 26 23:07:22 2009	(r43255)
+++ trunk/config/gen/makefiles/root.in	Sun Dec 27 03:09:42 2009	(r43256)
@@ -365,6 +365,67 @@
     $(PIRC_DIR)/src/pirerr$(O) \
     $(PIRC_DIR)/src/pirop$(O)
 
+# parrot.h and all the includes it causes to be included
+PARROT_H_HEADERS := \
+        $(INC_DIR)/parrot.h \
+        $(INC_DIR)/config.h \
+        $(INC_DIR)/settings.h \
+        $(INC_DIR)/enums.h \
+        $(INC_DIR)/platform.h \
+        $(INC_DIR)/platform_interface.h \
+        $(INC_DIR)/global_setup.h \
+        $(INC_DIR)/caches.h \
+        $(INC_DIR)/interpreter.h \
+        $(INC_DIR)/datatypes.h \
+        $(INC_DIR)/encoding.h \
+        $(INC_DIR)/charset.h \
+        $(INC_DIR)/string.h \
+        $(INC_DIR)/string_primitives.h \
+        $(INC_DIR)/hash.h \
+        $(INC_DIR)/list.h \
+        $(INC_DIR)/pmc_freeze.h \
+        $(INC_DIR)/vtable.h \
+        $(INC_DIR)/context.h \
+        $(INC_DIR)/exceptions.h \
+        $(INC_DIR)/warnings.h \
+        $(INC_DIR)/memory.h \
+        $(INC_DIR)/packfile.h \
+        $(INC_DIR)/io.h \
+        $(INC_DIR)/op.h \
+        $(INC_DIR)/pmc.h \
+        $(INC_DIR)/events.h \
+        $(INC_DIR)/gc_api.h \
+        $(INC_DIR)/string_funcs.h \
+        $(INC_DIR)/misc.h \
+        $(INC_DIR)/sub.h \
+        $(INC_DIR)/call.h \
+        $(INC_DIR)/key.h \
+        $(INC_DIR)/exit.h \
+        $(INC_DIR)/nci.h \
+        $(INC_DIR)/thread.h \
+        $(INC_DIR)/scheduler.h \
+        $(INC_DIR)/tsq.h \
+        $(INC_DIR)/longopt.h \
+        $(INC_DIR)/oo.h \
+        $(INC_DIR)/vtables.h \
+        $(INC_DIR)/multidispatch.h \
+        $(INC_DIR)/library.h \
+        $(INC_DIR)/global.h \
+        $(INC_DIR)/stat.h \
+        $(INC_DIR)/hll.h \
+        $(INC_DIR)/pbcversion.h \
+        $(INC_DIR)/pobj.h \
+        $(INC_DIR)/platform_limits.h \
+        $(INC_DIR)/has_header.h \
+        $(INC_DIR)/oplib.h \
+        $(INC_DIR)/feature.h \
+        $(INC_DIR)/debugger.h \
+        $(INC_DIR)/core_types.h \
+        $(INC_DIR)/core_pmcs.h \
+        $(INC_DIR)/compiler.h \
+        $(INC_DIR)/cclass.h \
+        $(PMC_INC_DIR)/pmc/pmc_callcontext.h
+
 # generated list of header files
 GENERAL_H_FILES   := $(NONGEN_HEADERS) $(GEN_HEADERS) @TEMP_cg_h@
 
@@ -1284,8 +1345,7 @@
 
 $(SRC_DIR)/utils$(O) : $(INC_DIR)/parrot.h $(PMC_INC_DIR)/pmc/pmc_nci.h
 
-$(SRC_DIR)/spf_render$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/spf_render.str \
-        $(INC_DIR)/string_funcs.h
+$(SRC_DIR)/spf_render$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/spf_render.str
 
 $(SRC_DIR)/spf_vtable$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/spf_vtable.str
 

Modified: trunk/include/parrot/context.h
==============================================================================
--- trunk/include/parrot/context.h	Sat Dec 26 23:07:22 2009	(r43255)
+++ trunk/include/parrot/context.h	Sun Dec 27 03:09:42 2009	(r43256)
@@ -24,7 +24,7 @@
     INTVAL       *regs_i;
 } Regs_ni;
 
-#include <pmc/pmc_callcontext.h>
+#include "pmc/pmc_callcontext.h"
 typedef struct Parrot_CallContext_attributes Parrot_Context;
 
 /*

Modified: trunk/src/spf_render.c
==============================================================================
--- trunk/src/spf_render.c	Sat Dec 26 23:07:22 2009	(r43255)
+++ trunk/src/spf_render.c	Sun Dec 27 03:09:42 2009	(r43256)
@@ -22,7 +22,6 @@
 #define IN_SPF_SYSTEM
 
 #include "parrot/parrot.h"
-#include "parrot/string_funcs.h"
 #include "spf_render.str"
 
 typedef enum {

Modified: trunk/tools/dev/checkdepend.pl
==============================================================================
--- trunk/tools/dev/checkdepend.pl	Sat Dec 26 23:07:22 2009	(r43255)
+++ trunk/tools/dev/checkdepend.pl	Sun Dec 27 03:09:42 2009	(r43256)
@@ -26,9 +26,9 @@
 
 =cut
 
-my $files = `ack -fa {src,compilers} | grep '\\.[ch]\$'`;
+my $files = `ack -fa {src,compilers,include} | grep '\\.[ch]\$'`;
 
-my %deps;
+our %deps;
 
 foreach my $file (sort split /\n/, $files) {
     open my $fh, '<', $file;
@@ -64,32 +64,36 @@
     $rules =~ s/\$\($var\)/$val/g;
 }
 
-foreach my $file (sort keys %deps) {
+# expand PARROT_H_HEADERS
+$rules =~ m/^PARROT_H_HEADERS\s*:?=\s*(.*)$/m;
+my $phh = $1;
+
+$rules =~ s/\Q$(PARROT_H_HEADERS)/$phh/g;
+
+foreach my $header (sort grep {/\.h$/} (keys %deps)) {
+    # static headers shouldn't depend on anything else.
+    if ($rules =~ /^$header\s*:\s*(.*)\s*$/m) {
+        #is("", $1, "$header should have no dependencies");
+    } 
+}
+
+foreach my $file (sort grep {/\.c$/} (keys %deps)) {
     my $rule = $file;
+    $rule =~ s/\.c$//;
 
-    my $declared = "";
-    if ($rule =~ s/\.c$//) {
-        $rules =~ /^$rule\Q$(O)\E\s*:\s*(.*)\s*$/m;
-        $declared = $1;
-    }
-    elsif ($rule =~ s/\.h$//) {
-        $rules =~ /^$rule\.h\s*:\s*(.*)\s*$/m;
-        $declared = $1;
-    }
-    else {
-        die "unexpected file $file\n";
-    }
+    $rules =~ /^$rule\Q$(O)\E\s*:\s*(.*)\s*$/m;
+    my $declared = $1;
 
     my $failed = 0;
     if (!defined($declared)) {
         $failed = 1;
-        is("", join(' ', @{$deps{$file}}), "$file has no dependencies");
+        is("", join(' ', (get_deps($file))), "$file has no dependencies");
         next;
     }
     else
     {
         $declared =~ s/\s+/ /g;
-        foreach my $inc (sort @{$deps{$file}}) {
+        foreach my $inc (sort (get_deps($file))) {
             # incs can be relative, but makefile is from top level
             my $file_dir = (File::Spec->splitpath($file))[1];
             my $make_dep = collapse_path(File::Spec->catfile($file_dir,$inc));
@@ -131,6 +135,30 @@
     return $path;
 }
 
+sub get_deps {
+    my $file = shift;
+    my %all_deps;
+
+    if (! exists $deps{$file}) {
+        return;
+    }
+
+    # add explicit deps
+    my @pending_deps = @{$deps{$file}}; 
+
+    while (@pending_deps) {
+        my $dep = shift @pending_deps;
+        if (!exists $all_deps{$dep}) {
+            $all_deps{$dep} = 1;
+            if (exists $deps{"include/$dep"}) {
+                push @pending_deps, @{$deps{"include/$dep"}};
+            }
+        }
+    }
+    
+    return keys %all_deps;
+}
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4


More information about the parrot-commits mailing list