chiark / gitweb /
Recipe: centralise dependencies for latin.c.
authorSimon Tatham <anakin@pobox.com>
Sun, 22 Apr 2018 15:45:34 +0000 (16:45 +0100)
committerSimon Tatham <anakin@pobox.com>
Sun, 22 Apr 2018 15:45:34 +0000 (16:45 +0100)
It's silly to have every puzzle using latin.c separately specify in
its .R file the list of additional modules that latin.c depends on, or
for that matter to have them all have to separately know how to adjust
that for the STANDALONE_SOLVER mode of latin.c.

So I've centralised a new pair of definitions into the core Recipe
file, called LATIN and LATIN_SOLVER, and now a client of latin.c need
only ask for that to get all the necessary dependencies too.

Also, while I'm here, I've moved the non-puzzle-specific 'latincheck'
test program out of unequal.R into the central Recipe.

Recipe
keen.R
singles.R
towers.R
unequal.R
unfinished/group.R

diff --git a/Recipe b/Recipe
index 3b57ef5e5413f7c5ffd2a8f6fa20b505ad6aaf9f..a7db32b79590630b3ac7173a546896e7508ac29b 100644 (file)
--- a/Recipe
+++ b/Recipe
@@ -31,6 +31,10 @@ STANDALONE = nullfe random misc malloc
 
 ALL      = list
 
