Almots working bot

This commit is contained in:
2024-03-28 15:52:48 +01:00
parent 863328a3de
commit 29e5b3c2bb
12 changed files with 859 additions and 745 deletions

View File

@@ -1,40 +1,42 @@
CC = clang
LD = ld.lld
CFLAGS = -Iinclude
#CFLAGS += -O0 -ggdb3
CFLAGS += -Ofast -ggdb3
CFLAGS += -Wall -Wextra -Werror
CFLAGS += -fsanitize=address
CFLAGS += -Wall -Wextra -Wno-unused-function
#CFLAGS += -fsanitize=address
LDFLAGS = -fuse-ld=lld
LDFLAGS = -fsanitize=address
#LDFLAGS += -fsanitize=address
_OBJ = chess.o common.o graphics.o pieces.o util.o
_OBJ = chess.o
OBJ = $(addprefix obj/, $(_OBJ))
TEST_DIR = testing
all: bin/chess
test: $(TEST_DIR)/bin/test_threatmap
obj:
mkdir -p $@
bin:
mkdir -p $@
docs:
doxygen doxygen-config
$(TEST_DIR):
mkdir -p $@/bin
clean:
rm bin/* obj/*.o
gdb: bin/chess
gdb $<
run: bin/chess
./$<
obj/%.o: src/%.c
$(CC) -o $@ $(CFLAGS) -c $<
bin/chess: $(OBJ)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^
.PHONY: all run gdb clean docs
$(TEST_DIR)/bin/test_%: testing/test_%.c obj/%.o obj/util.o
echo $^
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^
.PHONY: all clean docs test