/
makefile
59 lines (49 loc) · 2.02 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Ethereal is a UCI chess playing engine authored by Andrew Grant.
# <https://github.com/AndyGrant/Ethereal> <andrew@grantnet.us>
#
# Ethereal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ethereal is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
CC = gcc
CCDROID = arm-linux-gnueabi-gcc
SRC = *.c fathom/tbprobe.c
LIBS = -lpthread -lm
EXE = Ethereal
WFLAGS = -std=gnu11 -Wall -Wextra -Wshadow
CFLAGS = -DNDEBUG -O3 $(WFLAGS) -march=native -flto
RFLAGS = -DNDEBUG -O3 $(WFLAGS) -flto -static
AFLAGS = -DNDEBUG -O3 $(WFLAGS) -march=armv7 -flto -static
TFLAGS = -DNDEBUG -O3 $(WFLAGS) -march=native -flto -fopenmp -DTUNE
PFLAGS = -DNDEBUG -O0 $(WFLAGS) -p -pg
DFLAGS = -O0 $(WFLAGS)
POPCNTFLAGS = -DUSE_POPCNT -msse3 -mpopcnt
PEXTFLAGS = $(POPCNTFLAGS) -DUSE_PEXT -mbmi2
popcnt:
$(CC) $(CFLAGS) $(SRC) $(LIBS) $(POPCNTFLAGS) -o $(EXE)
nopopcnt:
$(CC) $(CFLAGS) $(SRC) $(LIBS) -o $(EXE)
pext:
$(CC) $(CFLAGS) $(SRC) $(LIBS) $(PEXTFLAGS) -o $(EXE)
android:
$(CCDROID) $(AFLAGS) $(SRC) $(LIBS) -o $(EXE)$(VER)-android
release:
mkdir ../dist
$(CC) $(RFLAGS) $(SRC) $(LIBS) -o ../dist/$(EXE)$(VER)-x64-nopopcnt.exe
$(CC) $(RFLAGS) $(SRC) $(LIBS) $(POPCNTFLAGS) -o ../dist/$(EXE)$(VER)-x64-popcnt.exe
$(CC) $(RFLAGS) $(SRC) $(LIBS) $(PEXTFLAGS) -o ../dist/$(EXE)$(VER)-x64-pext.exe
$(CCDROID) $(AFLAGS) $(SRC) $(LIBS) -o ../dist/$(EXE)$(VER)-android
texel:
$(CC) $(TFLAGS) $(SRC) $(LIBS) $(POPCNT) -o $(EXE)
profile:
$(CC) $(PFLAGS) $(SRC) $(LIBS) $(POPCNT) -o $(EXE)
debug:
$(CC) $(DFLAGS) $(SRC) $(LIBS) $(POPCNT) -o $(EXE)