Makefile
1.96 KB
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
.PHONY: clean, geopack, tinyxml
include ../env.sh
# *************************** COMPILER SETTINGS *****************************
CXX = g++
CXXFLAGS = -std=c++11 -pedantic -fPIC -Wall -Wextra
INCLUDE = -I${BOOSTDIR} -I${DDDIR}/include/DDClientLibC -I${TINYDIR}/include
LIB = -L${GEOPACKDIR}/lib -L${BOOSTDIR}/stage/lib -L${DDDIR}/lib -L${TINYDIR}/lib
LKLIBS = -lboost_date_time -lboost_regex -lDDClientLibC -ltinyxml -lnetcdf -lm
LDFLAGS = -fPIC
CC = gcc
EXE = GetData Footprints NC
# ********************* END OF COMPILER SETTINGS *****************************
# ******************************** LINKING *********************************
all: $(EXE)
install -d -m a+rx,ug+w ../bin
# mv Inputs ../bin
mv Footprints ../bin
mv NC ../bin
NC: makeNcFile.o ctools.o
gcc -o $@ $^ -lnetcdf -lm
# Footprints: makeFootprints.o geopack.o T96.o
# gcc -o $@ $^ -lgfortran -lm
Footprints: makeFootprints.o
gcc -o $@ $^ ${LIB} -lgeopack -lgfortran -lm
GetData: getInputs.o
${CXX} -o $@ $^ ${LDFLAGS} ${LIB} ${LKLIBS}
# Inputs: makeInputs.o tools.o
# ${CXX} -o $@ $^ ${LDFLAGS} ${LIB} ${LKLIBS}
# ************************** END OF LINKING *********************************
# ******************************** COMPILING ********************************
# %.o: %.cpp
# ${CXX} -c $< -o $@ ${INCLUDE} ${CXXFLAGS}
getInputs.o: getInputs.cpp
${CXX} -c $< -o $@ ${INCLUDE} ${CXXFLAGS}
makeFootprints.o: makeFootprints.c
gcc -O3 -c makeFootprints.c
makeNcFile.o: makeNcFile.c
gcc -c makeNcFile.c
ctools.o: ctools.c
gcc -c ctools.c
# ************************* END OF COMPILING ********************************
# ***************************** BUILDING LIBS *******************************
# GEOPACK
# geopack:
# cd ../LIB/GEOPACK/ && make T96.o
# cd ../LIB/GEOPACK/ && make geopack.o
# TINYXML
# tinyxml:
# cd ../LIB/TINYXML/ && make
# ********************** END OF BUILDING LIBS *******************************
# CLEAN
clean:
rm -rf *.o
rm -rf ${EXE}