Files
chess-engine/Makefile
Ole Morud 160ea82549 Major rework: add search timer, evaluation improvements, more
ADDITIONAL CHANGES

Alpha-Beta search
* Change back to recursive alphabeta with implicit stack
* Add atomic_bool parameter that stops search when set to false
* Update tests accordingly

Evaluation
* Fix bug where black pawns are using white's positional modifier bonus

Makefile
* Add -march=native to clang release builds
2025-12-26 16:18:09 +01:00

37 lines
856 B
Makefile

BUILD ?= debug
CC := clang
CFLAGS.gcc := -std=c23 -Wall -Wextra -Wconversion -Wno-unused-function
CFLAGS.gcc.release := -Ofast
CFLAGS.gcc.debug := -ggdb -O0 -fsanitize=address
CFLAGS.clang := -std=c23 -Wall -Wextra -Wconversion -Wno-unused-function -Wimplicit-int-conversion
CFLAGS.clang.release := -Ofast -march=native
CFLAGS.clang.debug := -ggdb -O0 -fsanitize=address
CFLAGS.clang.wasm := \
--target=wasm32-unknown-unknown -O3 -nostdlib \
-Wl,--export-all \
-Wl,--no-entry
CFLAGS := $(CFLAGS.$(CC)) $(CFLAGS.$(CC).$(BUILD))
all: tests
wasm: chess.wasm
codegen: codegen.c
$(CC) -o $@ $(CFLAGS) $^
chess.wasm: wasm-compat.c
$(CC) -DWASM -o $@ wasm-compat.c $(CFLAGS.$(CC)) $(CFLAGS.$(CC).wasm)
mbb_rook.h: codegen
./codegen
mbb_bishop.h: codegen
./codegen
tests: tests.c mbb_rook.h mbb_bishop.h engine.h
$(CC) -o $@ $(CFLAGS) tests.c