~reducedmodelling/fluidity/ROM_Non-intrusive-ann

« back to all changes in this revision

Viewing changes to libspud/Makefile

  • Committer: fangf at ac
  • Date: 2012-11-06 12:21:31 UTC
  • mto: This revision was merged to the branch mainline in revision 3989.
  • Revision ID: fangf@imperial.ac.uk-20121106122131-u2zvt7fxc1r3zeou
updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#    Copyright (C) 2007 Imperial College London and others.
 
2
#
 
3
#    Please see the AUTHORS file in the main source directory for a full list
 
4
#    of copyright holders.
 
5
#
 
6
#    Applied Modelling and Computation Group
 
7
#    Department of Earth Science and Engineering
 
8
#    Imperial College London
 
9
#
 
10
#    David.Ham@Imperial.ac.uk
 
11
#
 
12
#    This library is free software; you can redistribute it and/or
 
13
#    modify it under the terms of the GNU Lesser General Public
 
14
#    License as published by the Free Software Foundation,
 
15
#    version 2.1 of the License.
 
16
#
 
17
#    This library is distributed in the hope that it will be useful,
 
18
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
20
#    Lesser General Public License for more details.
 
21
#
 
22
#    You should have received a copy of the GNU Lesser General Public
 
23
#    License along with this library; if not, write to the Free Software
 
24
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 
25
#    USA
 
26
 
 
27
SHELL = /bin/sh
 
28
 
 
29
FC      = gfortran
 
30
FCFLAGS = -Iinclude  -DUSING_GFORTRAN=1 -DNDEBUG=1 -O3 -ffast-math -frecord-marker=4 -I/usr/include -ffree-line-length-none -ffixed-line-length-none
 
31
 
 
32
CXX     = g++
 
33
CXXFLAGS= -Iinclude  -DUSING_GFORTRAN=1 -DNDEBUG=1 -O3 
 
34
 
 
35
MAKE    = make
 
36
AR      = ar
 
37
ARFLAGS = cr
 
38
 
 
39
LIB = libspud.la
 
40
LIBS = $(shell echo   -lpthread -lm -lstdc++   -L/usr/lib/gcc/x86_64-linux-gnu/4.6 -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../.. -lgfortran -lm -lquadmath  -L/usr/lib/gcc/x86_64-linux-gnu/4.6 -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../.. -lgfortran -lm -lquadmath | sed 's/-L /-L/g')
 
41
 
 
42
HEADERS = include/spud.h include/spud include/spud_enums.h include/tinystr.h include/tinyxml.h
 
43
MODS = spud.mod
 
44
OBJS = spud.lo spud_interfaces.lo tinystr.lo tinyxml.lo tinyxmlerror.lo tinyxmlparser.lo fspud.lo
 
45
 
 
46
VPATH = src/
 
47
 
 
48
.SUFFIXES: .f90 .F90 .c .cpp .lo .la
 
49
 
 
50
.f90.lo:
 
51
        ./libtool --mode=compile --tag=FC $(FC) $(FCFLAGS) -c $<
 
52
.cpp.lo:
 
53
        ./libtool --mode=compile --tag=CXX $(CXX) $(CXXFLAGS) -c $<
 
54
 
 
55
default: libspud.la build-diamond
 
56
 
 
57
libspud.la: $(OBJS)
 
58
        ./libtool --mode=link --tag=FC $(FC) $(FCFLAGS) -o $(LIB) $(OBJS) $(LIBS) -rpath /data/src/fluidity/fluidity_enkf_reduced_new/libspud/../lib 
 
59
        if test -f .libs/libspud.a; then cp .libs/libspud.a .; fi
 
60
        (if test -f .libs/libspud.so; then cp .libs/libspud.so ./libspud.so.0; ln -s libspud.so.0 libspud.so; fi) || true
 
61
 
 
62
build-diamond:
 
63
        cd diamond; python setup.py build; cd ..
 
64
 
 
65
test: unittest
 
66
 
 
67
unittest: libspud.la
 
68
        @cd src/tests; $(MAKE)
 
69
 
 
70
.PHONY:doc
 
71
 
 
72
doc: 
 
73
        @cd doc; $(MAKE) spud_manual.pdf
 
74
 
 
75
install: install-libspud install-spudtools install-diamond install-pyspud install-dxdiff
 
76
 
 
77
install-libspud: libspud.la
 
78
        /usr/bin/install -c -d $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../lib
 
79
        /usr/bin/install -c -d $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../include
 
80
        /usr/bin/install -c libspud.a $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../lib
 
81
        (if test -f libspud.so.0; then /usr/bin/install -c libspud.so.0 $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../lib; fi) || true
 
82
        (if test -f libspud.so; then cd $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../lib/; ln -s libspud.so.0 libspud.so; cd -; fi) || true
 
83
        /usr/bin/install -c $(MODS) $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../include
 
84
        /usr/bin/install -c $(HEADERS) $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../include
 
85
 
 
86
install-spudtools: 
 
87
        /usr/bin/install -c -d $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../share/spud
 
88
        /usr/bin/install -c -d $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../bin
 
89
        /usr/bin/install -c -m755 bin/spud-preprocess $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../bin
 
90
        /usr/bin/install -c -m755 bin/spud-set $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../bin
 
91
        /usr/bin/install -c -m644 schema/spud_base.rnc $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../share/spud
 
92
        /usr/bin/install -c -m644 schema/spud_base.rng $(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/../share/spud
 
93
 
 
94
install-diamond:
 
95
        cd diamond;     python setup.py install --prefix=$(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/..; cd ..
 
96
 
 
97
install-pyspud:
 
98
ifeq ($(origin BUILDING_DEBIAN),undefined)
 
99
        cd python; python setup.py install --prefix=$(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/..; cd ..
 
100
else
 
101
        cd python; for python in $(shell pyversions -r); do $$python setup.py install --prefix=$(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/.. --install-layout=deb; done; cd ..
 
102
endif
 
103
 
 
104
install-dxdiff:
 
105
ifeq ($(origin DESTDIR),undefined)
 
106
        cd dxdiff; python setup.py install --prefix=$(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/..; cd ..
 
107
else
 
108
        cd dxdiff; for python in $(shell pyversions -r); do $$python setup.py install --prefix=$(DESTDIR)/data/src/fluidity/fluidity_enkf_reduced_new/libspud/.. --install-layout=deb; done; cd ..
 
109
endif
 
110
 
 
111
clean:
 
112
        @cd doc; $(MAKE) clean
 
113
        rm -f *.o libspud.a libspud.so* *.o *.la *.mod *.lo
 
114
        rm -rf .libs
 
115
        @cd src/tests; $(MAKE) clean
 
116
        @cd diamond; rm -rf build; cd ..
 
117
        @cd python; rm -rf build; cd ..
 
118
        @cd dxdiff; rm -rf build; cd ..
 
119
 
 
120
 
 
121
distclean: clean
 
122
        @cd src/tests; $(MAKE) distclean
 
123
        rm -fr config.log config.status libtool autom4te.cache Makefile
 
124
        rm -f Makefile src/tests/Makefile examples/Makefile
 
125
        rm -f bin/spud-preprocess
 
126
        rm -f diamond/setup.py diamond/diamond/plugins.py diamond/diamond/preprocess.py