-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.nemo
61 lines (49 loc) · 2.22 KB
/
Makefile.nemo
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
LIBDIR=/data/softs/local/netcdf/4.4.1_gcc484/lib
INCDIR=/data/softs/local/netcdf/4.4.1_gcc484/include
DATETIMELIBDIR=./lib
DATETIMEINCDIR=./include
UDUNITSLIBDIR=/data/softs/local/udunits/2.2.19/lib
UDUNITSINCDIR=/data/softs/local/udunits/2.2.19/include
JSONFORTRAN=./json-fortran
DESTLIBDIR=.
BINDIR=../bin
FC=gfortran
CC=gcc
NETCDF=netcdf
NETCDFF=netcdff
OPTFLAGS=-g -fbounds-check -cpp -ffixed-line-length-132 -DNETCDF -fbacktrace
CFLAGS=-g -fbounds-check -cpp -ffixed-line-length-132 -DNETCDF -fbacktrace
.SUFFIXES: .ftn
make_tracks.abs: make_tracks.ftn libtracks.a libtracks_tools.a libstd_nc.a tracks_cte.h
mkdir -p $(BINDIR)
$(FC) make_tracks.ftn $(OPTFLAGS) -o $(BINDIR)/make_tracks.abs -L$(DESTLIBDIR) -L$(LIBDIR) -L$(DATETIMELIBDIR) -L$(UDUNITSLIBDIR) -L$(JSONFORTRAN)/lib -I. -I$(INCDIR) -I$(DATETIMEINCDIR) -I$(UDUNITSINCDIR) -I$(JSONFORTRAN)/include get_calendar.o -ltracks -ltracks_tools -lstd_nc -l$(NETCDFF) -l$(NETCDF) -ldatetime -ludunits2 -ljsonfortran -Wl,-R $(JSONFORTRAN)/lib -Wl,-R $(UDUNITSLIBDIR) -Wl,-R $(HOME)/tracking/lib -Wl,-R $(LIBDIR)
rm -f make_tracks.o
libtracks.a: libtracks.ftn tracks_cte.h libtracks.o
mkdir -p $(DESTLIBDIR)
rm -f $(DESTLIBDIR)/libtracks.a
ar rv $(DESTLIBDIR)/libtracks.a libtracks.o
ranlib $(DESTLIBDIR)/libtracks.a
rm -f libtracks.o
libtracks_tools.a: libtracks_tools.ftn tracks_cte.h libtracks_tools.o get_calendar.c get_calendar.o
mkdir -p $(DESTLIBDIR)
rm -f $(DESTLIBDIR)/libtracks_tools.a
ar rv $(DESTLIBDIR)/libtracks_tools.a libtracks_tools.o
ranlib $(DESTLIBDIR)/libtracks_tools.a
rm -f libtracks_tools.o
libstd_nc.a: libstd_nc.ftn tracks_cte.h libstd_nc.o
mkdir -p $(DESTLIBDIR)
rm -f $(DESTLIBDIR)/libstd_nc.a
ar rv $(DESTLIBDIR)/libstd_nc.a libstd_nc.o
ranlib $(DESTLIBDIR)/libstd_nc.a
rm -f libstd_nc.o
mt2gmt5: mt2gmt5.ftn
mkdir -p $(BINDIR)
$(FC) $(OPTFLAGS) mt2gmt5.ftn -o $(BINDIR)/mt2gmt5 -L$(DESTLIBDIR) -L$(LIBDIR) -I. -I$(INCDIR) -ltracks -lstd_nc -l$(NETCDF)
get_calendar.o: get_calendar.c
$(CC) $(CFLAGS) -I. -I$(INCDIR) -I$(UDUNITSINCDIR) -c get_calendar.c -o get_calendar.o
.f.o:
$(FC) $(OPTFLAGS) -c $< -o $@
.ftn.o:
$(FC) $(OPTFLAGS) -I. -I$(INCDIR) -I$(DATETIMEINCDIR) -I$(JSONFORTRAN) -c $< -o $@
.c.o:
$(CC) $(CFLAGS) -I. -I$(INCDIR) -c $< -o $@