~grm08/fluidity/hilbert-for-pyop2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#    Copyright (C) 2006 Imperial College London and others.
#
#    Please see the AUTHORS file in the main source directory for a full list
#    of copyright holders.
#
#    Prof. C Pain
#    Applied Modelling and Computation Group
#    Department of Earth Science and Engineering
#    Imperial College London
#
#    amcgsoftware@imperial.ac.uk
#
#    This library is free software; you can redistribute it and/or
#    modify it under the terms of the GNU Lesser General Public
#    License as published by the Free Software Foundation,
#    version 2.1 of the License.
#
#    This library is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#    Lesser General Public License for more details.
#
#    You should have received a copy of the GNU Lesser General Public
#    License along with this library; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
#    USA

SHELL = @SHELL@

FC      = @FC@
FCFLAGS = -I../include @CPPFLAGS@ @FCFLAGS@ -I/usr/local/include -I./

MPIF90  = @MPIF90@

CC      = @CC@
CFLAGS  = @CPPFLAGS@ @CFLAGS@ -I../include -I/usr/local/include -g

CXX     = @CXX@
CXXFLAGS= @CPPFLAGS@ @CXXFLAGS@ -I../include -I/usr/local/include

MAKE    = @MAKE@
AR  = @AR@
ARFLAGS = @ARFLAGS@

LIB = ../lib/lib@FLUIDITY@.a

AUTO_WRAPPER = Diagnostic_Fields_New
DISABLED_DIAGS = $(AUTO_WRAPPER) Diagnostic_Source_Fields Diagnostic_Fields_Interfaces
DIAGOBJS = $(addsuffix .o, $(filter-out $(DISABLED_DIAGS), $(basename $(wildcard *.F90))))
OBJS = $(AUTO_WRAPPER).o $(DIAGOBJS) Diagnostic_Source_Fields.o  Diagnostic_Fields_Interfaces.o

.SUFFIXES: .f90 .F90 .c .cpp .o .a

.f90.o:
	@echo "        FC $<"
	$(FC) $(FCFLAGS) -c $< || (rm $(LIB) && false)
.F90.o:
	@echo "        FC $<"
	$(FC) $(FCFLAGS) -c $< || (rm $(LIB) && false)
.c.o:
	@echo "        CC $<"
	$(CC) $(CFLAGS) -c $< || (rm $(LIB) && false)
.cpp.o:
	@echo "        CXX $<"
	$(CXX) $(CXXFLAGS) -c $< || (rm $(LIB) && false)

default: $(OBJS)
	cp *.mod ../include/
	$(AR) $(ARFLAGS) $(LIB) $(OBJS)

# cancel implicit rule that tries to make .o from .mod with m2c:
%.o: %.mod

$(addsuffix .o, $(filter-out Diagnostic_Source_Fields, $(basename $(wildcard *.F90)))): Diagnostic_Source_Fields.o

$(AUTO_WRAPPER).F90: $(DIAGOBJS) $(AUTO_WRAPPER).F90.in \
  ../scripts/make_diagnostic_fields 
	../scripts/make_diagnostic_fields
	
Diagnostic_Fields_New.o: $(DIAGOBJS) $(AUTO_WRAPPER).F90
Diagnostic_Fields_Interfaces.o: Diagnostic_Fields_New.o

clean:
	rm -f *.o *.d *.mod
	rm -f $(AUTO_WRAPPER).F90