mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 16:32:13 -07:00
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:
39
mkfiles.pl
39
mkfiles.pl
@ -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 = ();
|
||||
|
Reference in New Issue
Block a user