CXX      = g++
CXXFLAGS = -std=c++03 -O2 -Wall
LDFLAGS  = -pthread -lm
TARGET   = slow296

# Note: HashNC.cpp, movegenNC.cpp and searchMainNC.cpp are NOT compiled here.
# Per the original Readme296.txt, the files ending in "NC" are pulled in via
# #include from searchExtra.cpp / moves.cpp.
SRCS = EndgameEval.cpp Evaluate.cpp bitbases.cpp board.cpp gui.cpp \
       moves.cpp oBook.cpp searchExtra.cpp transcript.cpp winboard.cpp
OBJS = $(SRCS:.cpp=.o)
DEPS = $(wildcard *.h) HashNC.cpp movegenNC.cpp searchMainNC.cpp

.PHONY: all clean

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)

%.o: %.cpp $(DEPS)
	$(CXX) $(CXXFLAGS) -c -o $@ $<

clean:
	rm -f $(OBJS) $(TARGET)
