chiark / gitweb /
Add a mechanism to the automake system to allow 'make install' to only
authorSimon Tatham <anakin@pobox.com>
Sun, 30 Jun 2013 10:16:57 +0000 (10:16 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 30 Jun 2013 10:16:57 +0000 (10:16 +0000)
install the actual games, not the auxiliary binaries or nullgame.

[originally from svn r9887]

42 files changed:
Recipe
blackbox.R
bridges.R
cube.R
dominosa.R
fifteen.R
filling.R
flip.R
galaxies.R
guess.R
inertia.R
keen.R
lightup.R
loopy.R
magnets.R
map.R
mines.R
mkfiles.pl
net.R
netslide.R
pattern.R
pearl.R
pegs.R
range.R
rect.R
samegame.R
signpost.R
singles.R
sixteen.R
slant.R
solo.R
tents.R
towers.R
twiddle.R
undead.R
unequal.R
unfinished/group.R
unfinished/separate.R
unfinished/slide.R
unfinished/sokoban.R
unruly.R
untangle.R

diff --git a/Recipe b/Recipe
index 6e4b8f0ec9a19854a9f206f669260f289188750b..79098f28ef0a86cd779d86c62183c56e9478d5fd 100644 (file)
--- a/Recipe
+++ b/Recipe
@@ -142,7 +142,10 @@ BUILT_SOURCES = empty.h
 CLEANFILES = empty.h
 empty.h: $(allsources)
        echo '/* Empty file touched by automake makefile to force rebuild of version.o */' >$@
-
+bin_PROGRAMS = $(GAMES)
+!end
+!begin am_begin
+GAMES =
 !end
 !begin >empty.h
 /* Empty file touched by automake makefile to force rebuild of version.o */
index 65220be75d60434e273d77b294ce545c326f3e04..d30f8843aaf470e350df0f2f9dc19bba57884c65 100644 (file)
@@ -6,7 +6,7 @@ blackbox : [G] WINDOWS COMMON blackbox blackbox.res|noicon.res
 
 ALL += blackbox[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += blackbox
 !end
 
index 2f0fd6cc3569d350b66dab7d6c000d8e922e2bb9..629f785258ff39cff2c51adb68077be5e370c157 100644 (file)
--- a/bridges.R
+++ b/bridges.R
@@ -8,7 +8,7 @@ bridges  : [G] WINDOWS COMMON bridges BRIDGES_EXTRA bridges.res|noicon.res
 
 ALL += bridges[COMBINED] BRIDGES_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += bridges
 !end
 
diff --git a/cube.R b/cube.R
index 8fa472c123e5454bce96283507c48343f6e50b79..3d0b17a01d03d98142261d486458e833f48e6b49 100644 (file)
--- a/cube.R
+++ b/cube.R
@@ -6,7 +6,7 @@ cube     : [G] WINDOWS COMMON cube cube.res|noicon.res
 
 ALL += cube[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += cube
 !end
 
index 23936269cedc599b117262bc93f37ac046c3f99b..e0d50f67c9e9b2e520e813169beaa0db8cd33855 100644 (file)
@@ -8,7 +8,7 @@ dominosa : [G] WINDOWS COMMON dominosa DOMINOSA_EXTRA dominosa.res|noicon.res
 
 ALL += dominosa[COMBINED] DOMINOSA_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += dominosa
 !end
 
index 9a3f72bfc9bdc3f3474072a7c9c1d02ffc8f5f1d..1582af69db1df9afab379b5632b675012c3e80ec 100644 (file)
--- a/fifteen.R
+++ b/fifteen.R
@@ -6,7 +6,7 @@ fifteen  : [G] WINDOWS COMMON fifteen fifteen.res|noicon.res
 
 ALL += fifteen[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += fifteen
 !end
 
index 3769c006002da41ef5e5ee45d25790cf9a9a35ca..20ad0e0c124c458cf0620a61d299c430d78201df 100644 (file)
--- a/filling.R
+++ b/filling.R
@@ -11,7 +11,7 @@ filling : [G] WINDOWS COMMON filling FILLING_EXTRA filling.res|noicon.res
 
 ALL += filling[COMBINED] FILLING_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += filling
 !end
 
diff --git a/flip.R b/flip.R
index 997c7c214097c44687fe256404135dc4c38de637..6e2cb189bac540d1c6adef9d9d5eb37b59314136 100644 (file)
--- a/flip.R
+++ b/flip.R
@@ -8,7 +8,7 @@ flip     : [G] WINDOWS COMMON flip FLIP_EXTRA flip.res|noicon.res
 
 ALL += flip[COMBINED] FLIP_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += flip
 !end
 
index 91e814bd8ed9f9caf6cd70f97dcb91c1a65687d1..546fd00ff6d3ef7d546fc77d76a2f60ddb6a70db 100644 (file)
@@ -15,7 +15,7 @@ galaxiespicture : [C] galaxies[STANDALONE_PICTURE_GENERATOR] GALAXIES_EXTRA STAN
 
 ALL += galaxies[COMBINED] GALAXIES_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += galaxies
 !end
 
diff --git a/guess.R b/guess.R
index b5896459ac7f54d4520cccf72f2ae97b5eb6a574..9878d286545f333c71f02b8c04d7f519f294380c 100644 (file)
--- a/guess.R
+++ b/guess.R
@@ -6,7 +6,7 @@ guess    : [G] WINDOWS COMMON guess guess.res|noicon.res
 
 ALL += guess[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += guess
 !end
 
index 24b4d16e700564aa662054c8cced9c7f9fdf0a63..6927192fbe25013f58fca3eb9ecc93da05641c05 100644 (file)
--- a/inertia.R
+++ b/inertia.R
@@ -6,7 +6,7 @@ inertia  : [G] WINDOWS COMMON inertia inertia.res|noicon.res
 
 ALL += inertia[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += inertia
 !end
 
diff --git a/keen.R b/keen.R
index 06e7aa0fbcf91e2740c9e1ad09770f3784acd66f..be895f9dfb0cb40a6ebbf49f9d723fba3b8abcc7 100644 (file)
--- a/keen.R
+++ b/keen.R
@@ -12,7 +12,7 @@ keensolver : [C] keen[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] KEEN_LATIN_EXT
 
 ALL += keen[COMBINED] KEEN_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += keen
 !end
 
index 82b6bdc991ee7bfbd365ac7ca74d438ab9ffda31..04542e14c6ac91d38661d03c7f7b14d6a6407d18 100644 (file)
--- a/lightup.R
+++ b/lightup.R
@@ -11,7 +11,7 @@ lightupsolver : [C] lightup[STANDALONE_SOLVER] LIGHTUP_EXTRA STANDALONE
 
 ALL += lightup[COMBINED] LIGHTUP_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += lightup
 !end
 
diff --git a/loopy.R b/loopy.R
index 7f68b371cfb08f13ad01e266794a6ef7eeac2add..21cdf13b3cfedf000be0becba55e68b36265814f 100644 (file)
--- a/loopy.R
+++ b/loopy.R
@@ -18,7 +18,7 @@ loopysolver :   [C] loopy[STANDALONE_SOLVER] LOOPY_EXTRA STANDALONE
 
 ALL += loopy[COMBINED] LOOPY_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += loopy
 !end
 
index 997371fd4d95ed924f0fa1826c84cb7c7622dfea..1c1be5a870fc9986e042bc02db43a7d7c1a07824 100644 (file)
--- a/magnets.R
+++ b/magnets.R
@@ -11,7 +11,7 @@ magnetssolver :     [C] magnets[STANDALONE_SOLVER] MAGNETS_EXTRA STANDALONE
 
 ALL += magnets[COMBINED] MAGNETS_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += magnets
 !end
 
diff --git a/map.R b/map.R
index f5950b4637da490c4353a500c8997e447f6232d8..90830a48570e6b1dae1f9cefcfaff6a0ec698033 100644 (file)
--- a/map.R
+++ b/map.R
@@ -11,7 +11,7 @@ mapsolver :     [C] map[STANDALONE_SOLVER] MAP_EXTRA STANDALONE
 
 ALL += map[COMBINED] MAP_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += map
 !end
 
diff --git a/mines.R b/mines.R
index 0212a48e39a2b64a3c03e3bf680bdeaecff90b4f..317bc73b619a19d48961e21aa105b0518fa35c5a 100644 (file)
--- a/mines.R
+++ b/mines.R
@@ -11,7 +11,7 @@ mineobfusc :    [C] mines[STANDALONE_OBFUSCATOR] MINES_EXTRA STANDALONE
 
 ALL += mines[COMBINED] MINES_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += mines
 !end
 
index d532c95204c7340dfefa02b1753ed46b3dd8b3dd..5c91502edfd3926bb898c7f91810903b4c0ad00e 100755 (executable)
@@ -57,7 +57,8 @@ eval 'chdir "charset"; require "sbcsgen.pl"; chdir ".."';
 
 @srcdirs = ("./");
 
-$divert = undef; # ref to scalar in which text is currently being put
+$divert = undef; # ref to array of refs of scalars in which text is
+                 # currently being put
 $help = ""; # list of newline-free lines of help text
 $project_name = "project"; # this is a good enough default
 %makefiles = (); # maps makefile types to output makefile pathnames
@@ -83,14 +84,16 @@ readinput: while (1) {
       if ((defined $_[0]) && $_[0] eq "!end") {
          $divert = undef;
       } else {
-         ${$divert} .= "$_\n";
+          for my $ref (@$divert) {
+              ${$ref} .= "$_\n";
+          }
       }
       next;
   }
   # Skip comments and blank lines.
   next if /^\s*#/ or scalar @_ == 0;
 
-  if ($_[0] eq "!begin" and $_[1] eq "help") { $divert = \$help; next; }
+  if ($_[0] eq "!begin" and $_[1] eq "help") { $divert = [\$help]; next; }
   if ($_[0] eq "!name") { $project_name = $_[1]; next; }
   if ($_[0] eq "!srcdir") { push @srcdirs, $_[1]; next; }
   if ($_[0] eq "!makefile" and &mfval($_[1])) { $makefiles{$_[1]}=$_[2]; next;}
@@ -102,10 +105,15 @@ readinput: while (1) {
       next;
   }
   if ($_[0] eq "!begin") {
-      if ($_[1] =~ /^>(.*)/) {
-         $divert = \$auxfiles{$1};
-      } elsif (&mfval($_[1])) {
-         $divert = \$makefile_extra{$_[1]};
+      my @args = @_;
+      shift @args;
+      $divert = [];
+      for my $component (@args) {
+          if ($component =~ /^>(.*)/) {
+              push @$divert, \$auxfiles{$1};
+          } elsif ($component =~ /^([^_]*)(_.*)?$/ and &mfval($1)) {
+              push @$divert, \$makefile_extra{$component};
+          }
       }
       next;
   }
@@ -1190,19 +1198,18 @@ if (defined $makefiles{'am'}) {
     "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
     "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n\n";
 
-    @binprogs = ();
+    print $makefile_extra{'am_begin'} || "";
+
+    # All programs go in noinstprogs by default. If you want them
+    # installed anywhere else, you have to also add them to
+    # bin_PROGRAMS using '!begin am'. (Automake doesn't seem to mind
+    # having a program name in _both_ of bin_PROGRAMS and
+    # noinst_PROGRAMS.)
     @noinstprogs = ();
     foreach $p (&prognames("X:U")) {
         ($prog, $type) = split ",", $p;
-        if ("FIXME") { # decide which programs go where
-            push @binprogs, # FIXME "\$(BINPREFIX)" .
-                $prog;
-        } else {
-            push @noinstprogs, # FIXME "\$(BINPREFIX)" .
-                $prog;
-        }
+        push @noinstprogs, $prog;
     }
-    print &splitline(join " ", "bin_PROGRAMS", "=", @binprogs), "\n";
     print &splitline(join " ", "noinst_PROGRAMS", "=", @noinstprogs), "\n";
 
     %objtosrc = ();
diff --git a/net.R b/net.R
index b5442781c972dc049f427184f6342c41e597a314..aa6a1680375c0380eb0e21b0ad1333224f4b4ee3 100644 (file)
--- a/net.R
+++ b/net.R
@@ -10,7 +10,7 @@ netgame  : [G] WINDOWS COMMON net NET_EXTRA net.res|noicon.res
 
 ALL += net[COMBINED] NET_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += net
 !end
 
index 4a35e77850b1226e04992d8c4052149dc9d6fc9c..de400bdc8ebb3fb1a41ec5db60c2655721c78708 100644 (file)
@@ -8,7 +8,7 @@ netslide : [G] WINDOWS COMMON netslide NETSLIDE_EXTRA netslide.res|noicon.res
 
 ALL += netslide[COMBINED] NETSLIDE_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += netslide
 !end
 
index fe83bae9f0d34edc2f040e71518568f686f774b9..054405225cd1f3f2b75e7b9209d95487de4b8df4 100644 (file)
--- a/pattern.R
+++ b/pattern.R
@@ -9,7 +9,7 @@ patternsolver : [C] pattern[STANDALONE_SOLVER] STANDALONE
 
 ALL += pattern[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += pattern
 !end
 
diff --git a/pearl.R b/pearl.R
index 3d24b3d3b4e14975246021e2f4dac024145b2dd8..86b786845741a57c7854c9bf7f0194d1bf0996b9 100644 (file)
--- a/pearl.R
+++ b/pearl.R
@@ -10,7 +10,7 @@ pearlbench     : [C] pearl[STANDALONE_SOLVER] PEARL_EXTRA STANDALONE
 
 ALL += pearl[COMBINED] PEARL_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += pearl
 !end
 
diff --git a/pegs.R b/pegs.R
index d461bca28e216b2ea85087796a607ac92530a055..f7bd4f0cb77f327302469f455f88f40cf6003bb7 100644 (file)
--- a/pegs.R
+++ b/pegs.R
@@ -8,7 +8,7 @@ pegs     : [G] WINDOWS COMMON pegs PEGS_EXTRA pegs.res|noicon.res
 
 ALL += pegs[COMBINED] PEGS_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += pegs
 !end
 
diff --git a/range.R b/range.R
index 79303d985444ff181df68a6706ddf8adface93ea..1a3684b983f025a6e41d147c29c5e03463c2ee05 100644 (file)
--- a/range.R
+++ b/range.R
@@ -6,7 +6,7 @@ range    : [G] WINDOWS COMMON range range.res|noicon.res
 
 ALL += range[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += range
 !end
 
diff --git a/rect.R b/rect.R
index f599ec8817bd9f10f5f8a344ea57135240afd638..454e02f21df5fe36e66964ebe34e3ae31053d308 100644 (file)
--- a/rect.R
+++ b/rect.R
@@ -6,7 +6,7 @@ rect     : [G] WINDOWS COMMON rect rect.res|noicon.res
 
 ALL += rect[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += rect
 !end
 
index 6d016688f118009179bec2a7821de35718604ec4..d603c1ac0d13809a17df158588c3b4c70bbc5b0a 100644 (file)
@@ -6,7 +6,7 @@ samegame : [G] WINDOWS COMMON samegame samegame.res|noicon.res
 
 ALL += samegame[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += samegame
 !end
 
index 58789da6dfc3cfec652b31eeae47d63d55943493..5f7d32228bdc3a09a39cf1b3edd1f288172fe786 100644 (file)
@@ -10,7 +10,7 @@ signpostsolver : [C] signpost[STANDALONE_SOLVER] SIGNPOST_EXTRA STANDALONE
 
 ALL += signpost[COMBINED] SIGNPOST_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += signpost
 !end
 
index 5220eeb0a8df4e462870d5d06fc37200a002dd05..591ef4a3740ed252118b81d5541fd7bdba0e97e7 100644 (file)
--- a/singles.R
+++ b/singles.R
@@ -10,7 +10,7 @@ ALL += singles[COMBINED] SINGLES_EXTRA
 singlessolver : [U] singles[STANDALONE_SOLVER] SINGLES_EXTRA STANDALONE
 singlessolver : [C] singles[STANDALONE_SOLVER] SINGLES_EXTRA STANDALONE
 
-!begin gtk
+!begin am gtk
 GAMES += singles
 !end
 
index 1d16aa82aaec3c2cda954bd94b9348bf2cb8345e..810279b38d2b380cb5b2bbca249968e84da7ee9d 100644 (file)
--- a/sixteen.R
+++ b/sixteen.R
@@ -6,7 +6,7 @@ sixteen  : [G] WINDOWS COMMON sixteen sixteen.res|noicon.res
 
 ALL += sixteen[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += sixteen
 !end
 
diff --git a/slant.R b/slant.R
index 6086025c70ae481df4642735f132f234874b78d4..2590d1a824b0dd2290005d830ff354bd7fb18a93 100644 (file)
--- a/slant.R
+++ b/slant.R
@@ -11,7 +11,7 @@ slantsolver :   [C] slant[STANDALONE_SOLVER] SLANT_EXTRA STANDALONE
 
 ALL += slant[COMBINED] SLANT_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += slant
 !end
 
diff --git a/solo.R b/solo.R
index af0a1c38770fcf221dc51d5c98dc6abd43f8c4d6..bdf8ba0f9962ffa9389b2d1e51fbc07dbcd9018e 100644 (file)
--- a/solo.R
+++ b/solo.R
@@ -11,7 +11,7 @@ solosolver :    [C] solo[STANDALONE_SOLVER] SOLO_EXTRA STANDALONE
 
 ALL += solo[COMBINED] SOLO_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += solo
 !end
 
diff --git a/tents.R b/tents.R
index a0a64a54fd74aecb8989a73a5efe2599de897633..70caa36ca636f88b53d072aace580d3ec559ec35 100644 (file)
--- a/tents.R
+++ b/tents.R
@@ -11,7 +11,7 @@ ALL += tents[COMBINED] TENTS_EXTRA
 tentssolver :   [U] tents[STANDALONE_SOLVER] TENTS_EXTRA STANDALONE
 tentssolver :   [C] tents[STANDALONE_SOLVER] TENTS_EXTRA STANDALONE
 
-!begin gtk
+!begin am gtk
 GAMES += tents
 !end
 
index eb774013fb57f9cef9b7a8734fb2033a85e73347..93f7f1fdd259fcd3889ae9d487e21f38b056037c 100644 (file)
--- a/towers.R
+++ b/towers.R
@@ -12,7 +12,7 @@ towerssolver : [C] towers[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] TOWERS_LAT
 
 ALL += towers[COMBINED] TOWERS_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += towers
 !end
 
index c9337d60d2c4eec657dfc648eee602c611a9da08..e346df976c9ccb595135424884cb0693c641fe85 100644 (file)
--- a/twiddle.R
+++ b/twiddle.R
@@ -6,7 +6,7 @@ twiddle  : [G] WINDOWS COMMON twiddle twiddle.res|noicon.res
 
 ALL += twiddle[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += twiddle
 !end
 
index 792678ee03ca338865b51ca69edd3eb3cc8201f6..af54bd1a28ec99714f2651662e7ef31af99953e0 100644 (file)
--- a/undead.R
+++ b/undead.R
@@ -5,7 +5,7 @@ undead : [G] WINDOWS COMMON undead undead.res|noicon.res
 
 ALL += undead[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += undead
 !end
 
index 8f755d11b95af012d83c38546fb7210a36defdbf..a0c742323d84c4b7a70ab1402b2f2432493501a9 100644 (file)
--- a/unequal.R
+++ b/unequal.R
@@ -14,7 +14,7 @@ latincheck : [C] latin[STANDALONE_LATIN_TEST] tree234 maxflow STANDALONE
 
 ALL += unequal[COMBINED] UNEQUAL_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += unequal
 !end
 
index 83a27e5ff8ed1840b54ac68e801c04481ce6c0d7..498d1b155a6ff372d44e5f4d86f92b4d8a7bbe4e 100644 (file)
@@ -12,7 +12,7 @@ groupsolver : [C] group[STANDALONE_SOLVER] latin[STANDALONE_SOLVER] GROUP_LATIN_
 
 ALL += group[COMBINED] GROUP_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += group
 !end
 
index 291de79574100ec25507561a12a1a0d6277546ea..18a7582ca2c55f0d3aa80ed83c2b848e30c457c9 100644 (file)
@@ -8,7 +8,7 @@ separate       : [G] WINDOWS COMMON separate SEPARATE_EXTRA separate.res|noicon.
 
 ALL += separate[COMBINED] SEPARATE_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += separate
 !end
 
index 12440a1f83fcc892c0a504586d3ce7f7b8d381d0..daf24d842c960d3e19810c3716a282c7aacf5dcd 100644 (file)
@@ -11,7 +11,7 @@ slidesolver :   [C] slide[STANDALONE_SOLVER] SLIDE_EXTRA STANDALONE
 
 ALL += slide[COMBINED] SLIDE_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += slide
 !end
 
index d86afe10df0a01562b5cdb65638f77a941ce1757..86adcaecd2410d2d60c24ff045af2c6d2aaacd00 100644 (file)
@@ -6,7 +6,7 @@ sokoban  : [G] WINDOWS COMMON sokoban sokoban.res?
 
 ALL += sokoban[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += sokoban
 !end
 
index da02c34a2a0c180e0729708a0e9f74e1811de7f3..0b44e10b584ba68f9359c1868d67e78fcc455380 100644 (file)
--- a/unruly.R
+++ b/unruly.R
@@ -8,7 +8,7 @@ unrulysolver : [C] unruly[STANDALONE_SOLVER] STANDALONE
 
 ALL += unruly[COMBINED]
 
-!begin gtk
+!begin am gtk
 GAMES += unruly
 !end
 
index 868eb9300aaabedd1acbf1781d93a7a5c14b2916..03d813fa136c32e902ab4466b2f7ac79d862c4fc 100644 (file)
@@ -8,7 +8,7 @@ untangle : [G] WINDOWS COMMON untangle UNTANGLE_EXTRA untangle.res|noicon.res
 
 ALL += untangle[COMBINED] UNTANGLE_EXTRA
 
-!begin gtk
+!begin am gtk
 GAMES += untangle
 !end