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]
This commit is contained in:
Simon Tatham
2013-06-30 10:16:57 +00:00
parent b375232d7d
commit c06792c076
42 changed files with 67 additions and 57 deletions

5
Recipe
View File

@ -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 */

View 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

View File

@ -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

2
cube.R
View File

@ -6,7 +6,7 @@ cube : [G] WINDOWS COMMON cube cube.res|noicon.res
ALL += cube[COMBINED]
!begin gtk
!begin am gtk
GAMES += cube
!end

View 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

View File

@ -6,7 +6,7 @@ fifteen : [G] WINDOWS COMMON fifteen fifteen.res|noicon.res
ALL += fifteen[COMBINED]
!begin gtk
!begin am gtk
GAMES += fifteen
!end

View File

@ -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

2
flip.R
View File

@ -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

View 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

View File

@ -6,7 +6,7 @@ guess : [G] WINDOWS COMMON guess guess.res|noicon.res
ALL += guess[COMBINED]
!begin gtk
!begin am gtk
GAMES += guess
!end

View File

@ -6,7 +6,7 @@ inertia : [G] WINDOWS COMMON inertia inertia.res|noicon.res
ALL += inertia[COMBINED]
!begin gtk
!begin am gtk
GAMES += inertia
!end

2
keen.R
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

2
map.R
View File

@ -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

View File

@ -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

View File

@ -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 = ();

2
net.R
View File

@ -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

View 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

View File

@ -9,7 +9,7 @@ patternsolver : [C] pattern[STANDALONE_SOLVER] STANDALONE
ALL += pattern[COMBINED]
!begin gtk
!begin am gtk
GAMES += pattern
!end

View File

@ -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

2
pegs.R
View File

@ -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

View File

@ -6,7 +6,7 @@ range : [G] WINDOWS COMMON range range.res|noicon.res
ALL += range[COMBINED]
!begin gtk
!begin am gtk
GAMES += range
!end

2
rect.R
View File

@ -6,7 +6,7 @@ rect : [G] WINDOWS COMMON rect rect.res|noicon.res
ALL += rect[COMBINED]
!begin gtk
!begin am gtk
GAMES += rect
!end

View 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

View 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

View File

@ -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

View File

@ -6,7 +6,7 @@ sixteen : [G] WINDOWS COMMON sixteen sixteen.res|noicon.res
ALL += sixteen[COMBINED]
!begin gtk
!begin am gtk
GAMES += sixteen
!end

View File

@ -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

2
solo.R
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -6,7 +6,7 @@ twiddle : [G] WINDOWS COMMON twiddle twiddle.res|noicon.res
ALL += twiddle[COMBINED]
!begin gtk
!begin am gtk
GAMES += twiddle
!end

View File

@ -5,7 +5,7 @@ undead : [G] WINDOWS COMMON undead undead.res|noicon.res
ALL += undead[COMBINED]
!begin gtk
!begin am gtk
GAMES += undead
!end

View File

@ -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

View 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

View 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

View 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

View File

@ -6,7 +6,7 @@ sokoban : [G] WINDOWS COMMON sokoban sokoban.res?
ALL += sokoban[COMBINED]
!begin gtk
!begin am gtk
GAMES += sokoban
!end

View File

@ -8,7 +8,7 @@ unrulysolver : [C] unruly[STANDALONE_SOLVER] STANDALONE
ALL += unruly[COMBINED]
!begin gtk
!begin am gtk
GAMES += unruly
!end

View 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