Skip to content

Commit

Permalink
Thorn.m: Move Makefile file generation to new CodeGenMakefile.m
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Sep 9, 2013
1 parent 18c044d commit 83edd89
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
41 changes: 41 additions & 0 deletions Tools/CodeGen/CodeGenMakefile.m
@@ -0,0 +1,41 @@

(* Copyright 2004-2013 Sascha Husa, Ian Hinder, Christiane Lechner
This file is part of Kranc.
Kranc is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Kranc is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Kranc; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)

BeginPackage[
"CodeGenMakefile`",
{"Errors`", "Helpers`", "Kranc`", "CodeGenKranc`"}];

CreateMakefile::usage = "Create the content of the Cactus make.code.defn file.";

Begin["`Private`"];

(* ------------------------------------------------------------------------
Makefile
------------------------------------------------------------------------ *)

(* Return a CodeGen block representing a makefile which refers to the
list of filenames sourceFiles *)
CreateMakefile[sourceFiles_] :=
{FileHeader["Makefile"],
"SRCS = ", Map[{#, " "} &, sourceFiles], "\n"};

End[];

EndPackage[];
2 changes: 1 addition & 1 deletion Tools/CodeGen/KrancThorn.m
Expand Up @@ -30,7 +30,7 @@
"CalculationFunction`", "Errors`", "Helpers`", "CactusBoundary`",
"KrancTensor`", "Param`", "Schedule`", "Interface`", "Kranc`", "Jacobian`",
"ConservationCalculation`", "CaKernel`", "Calculation`", "ParamCheck`",
"OpenCL`", "CodeGenConfiguration`"}];
"OpenCL`", "CodeGenConfiguration`", "CodeGenMakefile`"}];

CreateKrancThorn::usage = "Construct a Kranc thorn";

Expand Down
11 changes: 0 additions & 11 deletions Tools/CodeGen/Thorn.m
Expand Up @@ -29,7 +29,6 @@

(* These functions are externally visible, and comprise the public
interface to this package. *)
CreateMakefile::usage = "Create the content of the Cactus make.code.defn file.";
CreateThorn::usage = "Create a general Cactus thorn from
a thorn specification structure";
CreateSymmetriesRegistrationSource::usage = "";
Expand All @@ -43,16 +42,6 @@

Begin["`Private`"];

(* ------------------------------------------------------------------------
Makefile
------------------------------------------------------------------------ *)

(* Return a CodeGen block representing a makefile which refers to the
list of filenames sourceFiles *)
CreateMakefile[sourceFiles_] :=
{FileHeader["Makefile"],
"SRCS = ", Map[{#, " "} &, sourceFiles], "\n"};


(* ------------------------------------------------------------------------
Setter
Expand Down

0 comments on commit 83edd89

Please sign in to comment.