# makefile
# Purpose: Create the executable MeshFree++ for the code provided in main.cpp

# All these libraries are provided precompiled in folder libs of MeshFree++. 
# If you want to use your own libraries, the following paths must be changed accordingly.
LIB_TAUCS  = -L ../libs/taucs/linux -ltaucs  
LIB_LAPACK = -L ../libs/taucs/linux -llapack 
LIB_BLAS = -L ../libs/taucs/linux -lf77blas -lcblas -latlas 
LIB_METIS = -L ../libs/taucs/linux -lmetis 
LIB_F77 = -L ../libs/taucs/linux -lg2c
LIB_C = -L ../libs/taucs/linux -lm 
ALL_LIB = $(LIB_TAUCS) $(LIB_LAPACK) $(LIB_BLAS) $(LIB_METIS) $(LIB_F77) $(LIB_C)

# Includes
INC_TAUCS = -I ../include/taucs/linux 
INC_MATHVEC = -I ../include/mathvec
INC_ALL = $(INC_TAUCS) $(INC_MATHVEC)

# Objects
ALL_OBJECTS = main.o meshfree.o

# Compiler options
CC = g++
CC_LINK = -ansi -Wall
CC_COMPILE = -ansi -Wall -c

# Executable
EXE = ../bin/MeshFree++

# Compile and build
MeshFree++: $(ALL_OBJECTS)
	$(CC) $(CC_LINK) -o $(EXE) $(ALL_OBJECTS) $(ALL_LIB)
	 
main.o: main.cpp meshfree.h
	$(CC) $(CC_COMPILE) main.cpp $(INC_ALL)

meshfree.o: meshfree.cpp meshfree.h
	$(CC) $(CC_COMPILE) meshfree.cpp $(INC_ALL)

# Remove objects and executable
clean:
	rm *.o $(EXE)


