annotate inst/generate_makefile.m @ 110:75780f7dc9f4

Fix nug in the makefile,
author gedeone-octave <marcovass89@hotmail.it>
date Fri, 23 Aug 2013 08:26:26 +0200
parents 50753c3cb0b6
children 2191111a1cad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
1
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
2 function output = generate_makefile (ufl_name, path)
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
3
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
4 STRING ="\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
5 DIR = @@PATH@@\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
6 CPPFLAGS=\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
7 LIBS= -ldolfin\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
8 MKOCTFILE = mkoctfile\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
9 FFC = ffc\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
10 \n\
110
75780f7dc9f4 Fix nug in the makefile,
gedeone-octave <marcovass89@hotmail.it>
parents: 109
diff changeset
11 OCTFILES = @@UFL_NAME@@_FunctionSpace.oct @@UFL_NAME@@_BilinearForm.oct @@UFL_NAME@@_LinearForm.oct\n\
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
12 \n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
13 all : $(OCTFILES)\n\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
14 fs : @@UFL_NAME@@_FunctionSpace.oct\n\
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
15 rhs : @@UFL_NAME@@_BilinearForm.oct\n\
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
16 lhs : @@UFL_NAME@@_LinearForm.oct\n\
109
50753c3cb0b6 New function for dealing with form of rank 0.
gedeone-octave <marcovass89@hotmail.it>
parents: 82
diff changeset
17 fun : @@UFL_NAME@@_Functional.oct\n\
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
18 \n\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
19 @@UFL_NAME@@_FunctionSpace.oct: @@UFL_NAME@@.h @@UFL_NAME@@_FunctionSpace.cc\n\
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
20 $(MKOCTFILE) @@UFL_NAME@@_FunctionSpace.cc -I$(DIR) -I. $(LDFLAGS) $(CPPFLAGS) $(LIBS)\n\
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
21 \n\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
22 @@UFL_NAME@@_BilinearForm.oct: @@UFL_NAME@@.h @@UFL_NAME@@_BilinearForm.cc\n\
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
23 $(MKOCTFILE) @@UFL_NAME@@_BilinearForm.cc -I$(DIR) -I. $(LDFLAGS) $(CPPFLAGS) $(LIBS)\n\
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
24 \n\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
25 @@UFL_NAME@@_LinearForm.oct: @@UFL_NAME@@.h @@UFL_NAME@@_LinearForm.cc\n\
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
26 $(MKOCTFILE) @@UFL_NAME@@_LinearForm.cc -I$(DIR) -I. $(LDFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBS)\n\
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
27 \n\
109
50753c3cb0b6 New function for dealing with form of rank 0.
gedeone-octave <marcovass89@hotmail.it>
parents: 82
diff changeset
28 @@UFL_NAME@@_Functional.oct: @@UFL_NAME@@.h @@UFL_NAME@@_Functional.cc\n\
50753c3cb0b6 New function for dealing with form of rank 0.
gedeone-octave <marcovass89@hotmail.it>
parents: 82
diff changeset
29 $(MKOCTFILE) @@UFL_NAME@@_Functional.cc -I$(DIR) -I. $(LDFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBS)\n\
50753c3cb0b6 New function for dealing with form of rank 0.
gedeone-octave <marcovass89@hotmail.it>
parents: 82
diff changeset
30 \n\
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
31 @@UFL_NAME@@.h: @@UFL_NAME@@.ufl\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
32 $(FFC) -l dolfin @@UFL_NAME@@.ufl\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
33 \n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
34 .PHONY: clean\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
35 \n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
36 clean:\n\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
37 rm -f @@UFL_NAME@@_FunctionSpace.o @@UFL_NAME@@_FunctionSpace.cc @@UFL_NAME@@.h\n\
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
38 rm -f @@UFL_NAME@@_BilinearForm.o @@UFL_NAME@@_BilinearForm.cc\n\
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
39 rm -f @@UFL_NAME@@_LinearForm.o @@UFL_NAME@@_LinearForm.cc\n\
109
50753c3cb0b6 New function for dealing with form of rank 0.
gedeone-octave <marcovass89@hotmail.it>
parents: 82
diff changeset
40 rm -f @@UFL_NAME@@_Functional.o @@UFL_NAME@@_Functional.cc\n\
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
41 rm -f Makefile_@@UFL_NAME@@\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
42 ";
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
43
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
44 STRING = strrep (STRING, "@@UFL_NAME@@", ufl_name);
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
45 STRING = strrep (STRING, "@@PATH@@", path);
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
46
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
47 fid = fopen (sprintf ("Makefile_%s", ufl_name), 'w');
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
48 if (fid >= 0)
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
49 fputs (fid, STRING);
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
50 output = fclose (fid);
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
51 else
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
52 error ("cannot open file");
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
53 output = 1;
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
54 endif
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
55
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
56 endfunction