Subversion Repositories Games.Chess Giants

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
112 pmbaty 1
MAKE=make
2
COMPILER=GCC_MINGW64
3
#COMPILER=GCC
4
 
5
#CLEAN_CMD=@rm -f *.o *.bak *.bin *.lrn game.* log.* *~ .#*
6
CLEAN_CMD=del *.o *.gcda
7
 
8
ifeq ($(COMPILER),GCC_MINGW64)
9
   CC=x86_64-w64-mingw32-gcc
10
   CPPC=x86_64-w64-mingw32-g++
11
   LN=x86_64-w64-mingw32-g++
12
else
13
   CC=gcc
14
   CPPC=g++
15
   LN=g++
16
endif
17
 
18
CFLAGS=-O3 -Wall -ansi -pedantic -Wno-long-long -pthread -flto -msse -DNDEBUG
19
protectordbg: CFLAGS=-Wall -ansi -pedantic -Wno-long-long -pthread
20
 
21
protectorobjects = protector.o bitboard.o position.o fen.o io.o \
22
                   movegeneration.o matesearch.o keytable.o hash.o test.o \
23
                   pgn.o tools.o search.o evaluation.o coordination.o \
24
                   xboard.o book.o tablebase.o
25
 
26
protectorsources = $(protectorobjects:.o=.c) egtb.cpp
27
 
28
.c.o:
29
	$(CC) $(CFLAGS) -c $*.c
30
 
31
.cpp.o:
32
	$(CPPC) $(CPPFLAGS) -O3 -flto -c $*.cpp
33
 
34
protector: $(protectorobjects) egtb.o
35
	$(LN) -lstdc++ -lm -pthread -static -flto -o Protector $(protectorobjects) egtb.o
36
 
37
protectordbg: $(protectorobjects) egtb.o
38
	$(LN) -lstdc++ -lm -pthread -static -flto -o Protector $(protectorobjects) egtb.o
39
 
40
protector_pgogen: $(protectorobjects) egtb.o
41
	$(LN) -lstdc++ -lm -pthread -static -flto -fprofile-generate -o Protector $(protectorobjects) egtb.o
42
 
43
protector_pgouse: $(protectorobjects) egtb.o
44
	$(LN) -lstdc++ -lm -pthread -static -flto -fprofile-use -o Protector $(protectorobjects) egtb.o
45
 
46
all:
47
	$(MAKE) clean
48
	$(MAKE) protector
49
	$(MAKE) clean
50
 
51
debug:
52
	$(MAKE) clean
53
	$(MAKE) protectordbg
54
	$(MAKE) clean
55
 
56
protectorpgo:
57
	$(MAKE) clean
58
	$(MAKE) CFLAGS='-fprofile-generate -O3 -Wall -ansi -pedantic -Wno-long-long -pthread -flto -msse -DNDEBUG' CPPFLAGS='-fprofile-generate' protector_pgogen
59
	del *.o
60
	Protector.exe -t pgo.pgn
61
	$(MAKE) CFLAGS='-fprofile-use -O3 -Wall -ansi -pedantic -Wno-long-long -pthread -flto -msse -DNDEBUG' CPPFLAGS='-fprofile-use' protector_pgouse
62
	$(MAKE) clean
63
 
64
.PHONY: clean
65
clean:
66
	$(CLEAN_CMD)