+LATIN_DEPS   = maxflow tree234
+LATIN        = latin LATIN_DEPS
+LATIN_SOLVER = latin[STANDALONE_SOLVER] LATIN_DEPS
+
 # First half of list.c.
 !begin >list.c
 /*
@@ -61,6 +65,10 @@ const int gamecount = lenof(gamelist);
 # Unix standalone application for special-purpose obfuscation.
 obfusc : [U] obfusc STANDALONE
 
+# Test program built from latin.c.
+latincheck : [U] latin[STANDALONE_LATIN_TEST] LATIN_DEPS STANDALONE
+latincheck : [C] latin[STANDALONE_LATIN_TEST] LATIN_DEPS STANDALONE
+
 puzzles  : [G] windows[COMBINED] WINDOWS_COMMON COMMON ALL noicon.res
 
 # Mac OS X unified application containing all the puzzles.
diff --git a/keen.R b/keen.R
index 77609bc7fac340b0957557c342552ed4d5914fc8..46bd09a33d2503b73b35eafc0a167f59a38408a1 100644 (file)
--- a/keen.R
+++ b/keen.R
@@ -1,14 +1,14 @@
 # -*- makefile -*-
 
-KEEN_LATIN_EXTRA = tree234 maxflow dsf
-KEEN_EXTRA = latin KEEN_LATIN_EXTRA
+KEEN_EXTRA        = dsf LATIN
+KEEN_EXTRA_SOLVER = dsf LATIN_SOLVER
 
 keen    : [X] GTK COMMON keen KEEN_EXTRA keen-icon|no-icon
 
 keen    : [G] WINDOWS COMMON keen KEEN_EXTRA keen.res|noicon.res
 
-keensolver : [U] keen[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] KEEN_LATIN_EXTRA STANDALONE
-keensolver : [C] keen[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] KEEN_LATIN_EXTRA STANDALONE
+keensolver : [U] keen[STANDALONE_SOLVER] KEEN_EXTRA_SOLVER STANDALONE
+keensolver : [C] keen[STANDALONE_SOLVER] KEEN_EXTRA_SOLVER STANDALONE
 
 ALL += keen[COMBINED] KEEN_EXTRA
 
index 2d10c4b3885bf97cfaf0e55e3b4e6b353a282e03..a67aed2fbc5cc7077d396ee7cb597e25e99c5264 100644 (file)
--- a/singles.R
+++ b/singles.R
@@ -1,6 +1,6 @@
 # -*- makefile -*-
 
-SINGLES_EXTRA = dsf latin maxflow tree234
+SINGLES_EXTRA = dsf LATIN
 
 singles : [X] GTK COMMON singles SINGLES_EXTRA singles-icon|no-icon
 singles : [G] WINDOWS COMMON singles SINGLES_EXTRA singles.res|noicon.res
index c060c697a7758c83d9c5e7074e4a09a7af04ccc2..c2bb78a2dcda15b9f51594b902923cf67e999d18 100644 (file)
--- a/towers.R
+++ b/towers.R
@@ -1,14 +1,14 @@
 # -*- makefile -*-
 
-TOWERS_LATIN_EXTRA = tree234 maxflow
-TOWERS_EXTRA = latin TOWERS_LATIN_EXTRA
+TOWERS_EXTRA        = LATIN
+TOWERS_EXTRA_SOLVER = LATIN_SOLVER
 
 towers    : [X] GTK COMMON towers TOWERS_EXTRA towers-icon|no-icon
 
 towers    : [G] WINDOWS COMMON towers TOWERS_EXTRA towers.res|noicon.res
 
-towerssolver : [U] towers[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] TOWERS_LATIN_EXTRA STANDALONE
-towerssolver : [C] towers[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] TOWERS_LATIN_EXTRA STANDALONE
+towerssolver : [U] towers[STANDALONE_SOLVER] TOWERS_EXTRA_SOLVER STANDALONE
+towerssolver : [C] towers[STANDALONE_SOLVER] TOWERS_EXTRA_SOLVER STANDALONE
 
 ALL += towers[COMBINED] TOWERS_EXTRA
 
index a061582768bc1e3ab1d007078ddc7b1db2a40c39..077407ffff8ad67433e7dcffeeb38fe732d2ff92 100644 (file)
--- a/unequal.R
+++ b/unequal.R
@@ -1,16 +1,14 @@
 # -*- makefile -*-
 
-UNEQUAL_EXTRA = latin tree234 maxflow
+UNEQUAL_EXTRA        = LATIN
+UNEQUAL_EXTRA_SOLVER = LATIN_SOLVER
 
 unequal  : [X] GTK COMMON unequal UNEQUAL_EXTRA unequal-icon|no-icon
 
 unequal  : [G] WINDOWS COMMON unequal UNEQUAL_EXTRA unequal.res|noicon.res
 
-unequalsolver : [U] unequal[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] tree234 maxflow STANDALONE
-unequalsolver : [C] unequal[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] tree234 maxflow STANDALONE
-
-latincheck : [U] latin[STANDALONE_LATIN_TEST] tree234 maxflow STANDALONE
-latincheck : [C] latin[STANDALONE_LATIN_TEST] tree234 maxflow STANDALONE
+unequalsolver : [U] unequal[STANDALONE_SOLVER] UNEQUAL_EXTRA_SOLVER STANDALONE
+unequalsolver : [C] unequal[STANDALONE_SOLVER] UNEQUAL_EXTRA_SOLVER STANDALONE
 
 ALL += unequal[COMBINED] UNEQUAL_EXTRA
 
index a11d22e9b967cdc542b5636bd5e2257b201c8feb..394e364a060260c93f41b11216b8cf8094449c5e 100644 (file)
@@ -1,14 +1,14 @@
 # -*- makefile -*-
 
-GROUP_LATIN_EXTRA = tree234 maxflow
-GROUP_EXTRA = latin GROUP_LATIN_EXTRA
+GROUP_EXTRA        = LATIN
+GROUP_EXTRA_SOLVER = LATIN_SOLVER
 
 group    : [X] GTK COMMON group GROUP_EXTRA group-icon|no-icon
 
 group    : [G] WINDOWS COMMON group GROUP_EXTRA group.res|noicon.res
 
-groupsolver : [U] group[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] GROUP_LATIN_EXTRA STANDALONE
-groupsolver : [C] group[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] GROUP_LATIN_EXTRA STANDALONE
+groupsolver : [U] group[STANDALONE_SOLVER] GROUP_EXTRA_SOLVER STANDALONE
+groupsolver : [C] group[STANDALONE_SOLVER] GROUP_EXTRA_SOLVER STANDALONE
 
 ALL += group[COMBINED] GROUP_EXTRA