forked from BieremaBoyzProgramming/bbpPairings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·140 lines (120 loc) · 3.45 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
OBJECTS = main.o fileformats/generatorconfiguration.o fileformats/trf.o \
matching/computer.o matching/detail/graph.o matching/detail/parentblossom.o \
matching/detail/rootblossom.o swisssystems/burstein.o swisssystems/common.o \
swisssystems/dutch.o tournament/checker.o tournament/generator.o \
tournament/tournament.o
# Flags specifying which Swiss systems to include.
burstein = yes
dutch = yes
# Flag indicating whether the tournament checker and random tournament generator
# should be included
engine_comparison = yes
# The maximum type sizes that the build should attempt to support.
# Default values are set/computed in tournament/tournament.h based on the
# constraints imposed by the TRF(x) format and build limitations.
max_players = 0
# Points are specified in tenths. So a value of 999 means that the max total
# score of a player (with acceleration) is 99.9.
max_points = 0
max_rating = 0
max_rounds = 0
bits = 64
debug = no
profile = no
optimize = yes
static = no
COMPILER_FLAGS += -std=c++14 -I. -m$(bits) -MD -MP -Wpedantic -pedantic-errors \
-Wall -Wextra -Wuninitialized -Wstrict-overflow=4 -Wundef -Wshadow \
-Wcast-qual -Wcast-align -Wmissing-declarations -Wredundant-decls -Wvla \
-Wno-unused-parameter -Wno-sign-compare -Wno-maybe-uninitialized -Wno-overflow
VERSION_INFO="$(shell git describe --exact-match 2> /dev/null)"
ifeq ($(VERSION_INFO),"")
VERSION_INFO="non-release build $(shell git describe 2> /dev/null)"
endif
COMPILER_FLAGS += -DVERSION_INFO=$(VERSION_INFO)
ifeq ($(static),yes)
LDFLAGS += -static
endif
ifeq ($(profile),yes)
COMPILER_FLAGS += -ggdb
CXXFLAGS += -O3
ifneq ($(debug),yes)
COMPILER_FLAGS += -DNDEBUG
endif
else
ifeq ($(debug),yes)
COMPILER_FLAGS += -ggdb
ifeq ($(optimize),yes)
CXXFLAGS += -Og
endif
else
COMPILER_FLAGS += -DNDEBUG
LDFLAGS += -s
ifeq ($(optimize),yes)
CXXFLAGS += -O3
endif
endif
endif
ifneq ($(burstein),yes)
COMPILER_FLAGS += -DOMIT_BURSTEIN
endif
ifneq ($(dutch),yes)
COMPILER_FLAGS += -DOMIT_DUTCH
endif
ifneq ($(engine_comparison),yes)
COMPILER_FLAGS += -DOMIT_GENERATOR -DOMIT_CHECKER
endif
ifneq ($(max_players),0)
COMPILER_FLAGS += -DMAX_PLAYERS=$(max_players)
endif
ifneq ($(max_points),0)
COMPILER_FLAGS += -DMAX_POINTS=$(max_points)
endif
ifneq ($(max_rating),0)
CCOMPILER_FLAGS += -DMAX_RATING=$(max_rating)
endif
ifneq ($(max_rounds),0)
COMPILER_FLAGS += -DMAX_ROUNDS=$(max_rounds)
endif
ifeq ($(COMP),)
COMP=gcc
endif
ifeq ($(COMP),gcc)
COMPILER_FLAGS += -Wdouble-promotion -Wsuggest-final-types \
-Wsuggest-final-methods -Wsuggest-override -Warray-bounds=2 \
-Wduplicated-cond -Wtrampolines -Wconditionally-supported \
-Wlogical-op -Wno-aggressive-loop-optimizations \
-Wvector-operation-performance
ifeq ($(HOST),Windows)
ifeq ($(bits),32)
CXX=i686-w64-mingw32-g++
else
CXX=x86_64-w64-mingw32-g++
endif
ifeq ($(optimize),yes)
COMPILER_FLAGS += -flto
endif
CXXFLAGS += $(COMPILER_FLAGS)
else
CXX=g++
CXXFLAGS += $(COMPILER_FLAGS)
CXXFLAGS += -DEXPERIMENTAL_FILESYSTEM
ifeq ($(optimize),yes)
CXXFLAGS += -flto
endif
LDFLAGS += -lstdc++fs
endif
endif
LDFLAGS += $(CXXFLAGS)
.PHONY: build clean
build: bbpPairings.exe
makefile_directory:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
clean:
$(RM) bbpPairings.exe
find $(makefile_directory) -name \*.o -type f -delete
find $(makefile_directory) -name \*.d -type f -delete
default:
build
bbpPairings.exe: $(OBJECTS)
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
-include $(OBJECTS:%.o=%.d)