

ifeq ($(HDF5_DIR),)
  $(error "You must set HDF5_DIR to point to your HDF5 installation !")
endif



CXX=icpc
CXXFLAGS =-I$(HDF5_DIR)/include -g -fPIC #-O2 -pg
LDFLAGS=-g #-O2 -pg

# Archiver and indexer
AR = /usr/bin/ar
RANLIB = /usr/bin/ranlib


libname  = libnirvana.a
sources  = CarpetN5.cc
includes = nirvana.hh metadata.hh CarpetN5.hh


# Replace .cc by .o
objects = $(addsuffix .o, $(basename $(sources)))

all: $(objects) $(includes)
	$(AR) rc $(libname) $(objects) 
	$(RANLIB) $(libname)

%.o: %.cc $(includes)
	$(CXX) $(CXXFLAGS) -c $*.cc -o $*.o

clean: 
	-rm $(objects) $(libname)
