-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
117 lines (98 loc) · 2.65 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
CC = clang
ENGINE = shuffle
C = $(ENGINE).c
ifndef v
v=test
endif
DISTDIR = dist
SRCDIR = src
SRCS = src/bit_manipulation.c \
src/board.c \
src/bench.c \
src/board_constants.c \
src/magic_numbers.c \
src/evaluation.c \
src/fen.c \
src/magic_num_generator.c \
src/masks.c \
src/movegen.c \
src/moves_list.c \
src/perft.c \
src/pre_calculated_tables.c \
src/random_unsigned.c \
src/search.c \
src/see.c \
src/see_test.c \
src/texel/texel.c \
src/gettime.c \
src/transposition_table.c \
src/uci.c \
src/zobrist.c \
src/polyglot/polykeys.c \
src/polyglot/polybook.c \
src/threading/tinycthread.c
all: __windows_compile
windows: __windows_compile
linux: __linux_compile
apple: __apple_arm_compile
__windows_compile:
$(CC) -Ofast -o shuffle_$(v).exe $(C) $(SRCS)
__linux_compile:
$(CC) -Ofast -lm -arch x86_64 -o shuffle_$(v) $(C) $(SRCS)
__apple_arm_compile:
$(CC) -Ofast -arch arm64 -o shuffle_$(v) $(C) $(SRCS)
dist_windows:
@echo "Building distribution tarball..."
@mkdir -p "$(DISTDIR)"
@cp -r "$(SRCDIR)/" "$(DISTDIR)/"
@cp shuffle.c "$(DISTDIR)/"
@cp Makefile "$(DISTDIR)/"
@cp README.md "$(DISTDIR)/"
@tar -czf $(DISTDIR).tar.gz "$(DISTDIR)"
@rm -rf "$(DISTDIR)"
dist_apple:
@echo "Building distribution tarball..."
@mkdir -p "$(DISTDIR)"
@mkdir -p "$(DISTDIR)/$(SRCDIR)"
@cp -r "$(SRCDIR)/" "$(DISTDIR)/$(SRCDIR)/"
@cp shuffle.c "$(DISTDIR)/"
@cp Makefile "$(DISTDIR)/"
@cp README.md "$(DISTDIR)/"
@tar -czf $(DISTDIR).tar.gz "$(DISTDIR)"
@rm -rf "$(DISTDIR)"
dist_linux:
@echo "Building distribution tarball..."
@mkdir -p "$(DISTDIR)"
@cp -r "$(SRCDIR)" "$(DISTDIR)/$(SRCDIR)/"
@cp shuffle.c "$(DISTDIR)/"
@cp Makefile "$(DISTDIR)/"
@cp README.md "$(DISTDIR)/"
@tar -czf $(DISTDIR).tar.gz "$(DISTDIR)"
@rm -rf "$(DISTDIR)"
distcheck_windows: dist_windows
@echo "Checking distribution tarball..."
@tar -xzf $(DISTDIR).tar.gz
@cd $(DISTDIR) && $(MAKE) windows
@cd $(DISTDIR) && $(MAKE) clean
@rm -rf $(DISTDIR)
@rm -f $(DISTDIR).tar.gz
@echo "Test Successful!!"
distcheck_apple: dist_apple
@echo "Checking distribution tarball..."
@tar -xzf $(DISTDIR).tar.gz
@cd $(DISTDIR) && $(MAKE) apple
@cd $(DISTDIR) && $(MAKE) clean
@rm -rf $(DISTDIR)
@rm -f $(DISTDIR).tar.gz
@echo "Test Successful!!"
distcheck_linux: dist_linux
@echo "Checking distribution tarball..."
@tar -xzf $(DISTDIR).tar.gz
@cd $(DISTDIR) && $(MAKE) linux
@cd $(DISTDIR) && $(MAKE) clean
@rm -rf $(DISTDIR)
@rm -f $(DISTDIR).tar.gz
@echo "Test Successful!!"
clean:
rm -rf $(EXE)
.PHONY: all clean dist distcheck