~cwilson/spud/lines_attribute_checkpoint_fix

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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#    Copyright (C) 2007 Imperial College London and others.
#
#    Please see the AUTHORS file in the main source directory for a full list
#    of copyright holders.
#
#    Applied Modelling and Computation Group
#    Department of Earth Science and Engineering
#    Imperial College London
#
#    David.Ham@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 = /bin/sh

FC      = @FC@
FCFLAGS = -Iinclude @CPPFLAGS@ @FCFLAGS@

CXX     = @CXX@
CXXFLAGS= -Iinclude @CPPFLAGS@ @CXXFLAGS@

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

LIB = libspud.la
LIBS = $(shell echo @LIBS@ | sed 's/-L /-L/g')

HEADERS = include/spud.h include/spud include/spud_enums.h include/tinystr.h include/tinyxml.h
MODS = spud.mod
OBJS = spud.lo spud_interfaces.lo tinystr.lo tinyxml.lo tinyxmlerror.lo tinyxmlparser.lo fspud.lo

VPATH = src/

.SUFFIXES: .f90 .F90 .c .cpp .lo .la

.f90.lo:
	./libtool --mode=compile --tag=FC $(FC) $(FCFLAGS) -c $<
.cpp.lo:
	./libtool --mode=compile --tag=CXX $(CXX) $(CXXFLAGS) -c $<

default: libspud.la build-diamond

libspud.la: $(OBJS)
	./libtool --mode=link --tag=FC $(FC) $(FCFLAGS) -o $(LIB) $(OBJS) $(LIBS) -rpath @prefix@/lib 
	if test -f .libs/libspud.a; then cp .libs/libspud.a .; fi
	(if test -f .libs/libspud.so; then cp .libs/libspud.so ./libspud.so.0; ln -s libspud.so.0 libspud.so; fi) || true

build-diamond:
	cd diamond; python setup.py build; cd ..

test: unittest

unittest: libspud.la
	@cd src/tests; $(MAKE)

.PHONY:doc

doc: 
	@cd doc; $(MAKE) spud_manual.pdf

install: install-libspud install-spudtools install-diamond install-pyspud install-dxdiff

install-libspud: libspud.la
	@INSTALL@ -d $(DESTDIR)@prefix@/lib
	@INSTALL@ -d $(DESTDIR)@prefix@/include
	@INSTALL@ libspud.a $(DESTDIR)@prefix@/lib
	(if test -f libspud.so.0; then @INSTALL@ libspud.so.0 $(DESTDIR)@prefix@/lib; fi) || true
	(if test -f libspud.so; then cd $(DESTDIR)@prefix@/lib/; ln -s libspud.so.0 libspud.so; cd -; fi) || true
	@INSTALL@ $(MODS) $(DESTDIR)@prefix@/include
	@INSTALL@ $(HEADERS) $(DESTDIR)@prefix@/include

install-spudtools: 
	@INSTALL@ -d $(DESTDIR)@prefix@/share/spud
	@INSTALL@ -d $(DESTDIR)@prefix@/bin
	@INSTALL@ -m755 bin/spud-preprocess $(DESTDIR)@prefix@/bin
	@INSTALL@ -m755 bin/spud-set $(DESTDIR)@prefix@/bin
	@INSTALL@ -m644 schema/spud_base.rnc $(DESTDIR)@prefix@/share/spud
	@INSTALL@ -m644 schema/spud_base.rng $(DESTDIR)@prefix@/share/spud

install-diamond:
	cd diamond;	python setup.py install --prefix=$(DESTDIR)@prefix@; cd ..

install-pyspud:
ifeq ($(origin BUILDING_DEBIAN),undefined)
	cd python; python setup.py install --prefix=$(DESTDIR)@prefix@; cd ..
else
	cd python; for python in $(shell pyversions -r); do $$python setup.py install --prefix=$(DESTDIR)@prefix@ --install-layout=deb; done; cd ..
endif

install-dxdiff:
ifeq ($(origin DESTDIR),undefined)
	cd dxdiff; python setup.py install --prefix=$(DESTDIR)@prefix@; cd ..
else
	cd dxdiff; for python in $(shell pyversions -r); do $$python setup.py install --prefix=$(DESTDIR)@prefix@ --install-layout=deb; done; cd ..
endif

clean:
	@cd doc; $(MAKE) clean
	rm -f *.o libspud.a libspud.so* *.o *.la *.mod *.lo
	rm -rf .libs
	@cd src/tests; $(MAKE) clean
	@cd diamond; rm -rf build; cd ..
	@cd python; rm -rf build; cd ..
	@cd dxdiff; rm -rf build; cd ..


distclean: clean
	@cd src/tests; $(MAKE) distclean
	rm -fr config.log config.status libtool autom4te.cache Makefile
	rm -f Makefile src/tests/Makefile examples/Makefile
	rm -f bin/spud-preprocess
	rm -f diamond/setup.py diamond/diamond/plugins.py diamond/diamond/preprocess.py