Skip to content

Commit

Permalink
Fix syzygy dependencies issue
Browse files Browse the repository at this point in the history
fixes #2660

The problem was caused by .depend being created with a rule for tbprobe.o not for syzygy/tbprobe.o.
This patch keeps an explicit list of sources (SRCS), generates OBJS,
and compiles all object files to the src/ directory, consistent with .depend.
VPATH is used to search the syzygy directory as needed.

joint work with @gvreuls

closes #2664

No functional change
  • Loading branch information
xoto10 authored and vondele committed May 9, 2020
1 parent a91cb9f commit fcaf073
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Makefile
Expand Up @@ -35,10 +35,14 @@ BINDIR = $(PREFIX)/bin
### Built-in benchmark for pgo-builds
PGOBENCH = ./$(EXE) bench

### Object files
OBJS = benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o \
material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o \
search.o thread.o timeman.o tt.o uci.o ucioption.o tune.o syzygy/tbprobe.o
### Source and object files
SRCS = benchmark.cpp bitbase.cpp bitboard.cpp endgame.cpp evaluate.cpp main.cpp \
material.cpp misc.cpp movegen.cpp movepick.cpp pawns.cpp position.cpp psqt.cpp \
search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp tune.cpp syzygy/tbprobe.cpp

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

VPATH = syzygy

### Establish the operating system name
KERNEL = $(shell uname -s)
Expand Down Expand Up @@ -450,7 +454,7 @@ objclean:
# clean auxiliary profiling files
profileclean:
@rm -rf profdir
@rm -f bench.txt *.gcda ./syzygy/*.gcda *.gcno ./syzygy/*.gcno
@rm -f bench.txt *.gcda *.gcno
@rm -f stockfish.profdata *.profraw

default:
Expand Down Expand Up @@ -536,7 +540,7 @@ icc-profile-use:
all

.depend:
-@$(CXX) $(DEPENDFLAGS) -MM $(OBJS:.o=.cpp) > $@ 2> /dev/null
-@$(CXX) $(DEPENDFLAGS) -MM $(SRCS) > $@ 2> /dev/null

-include .depend

0 comments on commit fcaf073

Please sign in to comment.