# Cfish (Stockfish in C) - AmigaOS4 / PPC build
#
# This Makefile has been stripped down to target AmigaOS4/PPC only. The
# original upstream Makefile supported many architectures/compilers
# (x86-64, i386, ARM, PPC64, Windows/mingw, Intel/clang, NUMA, PGO...);
# none of that applies here, so it has all been removed rather than left
# as dead conditional branches.
#
# Usage:
#   make            (equivalent to: make build)
#   make clean

EXE = CFish_OS4

CC = gcc

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 tbprobe.o thread.o timeman.o tt.o uci.o ucioption.o \
	settings.o polybook.o

CFLAGS = -Wall -std=c11 -pedantic -Wextra -Wshadow -DNDEBUG -O3 -DNO_PREFETCH
LDFLAGS = -lm -Wl,--no-as-needed -lpthread

.PHONY: help build clean

default: build

help:
	@echo ""
	@echo "Cfish for AmigaOS4/PPC. Just run:"
	@echo ""
	@echo "  make build"
	@echo "  make clean"
	@echo ""

build: $(EXE)

$(EXE): $(OBJS)
	$(CC) -o $@ $(OBJS) $(LDFLAGS)

clean:
	rm -f $(EXE) *.o
