comparison inst/private/generate_makefile.m @ 268:61830a4f9ab9

Improve formatting
author Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
date Thu, 14 Aug 2014 12:26:55 +0200
parents 1a3674836579
children 897e312cb440
comparison
equal deleted inserted replaced
267:53039ac90368 268:61830a4f9ab9
15 15
16 16
17 ## -*- texinfo -*- 17 ## -*- texinfo -*-
18 ## function for internal usage only 18 ## function for internal usage only
19 ## @end deftypefn 19 ## @end deftypefn
20
20 function output = generate_makefile (ufl_name, path) 21 function output = generate_makefile (ufl_name, path)
21 22
22 STRING ="\n\ 23 STRING ="\n\
23 DIR = @@PATH@@\n\ 24 DIR = @@PATH@@\n\
24 CPPFLAGS+=@@FF_CPPFLAGS@@ -g\n\ 25 CPPFLAGS+=@@FF_CPPFLAGS@@ -g\n\
50 $(FFC) -l dolfin @@UFL_NAME@@.ufl\n\ 51 $(FFC) -l dolfin @@UFL_NAME@@.ufl\n\
51 \n\ 52 \n\
52 .PHONY: clean\n\ 53 .PHONY: clean\n\
53 \n\ 54 \n\
54 clean:\n\ 55 clean:\n\
55 rm -f @@UFL_NAME@@_FunctionSpace.o @@UFL_NAME@@_FunctionSpace.cc @@UFL_NAME@@.h\n\ 56 $(RM) @@UFL_NAME@@_FunctionSpace.o @@UFL_NAME@@_FunctionSpace.cc @@UFL_NAME@@.h\n\
56 rm -f @@UFL_NAME@@_BilinearForm.o @@UFL_NAME@@_BilinearForm.cc\n\ 57 $(RM) @@UFL_NAME@@_BilinearForm.o @@UFL_NAME@@_BilinearForm.cc\n\
57 rm -f @@UFL_NAME@@_LinearForm.o @@UFL_NAME@@_LinearForm.cc\n\ 58 $(RM) @@UFL_NAME@@_LinearForm.o @@UFL_NAME@@_LinearForm.cc\n\
58 rm -f @@UFL_NAME@@_Functional.o @@UFL_NAME@@_Functional.cc\n\ 59 $(RM) @@UFL_NAME@@_Functional.o @@UFL_NAME@@_Functional.cc\n\
59 rm -f Makefile_@@UFL_NAME@@\n\ 60 $(RM) Makefile_@@UFL_NAME@@\n\
60 "; 61 ";
61 62
62 STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name); 63 STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name);
63 STRING = strrep (STRING, "@@PATH@@", path); 64 STRING = strrep (STRING, "@@PATH@@", path);
64 STRING = strrep (STRING, "@@FF_CPPFLAGS@@", get_vars ("CPPFLAGS")); 65 STRING = strrep (STRING, "@@FF_CPPFLAGS@@", get_vars ("CPPFLAGS"));
65 STRING = strrep (STRING, "@@FF_LIBS@@", get_vars ("LIBS")); 66 STRING = strrep (STRING, "@@FF_LIBS@@", get_vars ("LIBS"));
66 67
67 fid = fopen (sprintf ("Makefile_%s", ufl_name), 'w'); 68 fid = fopen (sprintf ("Makefile_%s", ufl_name), "w");
68 if (fid >= 0) 69 if (fid >= 0)
69 fputs (fid, STRING); 70 fputs (fid, STRING);
70 output = fclose (fid); 71 output = fclose (fid);
71 else 72 else
72 error ("cannot open file"); 73 error ("cannot open file");