
PC := fpc
PFLAGS := -Mobjfpc -Sh
TEMP := temp
PFLAGS += -FU$(TEMP)

ifdef DEBUG
#PFLAGS += -dDEBUG
PFLAGS += -Sa -ghl -Cr
else
PFLAGS += -CX -Xs -XX -O2
endif

ifdef RANDOM
PFLAGS += -dRANDOM_MOVER
PFLAGS += -orandom_mover
endif

UNITS := chess.pas history.pas log.pas parser.pas vectors.pas version.pas

durandal: durandal.pas $(UNITS)
	$(PC) $< $(PFLAGS)

test:
	rm -f *.log
	expect tests/test.exp

clean:
	rm -f $(TEMP)/*.o $(TEMP)/*.ppu

.PHONY: durandal

# make PC=/home/roland/Applications/fpc-322-x86_64-win64/fpc.exe
