annotate inst/generate_makefile.m @ 82:5a4371f45fc4

Create the corresponding function following new naming convention.
author gedeone-octave <marcovass89@hotmail.it>
date Sat, 03 Aug 2013 14:45:57 +0200
parents 4ef8dbafcdfc
children 50753c3cb0b6
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\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
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\
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
17 \n\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
18 @@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
19 $(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
20 \n\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
21 @@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
22 $(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
23 \n\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
24 @@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
25 $(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
26 \n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
27 @@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
28 $(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
29 \n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
30 .PHONY: clean\n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
31 \n\
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
32 clean:\n\
82
5a4371f45fc4 Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents: 68
diff changeset
33 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
34 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
35 rm -f @@UFL_NAME@@_LinearForm.o @@UFL_NAME@@_LinearForm.cc\n\
68
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
36 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
37 ";
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
38
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
39 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
40 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
41
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
42 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
43 if (fid >= 0)
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
44 fputs (fid, STRING);
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
45 output = fclose (fid);
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
46 else
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
47 error ("cannot open file");
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
48 output = 1;
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
49 endif
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
50
4ef8dbafcdfc New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
51 endfunction