summaryrefslogtreecommitdiff
path: root/lib/sbin/CreateParameterBindings.pl
diff options
context:
space:
mode:
authorsbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac>2012-06-18 17:48:27 +0000
committersbrandt <sbrandt@17b73243-c579-4c4c-a9d2-2d5706c11dac>2012-06-18 17:48:27 +0000
commit0d07ac21bf7db6765b83ea1bc88f9f4f05d63af7 (patch)
tree4a411cf054e16707d91836e64c7cb666085689b3 /lib/sbin/CreateParameterBindings.pl
parent47a6b6f908ad8f4607cb8e7830d8159522ce0947 (diff)
Changes for ticket #768
Change per thorn -DTHORN_IS_xxx to a per thorn -I bindings/include/xxx git-svn-id: http://svn.cactuscode.org/flesh/trunk@4839 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CreateParameterBindings.pl')
-rw-r--r--lib/sbin/CreateParameterBindings.pl54
1 files changed, 16 insertions, 38 deletions
diff --git a/lib/sbin/CreateParameterBindings.pl b/lib/sbin/CreateParameterBindings.pl
index 385bff80..52862243 100644
--- a/lib/sbin/CreateParameterBindings.pl
+++ b/lib/sbin/CreateParameterBindings.pl
@@ -154,13 +154,14 @@ sub CreateParameterBindings
foreach $thorn (split(' ',$rhinterface_db->{'THORNS'}))
{
$dataout = &CreateFortranThornParameterBindings($thorn, $rhparameter_db, $rhinterface_db);
- &WriteFile("include/${thorn}_FParameters.h",\$dataout);
+ mkdir("include/$thorn");
+ &WriteFile("include/${thorn}/FParameters.h",\$dataout);
$implementation = $rhinterface_db->{"\U$thorn\E IMPLEMENTS"};
@data = ();
push(@data, '/*@@');
- push(@data, " \@header ${thorn}_CParameters.h");
+ push(@data, " \@header ${thorn}/CParameters.h");
push(@data, ' @author Automatically generated by CreateParameterBindings.pl');
push(@data, ' @desc');
push(@data, " Declares parameters of thorn $thorn");
@@ -172,6 +173,7 @@ sub CreateParameterBindings
push(@data, "#ifndef _\U$thorn\E_PARAMETERS_H_");
push(@data, "#define _\U$thorn\E_PARAMETERS_H_ 1");
push(@data, '');
+ push(@data, '#include "CParameterStructNames.h"');
if($header_files{'GLOBAL'})
{
@@ -231,7 +233,7 @@ sub CreateParameterBindings
push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline
$dataout = join ("\n", @data);
- &WriteFile("include/${thorn}_CParameters.h",\$dataout);
+ &WriteFile("include/${thorn}/CParameters.h",\$dataout);
}
# Write this one to a temporary file and read it back in
@@ -253,46 +255,22 @@ sub CreateParameterBindings
&WriteFile('include/CParameterStructNames.h',\$dataout);
-
- @data = ();
- push(@data, '#include "CParameterStructNames.h"');
- push(@data, '');
foreach $thorn (split(' ',$rhinterface_db->{'THORNS'}))
{
- push(@data, "#ifdef THORN\_IS\_$thorn");
- push(@data, "#include \"${thorn}_CParameters.h\"");
- push(@data, '#endif');
+ @data = ();
+ push(@data, '/* get the CCTK datatype definitions */');
+ push(@data, '#include "cctk_Types.h"');
push(@data, '');
- }
- push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline
- $dataout = join ("\n", @data);
- &WriteFile('include/CParameters.h',\$dataout);
-
- @data = ();
- foreach $thorn (split(' ',$rhinterface_db->{'THORNS'}))
- {
- push(@data, "#ifdef THORN\_IS\_$thorn");
- push(@data, "#include \"${thorn}_FParameters.h\"");
+ push(@data, '#ifdef CCODE');
+ push(@data, "#include \"${thorn}/CParameters.h\"");
+ push(@data, '#elif FCODE');
+ push(@data, "#include \"${thorn}/FParameters.h\"");
push(@data, '#endif');
- push(@data, '');
- }
- push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline
- $dataout = join ("\n", @data);
- &WriteFile('include/FParameters.h',\$dataout);
+ push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline
- @data = ();
- push(@data, '/* get the CCTK datatype definitions */');
- push(@data, '#include "cctk_Types.h"');
- push(@data, '');
- push(@data, '#ifdef CCODE');
- push(@data, '#include "CParameters.h"');
- push(@data, '#elif FCODE');
- push(@data, '#include "FParameters.h"');
- push(@data, '#endif');
- push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline
-
- $dataout = join ("\n", @data);
- &WriteFile('include/cctk_Parameters.h',\$dataout);
+ $dataout = join ("\n", @data);
+ &WriteFile("include/${thorn}/cctk_Parameters.h",\$dataout);
+ }
chdir $start_dir;