# Makefile to compile netcdf read and write example

CXX=g++
CXXFLAGS=-std=c++14 -O2 -g -Wall
LDLIBS=-lnetcdf_c++4

#uncomment the following line and substutute the right path where the
#rarray header is located (if rarray header is not found)
#CPPFLAGS=-I/hereisrarray/include


all: Temp4dWr Temp4dRd

Temp4dWr: Temp4dWr.o
	${CXX} ${LDFLAGS} -o $@ $^ ${LDLIBS}

Temp4dRd: Temp4dRd.o 
	${CXX} ${LDFLAGS} -o $@ $^ ${LDLIBS}

Temp4dWr.o: Temp4dWr.cpp Temp4dparameters.h
	${CXX} ${CPPFLAGS} ${CXXFLAGS} -c -o $@ $<

Temp4dRd.o: Temp4dRd.cpp Temp4dparameters.h
	${CXX} ${CPPFLAGS} ${CXXFLAGS} -c -o $@ $<

clean:
	\rm -f Temp4dWr.o Temp4dRd.o

distclean:
	\rm -rf Temp4dWr Temp4dRd temp_4D.nc

