FLAGS = -std=c++0x -O2 -g -Wall -fmessage-length=0 -Wreorder -Wwrite-strings -Wsign-compare

LIBS = -lpthread

OBJS = GSATThreadMPI.o GSAT/GSAT.o GSAT/ArrayFiller.o GSAT/CFormula.o

TARGET = GSATSolver


all:
	g++ $(FLAGS) -c -o GSAT/GSAT.o GSAT/GSAT.cpp
	g++ $(FLAGS) -c -o GSAT/ArrayFiller.o GSAT/ArrayFiller.cpp
	g++ $(FLAGS) -c -o GSAT/CFormula.o GSAT/CFormula.cpp
	mpic++ $(FLAGS) -c -o GSATThreadMPI.o GSATThreadMPI.cpp
	mpic++ -o $(TARGET) Main.cpp $(FLAGS) GSATThreadMPI.o GSAT/GSAT.o GSAT/ArrayFiller.o GSAT/CFormula.o $(LIBS)

clean:
	rm -f $(OBJS) $(TARGET)
	rm -rf *.*~
	rm -rf *~

run: 
	@mpirun -n 3 ./GSATSolver -i ../../benchmarks/uf150/uf150-099.cnf -t 2