# This makefile is to be used for compilation of Crafty with gcc under Windows. # Tested with source code of Crafty 19.15 from 13.07.2004. # Tested with Dev-C++ 4.9.8.10, which includes gcc/g++ 3.2. all: NT_i386 NT_i386: $(MAKE) target=NT_i386 \ CC=gcc CXX=g++ CYY=g++\ CFLAGS='$(CFLAGS) -fomit-frame-pointer -O3' \ CXFLAGS=$(CFLAGS) \ LDFLAGS=$(LDFLAGS) \ opt='$(opt) -DFUTILITY -DINLINE_ASM' \ crafty-make # The following alternative with option "-mcpu=i486" gives worse result with # AMD Athlon 900 than above alternative: NT_i386_this_alternative: $(MAKE) target=NT_i386 \ CC=gcc CXX=g++ CYY=g++\ CFLAGS='$(CFLAGS) -fomit-frame-pointer -mcpu=i486 -O3' \ CXFLAGS=$(CFLAGS) \ LDFLAGS=$(LDFLAGS) \ opt='$(opt) -DFUTILITY -DINLINE_ASM' \ crafty-make # # one of the two following definitions for "objects" should be used. The # default is to compile everything separately. However, if you use the # definition that refers to crafty.o, that will compile using the file crafty.c # which #includes every source file into one large glob. This gives the # compiler max opportunity to inline functions as appropriate. You should try # compiling both ways to see which way produces the fastest code. # objects = searchr.o search.o thread.o searchmp.o repeat.o next.o nexte.o \ nextr.o history.o quiesce.o evaluate.o movgen.o make.o unmake.o hash.o \ attacks.o swap.o boolean.o utility.o valid.o probe.o book.o data.o \ drawn.o edit.o epd.o epdglue.o init.o input.o interupt.o iterate.o \ main.o option.o output.o ponder.o preeval.o resign.o root.o learn.o \ setboard.o test.o time.o validate.o annotate.o analyze.o evtest.o \ bench.o egtb.o dgt.o #objects = crafty.o egtb.o opts = $(opt) -D$(target) includes = data.h chess.h crafty-make: @$(MAKE) opt='$(opt)' crafty crafty: $(objects) $(CYY) $(LDFLAGS) -o crafty $(objects) -lm $(LIBS) dgt: dgtdrv.o @cc -O -o dgt dgtdrv.c egtb.o: egtb.cpp $(CXX) -c $(CXFLAGS) $(opts) egtb.cpp clean: -rm -f *.o crafty $(objects): $(includes) .c.o: $(CC) $(CFLAGS) $(opts) -c $*.c .s.o: $(AS) $(AFLAGS) -o $*.o $*.s