diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-01-19 20:52:40 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-01-19 20:52:40 +0000 |
commit | 974ed2bedc78ab300f90ecbabdd0ac9c1fcf0589 (patch) | |
tree | b7cac5755701ad576cc03fcab881494152fa8e92 /lib/sbin/CST | |
parent | 50e996a7aaed180f7dae413b773282b57c1905b1 (diff) |
Fix dependency generation
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3535 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CST')
-rw-r--r-- | lib/sbin/CST | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/lib/sbin/CST b/lib/sbin/CST index e761ceb3..82c0ede1 100644 --- a/lib/sbin/CST +++ b/lib/sbin/CST @@ -6,7 +6,7 @@ # @desc # Parses the the configuration files for thorns. # @enddesc -# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.60 2004-01-19 14:22:04 schnetter Exp $ +# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.61 2004-01-19 20:52:40 schnetter Exp $ #@@*/ # Global parameter to track the number of errors from the CST @@ -303,6 +303,7 @@ sub CreateMakeThornlist my($thornlist); my($thorn_linklist); my($config_thornlist); + my($thorn_dependencies); $thornlist = 'THORNS ='; $thorn_linklist = 'THORN_LINKLIST ='; @@ -326,7 +327,9 @@ sub CreateMakeThornlist $thorn_linklist .= ' ' . &CreateThornLinkList($thorns, $config); - return ($thornlist . "\n" . $thorn_linklist . "\n" . $config_thornlist . "\n"); + $thorn_dependencies = join ("\n", &CreateThornDependencyList($thorns, $config)); + + return ($thornlist . "\n" . $thorn_linklist . "\n" . $config_thornlist . "\n" . $thorn_dependencies . "\n"); } @@ -352,8 +355,7 @@ sub CreateThornLinkList # add this thorn to the thorn liblist # as well as any other thorns it requires (directly or indirectly) - push (@liblist, $thorn, RequiredThorns ($thorn, $thorn, $config), - 'Cactus', 'CactusBindings'); + push (@liblist, $thorn, RequiredThorns ($thorn, $thorn, $config)); } # remove duplicate entries from the list, only keeping the rightmost @@ -374,6 +376,37 @@ sub CreateThornLinkList #/*@@ +# @routine CreateThornDependencyList +# @date Fri 36 Dec 2004 +# @author Erik Schnetter +# @desc +# Create the list of the thorns' make dependencies +# @enddesc +#@@*/ +sub CreateThornDependencyList +{ + my (@varlist, @deplist); + + # Find list of all thorns + foreach my $thorn (sort keys %thorns) { + next if ($configuration_database->{"\U$thorn OPTIONS\E"} eq 'NO_SOURCE' + || $thorn eq 'Cactus'); + # Add the thorn and the thorn's requirements + my $line = "USESTHORNS_$thorn ="; + foreach my $dep (sort (split (' ', $configuration_database->{"\U$thorn\E REQUIRES THORNS"}), + split (' ', $configuration_database->{"\U$thorn\E USES THORNS"})), + "Cactus", "CactusBindings") { + $line .= " $dep"; + } + push (@varlist, $line); + push (@deplist, "\$(CCTK_LIBDIR)/\$(LIBNAME_PREFIX)$thorn\$(LIBNAME_SUFFIX): \$(USESTHORNS_$thorn:%=\$(CCTK_LIBDIR)/\$(LIBNAME_PREFIX)%\$(LIBNAME_SUFFIX))"); + } + + return (@varlist, @deplist); +} + + +#/*@@ # @routine RequiredThorns # @date Tue 18 November 2003 # @author Thomas Radke |