SHELL = sh

prefix       = PATH_TO/cvode_inst
exec_prefix  = PATH_TO/cvode_inst
includedir   = PATH_TO/cvode_inst/include/
libdir       = PATH_TO/cvode_inst/lib

CXX = g++
CFLAGS   = -O3 -DNDEBUG
LIBS     =  -lm

#LDFLAGS = -Wl,-rpath,PATH_TO/cvode_inst/lib
LDFLAGS = -Wl,-headerpad_max_install_names
INCLUDES =  -I${includedir}
LIBRARIES = -lsundials_cvode -lsundials_nvecserial ${LIBS}

TARGET= run.out

SRCS = bin/kinetics.cpp\
bin/dust_evolition_pro.cpp\
bin/service_functions.cpp\
bin/memallocate.cpp\
bin/time_step.cpp\
bin/general_initialize.cpp\
bin/aromatization.cpp\
bin/photodestruction.cpp\
bin/shattering.cpp\
bin/sputtering.cpp\
bin/read_initial.cpp\
bin/optics.cpp\
bin/output.cpp\
bin/i_interaction_rnih.cpp\
bin/temperature.cpp

OBJS =	$(SRCS:.cpp=.o)
all:	$(TARGET)

$(TARGET):	$(OBJS)
	$(CXX) $(CFLAGS) -o $(TARGET) $(OBJS) ${INCLUDES} -L${libdir} $(LIBRARIES) ${LDFLAGS}

clean:  
	find . -name \*.o* > list
	xargs rm < list
	rm list

