CC=clang++

CFLAGS = -g -O3 -std=c++11 -stdlib=libc++ -Wall -Wno-c++11-extensions
#CFLAGS = -g -std=c++11 -stdlib=libc++ -Wall -Wno-c++11-extensions
# gcc flags (for linux)
#CFLAGS = -g -O3 -std=c++11 -Wall -pthread

TARGET = flexsat

SRCS = main.cpp solver.cpp heap.cpp cnf.cpp watch.cpp clauses.cpp heuristic.cpp \
	resources.cpp utils.cpp unit.cpp pool.cpp performance.cpp \
	pdb.cpp set.cpp dag.cpp

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

$(TARGET): $(OBJS)
	   $(CC) $(CFLAGS) -o $(TARGET) $(OBJS)

%.o:
	$(CC) $(CFLAGS) -c $< 

deps: 
	$(CC) -MM $(SRCS) $<

clean:	
	rm -f $(TARGET) *.o

main.o: main.cpp solver.h stl.h pdb.h performance.h
solver.o: solver.cpp solver.h stl.h pdb.h performance.h
heap.o: heap.cpp solver.h stl.h pdb.h performance.h
cnf.o: cnf.cpp solver.h stl.h pdb.h performance.h
watch.o: watch.cpp solver.h stl.h pdb.h performance.h
clauses.o: clauses.cpp solver.h stl.h pdb.h performance.h
heuristic.o: heuristic.cpp solver.h stl.h pdb.h performance.h
resources.o: resources.cpp
utils.o: utils.cpp solver.h stl.h pdb.h performance.h
unit.o: unit.cpp solver.h stl.h pdb.h performance.h
pool.o: pool.cpp solver.h stl.h pdb.h performance.h
performance.o: performance.cpp solver.h stl.h pdb.h performance.h
pdb.o: pdb.cpp solver.h stl.h pdb.h performance.h
set.o: set.cpp pdb.h stl.h
dag.o: dag.cpp pdb.h stl.h
