Mercurial > fem-fenics-eugenio
annotate inst/private/generate_makefile.m @ 208:8932e9cd8dd1
CPPFLAGS do not overrirde existing flags.
author | gedeone-octave <marcovass89@hotmail.it> |
---|---|
date | Tue, 18 Feb 2014 15:21:43 +0000 |
parents | 22de20d78e27 |
children | 1a3674836579 |
rev | line source |
---|---|
152
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
124
diff
changeset
|
1 ## Copyright (C) 2013 Marco Vassallo <gedeone-octave@users.sourceforge.net> |
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
124
diff
changeset
|
2 ## |
124
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
3 ## This program is free software; you can redistribute it and/or modify it under |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
4 ## the terms of the GNU General Public License as published by the Free Software |
152
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
124
diff
changeset
|
5 ## Foundation; either version 3 of the License, or (at your option) any later |
124
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
6 ## version. |
152
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
124
diff
changeset
|
7 ## |
124
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
8 ## This program is distributed in the hope that it will be useful, but WITHOUT |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
11 ## details. |
152
1dbe146bff03
Update license to gpl v3
gedeone-octave <marcovass89@hotmail.it>
parents:
124
diff
changeset
|
12 ## |
124
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
13 ## You should have received a copy of the GNU General Public License along with |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
14 ## this program; if not, see <http://www.gnu.org/licenses/>. |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
15 |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
16 |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
17 ## -*- texinfo -*- |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
18 ## function for internal usage only |
2191111a1cad
Maint: add copyright notice
gedeone-octave <marcovass89@hotmail.it>
parents:
110
diff
changeset
|
19 ## @end deftypefn |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
20 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
|
21 |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
22 STRING ="\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
23 DIR = @@PATH@@\n\ |
208
8932e9cd8dd1
CPPFLAGS do not overrirde existing flags.
gedeone-octave <marcovass89@hotmail.it>
parents:
155
diff
changeset
|
24 CPPFLAGS+=\n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
25 LIBS= -ldolfin\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
26 MKOCTFILE = mkoctfile\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
27 FFC = ffc\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
28 \n\ |
110
75780f7dc9f4
Fix nug in the makefile,
gedeone-octave <marcovass89@hotmail.it>
parents:
109
diff
changeset
|
29 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
|
30 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
31 all : $(OCTFILES)\n\ |
82
5a4371f45fc4
Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents:
68
diff
changeset
|
32 fs : @@UFL_NAME@@_FunctionSpace.oct\n\ |
5a4371f45fc4
Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents:
68
diff
changeset
|
33 rhs : @@UFL_NAME@@_BilinearForm.oct\n\ |
5a4371f45fc4
Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents:
68
diff
changeset
|
34 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
|
35 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
|
36 \n\ |
82
5a4371f45fc4
Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents:
68
diff
changeset
|
37 @@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
|
38 $(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
|
39 \n\ |
82
5a4371f45fc4
Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents:
68
diff
changeset
|
40 @@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
|
41 $(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
|
42 \n\ |
82
5a4371f45fc4
Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents:
68
diff
changeset
|
43 @@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
|
44 $(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
|
45 \n\ |
109
50753c3cb0b6
New function for dealing with form of rank 0.
gedeone-octave <marcovass89@hotmail.it>
parents:
82
diff
changeset
|
46 @@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
|
47 $(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
|
48 \n\ |
68
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
49 @@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
|
50 $(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
|
51 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
52 .PHONY: clean\n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
53 \n\ |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
54 clean:\n\ |
82
5a4371f45fc4
Create the corresponding function following new naming convention.
gedeone-octave <marcovass89@hotmail.it>
parents:
68
diff
changeset
|
55 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
|
56 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
|
57 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
|
58 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
|
59 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
|
60 "; |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
61 |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
62 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
|
63 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
|
64 |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
65 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
|
66 if (fid >= 0) |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
67 fputs (fid, STRING); |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
68 output = fclose (fid); |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
69 else |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
70 error ("cannot open file"); |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
71 output = 1; |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
72 endif |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
73 |
4ef8dbafcdfc
New octave script for creation of function on the fly
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff
changeset
|
74 endfunction |