--- /dev/null
+{- # -*- Mode: perl -*-
+
+ # Commonly used list of generated files
+ # The reason for the complexity is that the build.info files provide
+ # GENERATE rules for *all* platforms without discrimination, while the
+ # build files only want those for a particular build. Therefore, we
+ # need to extrapolate exactly what we need to generate. The way to do
+ # that is to extract all possible source files from diverse tables and
+ # filter out all that are not generated
+ my %generatables =
+ map { $_ => 1 }
+ ( # The sources of stuff may be generated
+ ( map { @{$unified_info{sources}->{$_}} }
+ keys %{$unified_info{sources}} ),
+ $disabled{shared}
+ ? ()
+ : ( map { @{$unified_info{shared_sources}->{$_}} }
+ keys %{$unified_info{shared_sources}} ),
+ # Things we explicitely depend on are usually generated
+ ( map { $_ eq "" ? () : @{$unified_info{depends}->{$_}} }
+ keys %{$unified_info{depends}} ));
+ our @generated =
+ sort ( ( grep { defined $unified_info{generate}->{$_} }
+ sort keys %generatables ),
+ # Scripts are assumed to be generated, so add thhem too
+ ( grep { defined $unified_info{sources}->{$_} }
+ @{$unified_info{scripts}} ) );
+
+ # Avoid strange output
+ "";
+-}
our @install_shlibs =
map { $unified_info{sharednames}->{$_} || () }
grep(!/\.a$/, @{$unified_info{install}->{libraries}});
- our @generated = ( ( map { (my $x = $_) =~ s|\.[sS]$|\.asm|; $x }
- grep { defined $unified_info{generate}->{$_} }
- map { @{$unified_info{sources}->{$_}} }
- grep { /\.o$/ } keys %{$unified_info{sources}} ),
- ( grep { /\.(?:h|opt)$/ } keys %{$unified_info{generate}} ) );
# This is a horrible hack, but is needed because recursive inclusion of files
# in different directories does not work well with HP C.
join(", ", map { "-\n\t".$_ } @deps); -}
{- output_on() if $disabled{makedepend}; "" -}
GENERATED_MANDATORY={- join(", ", map { "-\n\t".$_ } @{$unified_info{depends}->{""}} ) -}
-GENERATED={- join(", ", map { "-\n\t".$_ } @generated) -}
+GENERATED={- # common0.tmpl provides @generated
+ join(", ", map { (my $x = $_) =~ s|\.[sS]$|.asm|; "-\n\t".$x }
+ @generated) -}
INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
keys %{$unified_info{sources}}); -}
{- output_on() if $disabled{makedepend}; "" -}
-GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
-GENERATED={- join(" ",
- ( grep { defined $unified_info{generate}->{$_} }
- map { @{$unified_info{sources}->{$_}} }
- grep { /\.(?:o|res)$/ } keys %{$unified_info{sources}} ),
- ( grep { /\.(?:h|map|def)$/ } keys %{$unified_info{generate}} )) -}
+GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}}) -}
+GENERATED={- # common0.tmpl provides @generated
+ join(" ", @generated ) -}
INSTALL_LIBS={- join(" ", map { lib($_) } @{$unified_info{install}->{libraries}}) -}
INSTALL_SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{install}->{libraries}}) -}
keys %{$unified_info{sources}}); -}
{- output_on() if $disabled{makedepend}; "" -}
GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
-GENERATED={- join(" ",
- ( map { (my $x = $_) =~ s|\.[sS]$|\.asm|; $x }
- grep { defined $unified_info{generate}->{$_} }
- map { @{$unified_info{sources}->{$_}} }
- grep { /\.o$/ } keys %{$unified_info{sources}} ),
- ( grep { /\.(?:h|def)$/ } keys %{$unified_info{generate}} )) -}
+GENERATED={- # common0.tmpl provides @generated
+ join(" ", map { (my $x = $_) =~ s|\.[sS]$|.asm|; $x }
+ @generated) -}
INSTALL_LIBS={- join(" ", map { lib($_) } @{$unified_info{install}->{libraries}}) -}
INSTALL_SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{install}->{libraries}}) -}
die "*** Couldn't find any of:\n", join("\n", @build_file_templates), "\n";
}
$config{build_file_templates}
- = [ $build_file_template,
+ = [ cleanfile($srcdir, catfile("Configurations", "common0.tmpl"),
+ $blddir),
+ $build_file_template,
cleanfile($srcdir, catfile("Configurations", "common.tmpl"),
$blddir) ];