Commits

Shlomi Fish  committed 8ae5883

[Fiction/Make] Extract the VCS_DIRs variables.

I am trying to generate the Fiction variables.

  • Participants
  • Parent commits 675babd

Comments (0)

Files changed (3)

 lib/htmls/The-Enemy-English-rev5.html-part
 lib/htmls/The-Enemy-English-rev6.html-part
 lib/htmls/The-Enemy-rev5.html-part
+lib/make/docbook/sf-fictions.mak
 lib/make/docbook/sf-homepage-docbooks-generated.mak
 lib/make/docbook/sf-screenplays.mak
 lib/MathJax
 
 all: $(SCREENPLAY_RENDERED_HTMLS) $(SCREENPLAY_XML_HTMLS)
 
+include lib/make/docbook/sf-fictions.mak
 include lib/make/docbook/sf-screenplays.mak
 
 $(SCREENPLAY_XML_HTML_DIR)/%.html: $(SCREENPLAY_XML_XML_DIR)/%.xml
 
 FRON_IMAGE_BASE = fron-demon-illustration-small-indexed.png
 
-EARTH_ANGEL__VCS_DIR = lib/fiction-xml/from-vcs/The-Earth-Angel
 EARTH_ANGEL_ENG_FICTION_XML_SOURCE = $(EARTH_ANGEL__VCS_DIR)/The-Earth-Angel/text/The-Earth-Angel-english.fiction-text.txt
 EARTH_ANGEL_HEB_FICTION_XML_SOURCE = $(EARTH_ANGEL__VCS_DIR)/The-Earth-Angel/text/The-Earth-Angel-hebrew.fiction-text.txt
 EARTH_ANGEL_ENG_FICTION_TXT_FROM_VCS = lib/fiction-xml/txt/The-Earth-Angel-english.txt
 EARTH_ANGEL_HEB_FICTION_TXT_FROM_VCS = lib/fiction-xml/txt/The-Earth-Angel-hebrew.txt
 
 
-POPE__VCS_DIR = lib/fiction-xml/from-vcs/The-Pope-Died-on-Sunday
 POPE_ENG_FICTION_XML_SOURCE = $(POPE__VCS_DIR)/Pope/text/The-Pope-Died-on-Sunday-english.fiction-text.txt
 POPE_HEB_FICTION_XML_SOURCE = $(POPE__VCS_DIR)/Pope/text/The-Pope-Died-on-Sunday-hebrew.fiction-text.txt
 POPE_ENG_FICTION_TXT_FROM_VCS = lib/fiction-xml/txt/The-Pope-Died-on-Sunday-english.txt
 POPE_HEB_FICTION_TXT_FROM_VCS = lib/fiction-xml/txt/The-Pope-Died-on-Sunday-hebrew.txt
 
-HHFG__VCS_DIR = lib/fiction-xml/from-vcs/Human-Hacking-Field-Guide
 HHFG_ENG_DOCBOOK5_SOURCE = $(HHFG__VCS_DIR)/HHFG/text/human-hacking-field-guide--english.db5.xml
 HHFG_HEB_FICTION_XML_SOURCE = $(HHFG__VCS_DIR)/HHFG/text/human-hacking-field-guide--hebrew.fiction-text.txt
 HHFG_ENG_DOCBOOK5_FROM_VCS = lib/docbook/5/xml/human-hacking-field-guide-v2.xml

File bin/gen-docbook-make-helpers.pl

             }
         }
     }
+
+    io->file("lib/make/docbook/sf-fictions.mak")->print(
+        map {
+            sub {
+            my $d = $_;
+
+            my $b = $d->{base};
+            my $github_repo = $d->{github_repo};
+            my $subdir = $d->{subdir};
+            my $docs = $d->{docs};
+
+            my $vcs_dir_var = "${b}__VCS_DIR";
+
+            return "$vcs_dir_var = $vcs_base_dir/$github_repo\n\n";
+
+            my $str1 = "$vcs_dir_var = \$($vcs_dir_var)/$subdir\n";
+
+            my $docs_ret_str = join("",
+                map
+                {
+                    my $doc = $_;
+
+                    my $doc_base = $doc->{base};
+                    my $suf = $doc->{suffix};
+
+                    my $src_varname = "${b}_${suf}_SCREENPLAY_XML_SOURCE";
+                    my $dest_varname = "${b}_${suf}_TXT_FROM_VCS";
+                        "$src_varname = \$($vcs_dir_var)/screenplay/${doc_base}.screenplay-text.txt\n"
+                    . "$dest_varname = \$(SCREENPLAY_XML_TXT_DIR)/${doc_base}.txt\n"
+                    . "\$($dest_varname): \$($src_varname)\n"
+                    . "\t" . q/cp -f $< $@/ . "\n"
+                        ;
+                }
+                @$docs
+            );
+
+            # push @git_checkouts, { github_repo => $github_repo, };
+
+            $str1 . $docs_ret_str . "\n\n";
+            }->();
+        } @$fiction_data,
+    );
 }