ref: c06792c07609eacf6db0881f62a3391547c77248
parent: b375232d7dc8357e820ec00808749d077c8b06b9
author: Simon Tatham <anakin@pobox.com>
date: Sun Jun 30 06:16:57 EDT 2013
Add a mechanism to the automake system to allow 'make install' to only install the actual games, not the auxiliary binaries or nullgame. [originally from svn r9887]
--- a/Recipe
+++ b/Recipe
@@ -142,7 +142,10 @@
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 */
--- a/blackbox.R
+++ b/blackbox.R
@@ -6,7 +6,7 @@
ALL += blackbox[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += blackbox
!end
--- a/bridges.R
+++ b/bridges.R
@@ -8,7 +8,7 @@
ALL += bridges[COMBINED] BRIDGES_EXTRA
-!begin gtk
+!begin am gtk
GAMES += bridges
!end
--- a/cube.R
+++ b/cube.R
@@ -6,7 +6,7 @@
ALL += cube[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += cube
!end
--- a/dominosa.R
+++ b/dominosa.R
@@ -8,7 +8,7 @@
ALL += dominosa[COMBINED] DOMINOSA_EXTRA
-!begin gtk
+!begin am gtk
GAMES += dominosa
!end
--- a/fifteen.R
+++ b/fifteen.R
@@ -6,7 +6,7 @@
ALL += fifteen[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += fifteen
!end
--- a/filling.R
+++ b/filling.R
@@ -11,7 +11,7 @@
ALL += filling[COMBINED] FILLING_EXTRA
-!begin gtk
+!begin am gtk
GAMES += filling
!end
--- a/flip.R
+++ b/flip.R
@@ -8,7 +8,7 @@
ALL += flip[COMBINED] FLIP_EXTRA
-!begin gtk
+!begin am gtk
GAMES += flip
!end
--- a/galaxies.R
+++ b/galaxies.R
@@ -15,7 +15,7 @@
ALL += galaxies[COMBINED] GALAXIES_EXTRA
-!begin gtk
+!begin am gtk
GAMES += galaxies
!end
--- a/guess.R
+++ b/guess.R
@@ -6,7 +6,7 @@
ALL += guess[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += guess
!end
--- a/inertia.R
+++ b/inertia.R
@@ -6,7 +6,7 @@
ALL += inertia[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += inertia
!end
--- a/keen.R
+++ b/keen.R
@@ -12,7 +12,7 @@
ALL += keen[COMBINED] KEEN_EXTRA
-!begin gtk
+!begin am gtk
GAMES += keen
!end
--- a/lightup.R
+++ b/lightup.R
@@ -11,7 +11,7 @@
ALL += lightup[COMBINED] LIGHTUP_EXTRA
-!begin gtk
+!begin am gtk
GAMES += lightup
!end
--- a/loopy.R
+++ b/loopy.R
@@ -18,7 +18,7 @@
ALL += loopy[COMBINED] LOOPY_EXTRA
-!begin gtk
+!begin am gtk
GAMES += loopy
!end
--- a/magnets.R
+++ b/magnets.R
@@ -11,7 +11,7 @@
ALL += magnets[COMBINED] MAGNETS_EXTRA
-!begin gtk
+!begin am gtk
GAMES += magnets
!end
--- a/map.R
+++ b/map.R
@@ -11,7 +11,7 @@
ALL += map[COMBINED] MAP_EXTRA
-!begin gtk
+!begin am gtk
GAMES += map
!end
--- a/mines.R
+++ b/mines.R
@@ -11,7 +11,7 @@
ALL += mines[COMBINED] MINES_EXTRA
-!begin gtk
+!begin am gtk
GAMES += mines
!end
--- a/mkfiles.pl
+++ b/mkfiles.pl
@@ -57,7 +57,8 @@
@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,7 +84,9 @@
if ((defined $_[0]) && $_[0] eq "!end") {
$divert = undef;
} else {
- ${$divert} .= "$_\n";
+ for my $ref (@$divert) {
+ ${$ref} .= "$_\n";
+ }
}
next;
}
@@ -90,7 +93,7 @@
# 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 @@
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 @@
"#\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 = ();
--- a/net.R
+++ b/net.R
@@ -10,7 +10,7 @@
ALL += net[COMBINED] NET_EXTRA
-!begin gtk
+!begin am gtk
GAMES += net
!end
--- a/netslide.R
+++ b/netslide.R
@@ -8,7 +8,7 @@
ALL += netslide[COMBINED] NETSLIDE_EXTRA
-!begin gtk
+!begin am gtk
GAMES += netslide
!end
--- a/pattern.R
+++ b/pattern.R
@@ -9,7 +9,7 @@
ALL += pattern[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += pattern
!end
--- a/pearl.R
+++ b/pearl.R
@@ -10,7 +10,7 @@
ALL += pearl[COMBINED] PEARL_EXTRA
-!begin gtk
+!begin am gtk
GAMES += pearl
!end
--- a/pegs.R
+++ b/pegs.R
@@ -8,7 +8,7 @@
ALL += pegs[COMBINED] PEGS_EXTRA
-!begin gtk
+!begin am gtk
GAMES += pegs
!end
--- a/range.R
+++ b/range.R
@@ -6,7 +6,7 @@
ALL += range[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += range
!end
--- a/rect.R
+++ b/rect.R
@@ -6,7 +6,7 @@
ALL += rect[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += rect
!end
--- a/samegame.R
+++ b/samegame.R
@@ -6,7 +6,7 @@
ALL += samegame[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += samegame
!end
--- a/signpost.R
+++ b/signpost.R
@@ -10,7 +10,7 @@
ALL += signpost[COMBINED] SIGNPOST_EXTRA
-!begin gtk
+!begin am gtk
GAMES += signpost
!end
--- a/singles.R
+++ b/singles.R
@@ -10,7 +10,7 @@
singlessolver : [U] singles[STANDALONE_SOLVER] SINGLES_EXTRA STANDALONE
singlessolver : [C] singles[STANDALONE_SOLVER] SINGLES_EXTRA STANDALONE
-!begin gtk
+!begin am gtk
GAMES += singles
!end
--- a/sixteen.R
+++ b/sixteen.R
@@ -6,7 +6,7 @@
ALL += sixteen[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += sixteen
!end
--- a/slant.R
+++ b/slant.R
@@ -11,7 +11,7 @@
ALL += slant[COMBINED] SLANT_EXTRA
-!begin gtk
+!begin am gtk
GAMES += slant
!end
--- a/solo.R
+++ b/solo.R
@@ -11,7 +11,7 @@
ALL += solo[COMBINED] SOLO_EXTRA
-!begin gtk
+!begin am gtk
GAMES += solo
!end
--- a/tents.R
+++ b/tents.R
@@ -11,7 +11,7 @@
tentssolver : [U] tents[STANDALONE_SOLVER] TENTS_EXTRA STANDALONE
tentssolver : [C] tents[STANDALONE_SOLVER] TENTS_EXTRA STANDALONE
-!begin gtk
+!begin am gtk
GAMES += tents
!end
--- a/towers.R
+++ b/towers.R
@@ -12,7 +12,7 @@
ALL += towers[COMBINED] TOWERS_EXTRA
-!begin gtk
+!begin am gtk
GAMES += towers
!end
--- a/twiddle.R
+++ b/twiddle.R
@@ -6,7 +6,7 @@
ALL += twiddle[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += twiddle
!end
--- a/undead.R
+++ b/undead.R
@@ -5,7 +5,7 @@
ALL += undead[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += undead
!end
--- a/unequal.R
+++ b/unequal.R
@@ -14,7 +14,7 @@
ALL += unequal[COMBINED] UNEQUAL_EXTRA
-!begin gtk
+!begin am gtk
GAMES += unequal
!end
--- a/unfinished/group.R
+++ b/unfinished/group.R
@@ -12,7 +12,7 @@
ALL += group[COMBINED] GROUP_EXTRA
-!begin gtk
+!begin am gtk
GAMES += group
!end
--- a/unfinished/separate.R
+++ b/unfinished/separate.R
@@ -8,7 +8,7 @@
ALL += separate[COMBINED] SEPARATE_EXTRA
-!begin gtk
+!begin am gtk
GAMES += separate
!end
--- a/unfinished/slide.R
+++ b/unfinished/slide.R
@@ -11,7 +11,7 @@
ALL += slide[COMBINED] SLIDE_EXTRA
-!begin gtk
+!begin am gtk
GAMES += slide
!end
--- a/unfinished/sokoban.R
+++ b/unfinished/sokoban.R
@@ -6,7 +6,7 @@
ALL += sokoban[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += sokoban
!end
--- a/unruly.R
+++ b/unruly.R
@@ -8,7 +8,7 @@
ALL += unruly[COMBINED]
-!begin gtk
+!begin am gtk
GAMES += unruly
!end
--- a/untangle.R
+++ b/untangle.R
@@ -8,7 +8,7 @@
ALL += untangle[COMBINED] UNTANGLE_EXTRA
-!begin gtk
+!begin am gtk
GAMES += untangle
!end