Anonymous avatar Anonymous committed eda1ee7

Added the deps.mak file which is generated from find-deps.pl.

It is used to keep track of the #include "../lib" inside the WMLs, so they'll
be re-rendered.

Comments (0)

Files changed (3)

 
 include include.mak
 include rules.mak
+include deps.mak
 
 make-dirs: $(T2_DIRS_DEST) 
 
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Find::Object;
+
+my $ff = File::Find::Object->new({}, "t2");
+
+my @deps;
+while (defined(my $result = $ff->next_obj()))
+{
+    if (   $result->is_dir() 
+        && @{$result->dir_components()}
+        && $result->dir_components()->[-1] eq ".svn"
+       )
+    {
+        $ff->prune();
+    }
+    elsif ((! $result->is_dir()) && $result->basename() =~ m{\.wml\z})
+    {
+        open my $in, "<", $result->path()
+            or die "Cannot open " . $result->path() . "$!";
+        while (my $line = <$in>)
+        {
+            my $string = qq{#include "../lib/};
+            if ($line =~ s{\A\Q$string\E}{})
+            {
+                $line =~ s{".*}{}ms;
+                push @deps, { file => $result->path(), dep => $line };
+            }
+        }
+        close($in);
+    }
+}
+
+open my $deps_mak, ">", "deps.mak";
+print {$deps_mak} "# Extra dependencies\n\n";
+foreach my $dep (@deps)
+{
+    my $file = $dep->{'file'};
+    my $depends_on = $dep->{'dep'};
+    $file =~ s{\At2/}{};
+    $file =~ s{\.wml\z}{};
+    
+    print {$deps_mak} qq{\$(T2_DEST)/$file :  lib/$depends_on\n\n}, 
+}
+close($deps_mak);
+
+# Extra dependencies
+
+$(T2_DEST)/philosophy/case-for-file-swapping/revision-3/index.html :  lib/docbook/rendered/case-for-file-swapping-rev3.html
+
+$(T2_DEST)/philosophy/computers/education/introductory-language/index.html :  lib/docbook/rendered/introductory-language.html
+
+$(T2_DEST)/philosophy/computers/high-quality-software/index.html :  lib/docbook/rendered/what-makes-software-high-quality.html
+
+$(T2_DEST)/philosophy/computers/high-quality-software/rev2/index.html :  lib/docbook/rendered/what-makes-software-high-quality-rev2.html
+
+$(T2_DEST)/philosophy/computers/optimizing-code-for-speed/index.html :  lib/htmls/from-mediawiki/processed/Optimizing_Code_For_Speed-rev1.html
+
+$(T2_DEST)/philosophy/computers/software-management/end-of-it-slavery/index.html :  lib/docbook/rendered/end-of-it-slavery.html
+
+$(T2_DEST)/philosophy/computers/software-management/perfect-workplace/perfect-it-workplace.xhtml :  lib/docbook/rendered/perfect-it-workplace.html
+
+$(T2_DEST)/philosophy/politics/drug-legalisation/index.html :  lib/docbook/rendered/case-for-drug-legalisation.html
+
+$(T2_DEST)/philosophy/psychology/hypomanias/content.html :  lib/docbook/rendered/dealing-with-hypomanias.html
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.