From 5c3bd88785ad888bb181c32f15c123400ef53caa Mon Sep 17 00:00:00 2001 From: TerjeKir <42723273+TerjeKir@users.noreply.github.com> Date: Wed, 2 Sep 2020 17:46:33 +0200 Subject: [PATCH] Weiss 1.1 (#329) Update version to 1.1 + cleanup makefile. --- .github/workflows/make.yml | 4 +-- bin/.gitkeep | 0 src/makefile | 54 ++++++++++++++------------------------ src/uci.h | 2 +- 4 files changed, 23 insertions(+), 37 deletions(-) delete mode 100644 bin/.gitkeep diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 7b15bcba..6a201bc1 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -6,10 +6,10 @@ jobs: build: runs-on: ubuntu-latest - + steps: - uses: actions/checkout@v1 - name: test - run: cd src && make bench-pgo + run: cd src && make pgo - name: release run: cd src && make release diff --git a/bin/.gitkeep b/bin/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/makefile b/src/makefile index 2587f8e9..0794a045 100644 --- a/src/makefile +++ b/src/makefile @@ -19,11 +19,9 @@ # General EXE = weiss SRC = *.c pyrrhic/tbprobe.c noobprobe/noobprobe.c tuner/tuner.c -OUT = ../bin/ COMP = gcc # Defines -DEV = -DDEV POPCNT = -msse3 -mpopcnt PEXT = $(POPCNT) -DUSE_PEXT -mbmi2 @@ -32,23 +30,18 @@ STD = -std=gnu11 LIBS = -pthread -lm WARN = -Wall -Wextra -Wshadow -CFLAGS = $(STD) $(WARN) -O3 -flto -march=native -RFLAGS = $(STD) $(WARN) -O3 -flto -static -PFLAGS = $(STD) $(WARN) -O0 -march=native -pg -p +FLAGS = $(STD) $(WARN) -O3 -flto +CFLAGS = $(FLAGS) -march=native +RFLAGS = $(FLAGS) -static # PGO PGODIR = "../pgo" PGOGEN = -fprofile-generate=$(PGODIR) PGOUSE = -fprofile-use=$(PGODIR) -# Link winsock32 on windows -ifeq ($(OS), Windows_NT) - LIBS += -lwsock32 -endif - # Try to detect windows environment by seeing -# whether the shell filters out the "s or not. -ifeq ($(shell echo "check_quotes"), "check_quotes") +# whether the shell filters out " or not. +ifeq ($(shell echo "test"), "test") RUNBENCH = $(EXE) bench 12 > nul 2>&1 CLEAN = rmdir /s /q $(PGODIR) else @@ -56,33 +49,26 @@ else CLEAN = $(RM) -rf $(PGODIR) endif -# Compilations -BASE = $(COMP) $(CFLAGS) $(SRC) $(LIBS) -RELEASE = $(COMP) $(RFLAGS) $(SRC) $(LIBS) -o $(OUT)$(EXE) -BENCH = $(BASE) -o $(EXE) -BIN = $(BASE) -o $(OUT)$(EXE) - -# For OpenBench -bench-basic: - $(BENCH) +# Link winsock32 on windows for NoobBook +ifeq ($(OS), Windows_NT) + LIBS += -lwsock32 +endif -bench-pext: - $(BENCH) $(PEXT) +# Compilations +BASIC = $(COMP) $(CFLAGS) $(SRC) $(LIBS) -o $(EXE) +RELEASE = $(COMP) $(RFLAGS) $(SRC) $(LIBS) -o $(EXE) -bench-pgo: - $(BENCH) $(PEXT) $(PGOGEN) - $(RUNBENCH) - $(BENCH) $(PEXT) $(PGOUSE) - $(CLEAN) +# Targets +basic: + $(BASIC) -# For normal use pext: - $(BIN)-pext $(PEXT) + $(BASIC) $(PEXT) pgo: - $(BENCH) $(PEXT) $(PGOGEN) + $(BASIC) $(PEXT) $(PGOGEN) $(RUNBENCH) - $(BIN)-pext-pgo.exe $(PEXT) $(PGOUSE) + $(BASIC) $(PEXT) $(PGOUSE) $(CLEAN) release: @@ -91,7 +77,7 @@ release: $(RELEASE)-pext.exe $(PEXT) dev: - $(BENCH)-dev $(PEXT) $(DEV) + $(BASIC)-dev $(PEXT) -DDEV tune: - $(BENCH) $(PEXT) -DTUNE -fopenmp + $(BASIC) $(PEXT) -DTUNE -fopenmp diff --git a/src/uci.h b/src/uci.h index 302a15f6..16b743a3 100644 --- a/src/uci.h +++ b/src/uci.h @@ -22,7 +22,7 @@ #include -#define NAME "Weiss 1.0" +#define NAME "Weiss 1.1" #define START_FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" #define INPUT_SIZE 4096