Makefile 1.96 KB
.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}