major rework

This commit is contained in:
2026-01-03 16:22:42 +01:00
parent 4998a057f5
commit 716527fa8f
14 changed files with 2431 additions and 2261 deletions

View File

@@ -3,14 +3,14 @@ BUILD ?= debug
CC := clang
CFLAGS.gcc := -std=c23 -Wall -Wextra -Wconversion -Wno-unused-function
CFLAGS.gcc.release := -Ofast
CFLAGS.gcc.release := -Ofast -march=native -DNDEBUG
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 := -std=c23 -g -Wall -Wextra -Wconversion -Wno-unused-function -Wimplicit-int-conversion
CFLAGS.clang.release := -O3 -ffast-math -march=native # -DNDEBUG
CFLAGS.clang.debug := -g3 -O0 -fsanitize=address
CFLAGS.clang.wasm := \
--target=wasm32-unknown-unknown -O3 -nostdlib \
--target=wasm32-unknown-unknown -nostdlib -g \
-Wl,--export-all \
-Wl,--no-entry
@@ -23,8 +23,8 @@ 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)
chess.wasm: wasm-compat-chatgpt.c mbb_rook.h mbb_bishop.h engine.h
$(CC) -DWASM -o $@ wasm-compat-chatgpt.c $(CFLAGS.$(CC)) $(CFLAGS.$(CC).wasm)
mbb_rook.h: codegen
./codegen
@@ -33,4 +33,4 @@ mbb_bishop.h: codegen
./codegen
tests: tests.c mbb_rook.h mbb_bishop.h engine.h
$(CC) -o $@ $(CFLAGS) tests.c
$(CC) -o $@ $(CFLAGS) -DUSE_PRINTF tests.c