-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (49 loc) · 2 KB
/
Makefile
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=/opt/local/lib
INCDIR=/opt/local/include
DATETIMELIBDIR=./datetime-fortran/build/lib
DATETIMEINCDIR=./datetime-fortran/build/include
UDUNITSLIBDIR=/opt/local/lib
UDUNITSINCDIR=/opt/local/include/udunits2
JSONFORTRAN=./json-fortran/build
DESTLIBDIR=.
BINDIR=../bin
SRCDIR=$(PWD)
FORTRAN=gfortran
CC=gcc
NETCDF=netcdff
OPTFLAGS=-O2 -g -fbounds-check -cpp -ffixed-line-length-132 -DNETCDF
CFLAGS=-O2 -g
.SUFFIXES: .ftn
make_tracks.abs: make_tracks.ftn libtracks.a libtracks_tools.a libstd_nc.a tracks_cte.h
mkdir -p $(BINDIR)
$(FORTRAN) 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$(NETCDF) -ldatetime -ludunits2 -ljsonfortran
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)
$(FORTRAN) $(OPTFLAGS) mt2gmt5.ftn -o $(BINDIR)/mt2gmt5 -L$(LIBDIR) -I. -I$(INCDIR) -ltracks
get_calendar.o: get_calendar.c
$(CC) $(CFLAGS) -I. -I$(INCDIR) -I$(UDUNITSINCDIR) -c get_calendar.c -o get_calendar.o
.f.o:
$(FORTRAN) $(OPTFLAGS) -c $< -o $@
.ftn.o:
$(FORTRAN) $(OPTFLAGS) -I. -I$(INCDIR) -I$(DATETIMEINCDIR) -I$(JSONFORTRAN) -c $< -o $@
.c.o:
$(CC) $(CFLAGS) -I. -I$(INCDIR) -c $< -o $@