forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.port.mk
555 lines (508 loc) · 15.5 KB
/
Makefile.port.mk
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
# Util variables
SPACE := $(empty) $(empty)
BACKSLASH_SPACE := $(empty)\ $(empty)
# Let's discover something about where we run
ifeq ($(OS),Windows_NT)
OS = Windows
endif
ifeq ($(OS),Windows)
PLATFORM=WIN64
SHELL = cmd.exe
endif
# Unix specific part.
ifneq ($(PLATFORM),WIN64)
OR_TOOLS_TOP ?= $(shell pwd)
OS = $(shell uname -s)
PYTHON_VERSION ?= $(shell python3 -c "from sys import version_info as v; print (str(v[0]) + '.' + str(v[1]))")
CMAKE_PLATFORM = "Unix Makefiles"
# Unix specific definitions
LIB_PREFIX = lib
O = o
E =
J = .jar
D = .dll
PDB = .pdb
EXP = .exp
ARCHIVE_EXT = .tar.gz
FZ_EXE = fzn-or-tools$E
OBJ_OUT = -o # need the space
EXE_OUT = -o # need the space
S = /
COPY = cp
COPYREC = cp -R
DEL = rm -f
DELREC = rm -rf
GREP = grep
MKDIR = mkdir
MKDIR_P = mkdir -p
RENAME = mv
SED = sed
TAR = tar
TOUCH = touch
WHICH = which
CMAKE := $(shell $(WHICH) cmake)
ifeq ($(CMAKE),)
$(error Please add "cmake" to your PATH)
endif
ifdef UNIX_CPLEX_DIR
CPLEX_INC = -I$(UNIX_CPLEX_DIR)/cplex/include -DUSE_CPLEX
endif
ifdef UNIX_XPRESS_DIR
XPRESS_INC = -I$(UNIX_XPRESS_DIR)/include -DUSE_XPRESS -DXPRESS_PATH="$(UNIX_XPRESS_DIR)"
endif
# Compilation flags
DEBUG = -O4 -DNDEBUG
ifeq ($(OS),Linux)
PLATFORM = LINUX
CXX ?= g++
CCC = $(CXX) -fPIC -std=c++17 -fwrapv
L = so
# This is needed to find libz.a
ZLIB_LNK = -lz
ifdef UNIX_GLPK_DIR
GLPK_LNK = $(UNIX_GLPK_DIR)/lib/libglpk.a
endif
ifdef UNIX_CPLEX_DIR
CPLEX_LNK = \
-L$(UNIX_CPLEX_DIR)/cplex/lib/x86-64_linux/static_pic -lcplex \
-lm -lpthread -ldl
endif
ifdef UNIX_XPRESS_DIR
XPRESS_LNK = -L$(UNIX_XPRESS_DIR)/lib -lxprs -lxprl
endif
SYS_LNK = -lrt -lpthread -Wl,--no-as-needed -ldl
PRE_LIB = -L$(OR_ROOT_FULL)/lib64 -L$(OR_ROOT_FULL)/lib -l
POST_LIB =
LINK_FLAGS = \
-Wl,-rpath,'$$ORIGIN' \
-Wl,-rpath,'$$ORIGIN/../lib64' \
-Wl,-rpath,'$$ORIGIN/../lib'
DISTRIBUTION_ID = $(shell lsb_release -i -s)
DISTRIBUTION_NUMBER = $(shell lsb_release -r -s)
DISTRIBUTION = $(DISTRIBUTION_ID)-$(DISTRIBUTION_NUMBER)
PORT = $(DISTRIBUTION)-64bit
CANDIDATE_JDK_ROOTS = \
/usr/lib64/jvm/default \
/usr/lib/jvm/default \
/usr/lib64/jvm/default-runtime \
/usr/lib/jvm/default-runtime \
/usr/lib64/jvm/default-java \
/usr/lib/jvm/default-java \
/usr/lib64/jvm/java-openjdk \
/usr/lib/jvm/java-openjdk \
/usr/lib/jvm/java-17-openjdk-amd64 \
/usr/lib/jvm/java-17-openjdk \
/usr/lib/jvm/java-16-openjdk-amd64 \
/usr/lib/jvm/java-16-openjdk \
/usr/lib/jvm/java-15-openjdk-amd64 \
/usr/lib/jvm/java-15-openjdk \
/usr/lib/jvm/java-14-openjdk-amd64 \
/usr/lib/jvm/java-14-openjdk \
/usr/lib/jvm/java-13-openjdk-amd64 \
/usr/lib/jvm/java-13-openjdk \
/usr/lib/jvm/java-12-openjdk-amd64 \
/usr/lib/jvm/java-12-openjdk \
/usr/lib/jvm/java-11-openjdk-amd64 \
/usr/lib/jvm/java-11-openjdk \
/usr/lib64/jvm/java-1.11.0-openjdk \
/usr/lib/jvm/java-1.11.0-openjdk \
/usr/lib/jvm/java-1.11.0-openjdk-amd64 \
/usr/lib/jvm/java-10-openjdk-amd64 \
/usr/lib/jvm/java-10-openjdk \
/usr/lib/jvm/java-9-openjdk-amd64 \
/usr/lib/jvm/java-9-openjdk \
/usr/lib/jvm/java-8-openjdk-amd64 \
/usr/lib/jvm/java-8-openjdk \
/usr/lib64/jvm/java-1.8.0-openjdk \
/usr/lib/jvm/java-1.8.0-openjdk \
/usr/lib/jvm/java-1.8.0-openjdk-amd64 \
/usr/local/buildtools/java/jdk
JAVA_HOME ?= $(firstword $(wildcard $(CANDIDATE_JDK_ROOTS)))
endif # ($(OS),Linux)
ifeq ($(OS),Darwin) # Assume Mac OS X
PLATFORM = MACOSX
OS_VERSION = $(shell sw_vers -productVersion)
PORT = MacOsX-$(OS_VERSION)
ifeq ($(wildcard /usr/libexec/java_home),)
JAVA_HOME = \\\# /usr/libexec/java_home could not be found on your system. Set this variable to the path to jdk to build the java files.
else
JAVA_HOME ?= $(shell /usr/libexec/java_home)
endif
MAC_MIN_VERSION = 10.15
MAC_VERSION = -mmacosx-version-min=$(MAC_MIN_VERSION)
CXX ?= clang++
CCC = $(CXX) -fPIC -std=c++17 $(MAC_VERSION) -stdlib=libc++
L = dylib
ZLIB_LNK = -lz
ifdef UNIX_GLPK_DIR
GLPK_LNK = $(UNIX_GLPK_DIR)/lib/libglpk.a
endif
ifdef UNIX_CPLEX_DIR
CPLEX_LNK = \
-force_load $(UNIX_CPLEX_DIR)/cplex/lib/x86-64_osx/static_pic/libcplex.a \
-lm -lpthread -framework CoreFoundation -framework IOKit
endif
ifdef UNIX_XPRESS_DIR
XPRESS_LNK = -Wl,-rpath,$(UNIX_XPRESS_DIR)/lib -L$(UNIX_XPRESS_DIR)/lib -lxprs -lxprl
endif
SYS_LNK =
PRE_LIB = -L$(OR_ROOT)lib -l
POST_LIB =
LINK_FLAGS = \
-framework CoreFoundation \
-Wl,-rpath,@loader_path \
-Wl,-rpath,@loader_path/../lib \
-Wl,-rpath,@loader_path/../dependencies/lib
endif # ($(OS),Darwin)
CFLAGS = \
$(DEBUG) \
-I$(INC_DIR) \
-I$(SRC_DIR) \
-I$(GEN_DIR) \
-Wno-deprecated \
-DUSE_GLOP \
-DUSE_BOP \
-DUSE_PDLP \
$(GLPK_INC) \
$(CPLEX_INC) \
$(XPRESS_INC) \
-DOR_TOOLS_MAJOR=$(OR_TOOLS_MAJOR) \
-DOR_TOOLS_MINOR=$(OR_TOOLS_MINOR) \
-DOR_TOOLS_PATCH=$(GIT_REVISION)
LDFLAGS = \
$(PRE_LIB)ortools$(POST_LIB) \
$(ZLIB_LNK) \
$(SYS_LNK) \
$(LINK_FLAGS) \
$(GLPK_LNK) \
$(CPLEX_LNK) \
$(XPRESS_LNK)
# language targets
HAS_PYTHON ?= ON
ifeq ($(PYTHON_VERSION),)
HAS_PYTHON = OFF
endif
HAS_JAVA ?= ON
JAVAC_BIN = $(shell $(WHICH) $(JAVA_HOME)/bin/javac)
JAVA_BIN = $(shell $(WHICH) $(JAVA_HOME)/bin/java)
JAR_BIN = $(shell $(WHICH) $(JAVA_HOME)/bin/jar)
MVN_BIN := $(shell $(WHICH) mvn)
ifndef JAVAC_BIN
HAS_JAVA = OFF
endif
ifndef JAR_BIN
HAS_JAVA = OFF
endif
ifndef JAVA_BIN
HAS_JAVA = OFF
endif
ifndef MVN_BIN
HAS_JAVA = OFF
endif
HAS_DOTNET ?= ON
DOTNET_BIN := $(shell $(WHICH) dotnet 2> /dev/null)
ifndef DOTNET_BIN
HAS_DOTNET=OFF
endif
else # Windows specific part.
# Check 64 bit.
ifneq ("$(Platform)","x64") # Visual Studio 2019/2022 64 bit
$(warning "Only 64 bit compilation is supported")
endif
# Detect visual studio version
ifeq ("$(VisualStudioVersion)","16.0")
VISUAL_STUDIO_YEAR = 2019
VISUAL_STUDIO_MAJOR = 16
VS_RELEASE = v142
CMAKE_PLATFORM = "Visual Studio 16 2019" -A x64
endif
ifeq ("$(VisualStudioVersion)","17.0")
VISUAL_STUDIO_YEAR = 2022
VISUAL_STUDIO_MAJOR = 17
VS_RELEASE = v143
CMAKE_PLATFORM = "Visual Studio 17 2022" -A x64
endif
ifeq ("$(VISUAL_STUDIO_YEAR)","")
$(warning "Unrecognized visual studio version")
endif
# OS Specific
OS = Windows
OR_TOOLS_TOP_AUX = $(shell cd)
OR_TOOLS_TOP = $(shell echo $(OR_TOOLS_TOP_AUX) | tools\\win\\sed.exe -e "s/\\/\\\\/g" | tools\\win\\sed.exe -e "s/ //g")
# Compiler specific
PORT = VisualStudio$(VISUAL_STUDIO_YEAR)-64bit
VS_COMTOOLS = $(VISUAL_STUDIO_MAJOR)0
# Detect Python
PYTHON_VERSION ?= $(shell python -c "from sys import version_info as v; print (str(v[0]) + str(v[1]))")
# Windows specific definitions
LIB_PREFIX =
PRE_LIB = $(OR_ROOT)lib\\
POST_LIB = .lib
LIB_SUFFIX = lib
STATIC_PRE_LIB = $(OR_ROOT)lib\\
STATIC_POST_LIB = .lib
STATIC_LIB_SUFFIX = lib
O = obj
L = lib
E = .exe
J = .jar
D = .dll
PDB = .pdb
EXP = .exp
ARCHIVE_EXT = .zip
FZ_EXE = fzn-or-tools$E
OBJ_OUT = /Fo
EXE_OUT = /Fe
S = \\
COPY = copy
COPYREC = xcopy
DEL = del
DELREC = tools\win\rm.exe -rf
GREP = tools\win\grep.exe
MKDIR = md
MKDIR_P = tools\win\mkdir.exe -p
RENAME = rename
SED = tools\win\sed.exe
TAR = tools\win\tar.exe
TOUCH = tools\win\touch.exe
UNZIP = tools\win\unzip.exe
ZIP = tools\win\zip.exe
WGET = tools\win\wget.exe
WHICH = tools\win\which.exe
CMAKE := $(shell $(WHICH) cmake)
ifeq ($(CMAKE),)
$(error Please add "cmake" to your PATH)
endif
# Compilation macros.
DEBUG=/O2 -DNDEBUG
CCC=cl /std:c++20 /EHsc /MD /nologo -nologo $(SYSCFLAGS) /D__WIN32__ /DPSAPI_VERSION=1 \
/DNOMINMAX /DWIN32_LEAN_AND_MEAN=1 /D_CRT_SECURE_NO_WARNINGS
# This is needed to find GLPK include files and libraries.
ifdef WINDOWS_GLPK_DIR
GLPK_INC = /I"$(WINDOWS_GLPK_DIR)\\include" /DUSE_GLPK
GLPK_LNK = "$(WINDOWS_GLPK_DIR)\\lib\\glpk.lib"
endif
# This is needed to find CPLEX include files and libraries.
ifdef WINDOWS_CPLEX_DIR
CPLEX_INC = /I"$(WINDOWS_CPLEX_DIR)\\cplex\\include" /DUSE_CPLEX
CPLEX_LNK = "$(WINDOWS_CPLEX_DIR)\\cplex\\lib\\x64_windows_msvc14\\stat_mda\\cplex$(WINDOWS_CPLEX_VERSION).lib"
endif
ifdef WINDOWS_XPRESS_DIR
XPRESS_INC = /I"$(WINDOWS_XPRESS_DIR)\\include" /DUSE_XPRESS /DXPRESS_PATH=\"$(WINDOWS_XPRESS_DIR)\"
XPRESS_LNK = "$(WINDOWS_XPRESS_DIR)\\lib\\xprs.lib"
endif
SYS_LNK = psapi.lib ws2_32.lib shlwapi.lib
CFLAGS = \
$(DEBUG) \
/I$(INC_DIR) \
/I$(SRC_DIR) \
/I$(GEN_DIR) \
/DUSE_GLOP \
/DUSE_BOP \
/DUSE_PDLP \
$(GLPK_INC) \
$(CPLEX_INC) \
$(XPRESS_INC) \
/DOR_TOOLS_MAJOR=$(OR_TOOLS_MAJOR) \
/DOR_TOOLS_MINOR=$(OR_TOOLS_MINOR) \
/DOR_TOOLS_PATCH=$(GIT_REVISION)
ifneq ($(USE_COINOR),OFF)
COINOR_LNK = \
$(PRE_LIB)CoinUtils.lib \
$(PRE_LIB)Osi.lib \
$(PRE_LIB)Clp.lib \
$(PRE_LIB)OsiClp.lib \
$(PRE_LIB)Cgl.lib \
$(PRE_LIB)Cbc.lib \
$(PRE_LIB)OsiCbc.lib \
$(PRE_LIB)ClpSolver.lib \
$(PRE_LIB)CbcSolver.lib
endif
ifneq ($(USE_SCIP),OFF)
SCIP_LNK = $(PRE_LIB)libscip.lib
endif
ABSL_LNK = \
$(PRE_LIB)absl_bad_any_cast_impl.lib \
$(PRE_LIB)absl_bad_optional_access.lib \
$(PRE_LIB)absl_bad_variant_access.lib \
$(PRE_LIB)absl_base.lib \
$(PRE_LIB)absl_city.lib \
$(PRE_LIB)absl_civil_time.lib \
$(PRE_LIB)absl_cord.lib \
$(PRE_LIB)absl_cordz_functions.lib \
$(PRE_LIB)absl_cordz_handle.lib \
$(PRE_LIB)absl_cordz_info.lib \
$(PRE_LIB)absl_cordz_sample_token.lib \
$(PRE_LIB)absl_cord_internal.lib \
$(PRE_LIB)absl_debugging_internal.lib \
$(PRE_LIB)absl_demangle_internal.lib \
$(PRE_LIB)absl_examine_stack.lib \
$(PRE_LIB)absl_exponential_biased.lib \
$(PRE_LIB)absl_failure_signal_handler.lib \
$(PRE_LIB)absl_flags.lib \
$(PRE_LIB)absl_flags_commandlineflag.lib \
$(PRE_LIB)absl_flags_commandlineflag_internal.lib \
$(PRE_LIB)absl_flags_config.lib \
$(PRE_LIB)absl_flags_internal.lib \
$(PRE_LIB)absl_flags_marshalling.lib \
$(PRE_LIB)absl_flags_parse.lib \
$(PRE_LIB)absl_flags_private_handle_accessor.lib \
$(PRE_LIB)absl_flags_program_name.lib \
$(PRE_LIB)absl_flags_reflection.lib \
$(PRE_LIB)absl_flags_usage.lib \
$(PRE_LIB)absl_flags_usage_internal.lib \
$(PRE_LIB)absl_graphcycles_internal.lib \
$(PRE_LIB)absl_hash.lib \
$(PRE_LIB)absl_hashtablez_sampler.lib \
$(PRE_LIB)absl_int128.lib \
$(PRE_LIB)absl_leak_check.lib \
$(PRE_LIB)absl_leak_check_disable.lib \
$(PRE_LIB)absl_log_severity.lib \
$(PRE_LIB)absl_low_level_hash.lib \
$(PRE_LIB)absl_malloc_internal.lib \
$(PRE_LIB)absl_periodic_sampler.lib \
$(PRE_LIB)absl_random_distributions.lib \
$(PRE_LIB)absl_random_internal_distribution_test_util.lib \
$(PRE_LIB)absl_random_internal_platform.lib \
$(PRE_LIB)absl_random_internal_pool_urbg.lib \
$(PRE_LIB)absl_random_internal_randen.lib \
$(PRE_LIB)absl_random_internal_randen_hwaes.lib \
$(PRE_LIB)absl_random_internal_randen_hwaes_impl.lib \
$(PRE_LIB)absl_random_internal_randen_slow.lib \
$(PRE_LIB)absl_random_internal_seed_material.lib \
$(PRE_LIB)absl_random_seed_gen_exception.lib \
$(PRE_LIB)absl_random_seed_sequences.lib \
$(PRE_LIB)absl_raw_hash_set.lib \
$(PRE_LIB)absl_raw_logging_internal.lib \
$(PRE_LIB)absl_scoped_set_env.lib \
$(PRE_LIB)absl_spinlock_wait.lib \
$(PRE_LIB)absl_stacktrace.lib \
$(PRE_LIB)absl_status.lib \
$(PRE_LIB)absl_statusor.lib \
$(PRE_LIB)absl_strerror.lib \
$(PRE_LIB)absl_strings.lib \
$(PRE_LIB)absl_strings_internal.lib \
$(PRE_LIB)absl_str_format_internal.lib \
$(PRE_LIB)absl_symbolize.lib \
$(PRE_LIB)absl_synchronization.lib \
$(PRE_LIB)absl_throw_delegate.lib \
$(PRE_LIB)absl_time.lib \
$(PRE_LIB)absl_time_zone.lib
LDFLAGS = \
$(PRE_LIB)ortools$(POST_LIB) \
$(PRE_LIB)libprotobuf.lib \
$(PRE_LIB)re2.lib \
$(PRE_LIB)zlib.lib \
$(ABSL_LNK) \
$(COINOR_LNK) \
$(SCIP_LNK) \
$(SYS_LNK) \
$(GLPK_LNK) \
$(CPLEX_LNK) \
$(XPRESS_LNK)
# language targets
HAS_PYTHON ?= ON
ifeq ($(PYTHON_VERSION),)
HAS_PYTHON = OFF
endif
HAS_JAVA ?= ON
JAVAC_BIN=$(shell $(WHICH) "$(JAVA_HOME)\bin\javac")
JAVA_BIN=$(shell $(WHICH) "$(JAVA_HOME)\bin\java")
JAR_BIN=$(shell $(WHICH) "$(JAVA_HOME)\bin\jar")
MVN_BIN := $(shell $(WHICH) mvn.cmd)
ifndef JAVAC_BIN
HAS_JAVA = OFF
endif
ifndef JAR_BIN
HAS_JAVA = OFF
endif
ifndef JAVA_BIN
HAS_JAVA = OFF
endif
ifndef MVN_BIN
HAS_JAVA = OFF
endif
HAS_DOTNET ?= ON
DOTNET_BIN := $(shell $(WHICH) dotnet 2> NUL)
ifndef DOTNET_BIN
HAS_DOTNET=OFF
endif
endif # ($(PLATFORM),WIN64)
# C++ relevant directory
BUILD_DIR = $(OR_ROOT)dependencies
INC_DIR = $(OR_ROOT)include
SRC_DIR = $(OR_ROOT).
GEN_DIR = $(OR_ROOT)ortools/gen
GEN_PATH = $(subst /,$S,$(GEN_DIR))
OBJ_DIR = $(OR_ROOT)objs
LIB_DIR = $(OR_ROOT)lib
BIN_DIR = $(OR_ROOT)bin
FZ_EX_DIR = $(OR_ROOT)examples/flatzinc
FZ_EX_PATH = $(subst /,$S,$(FZ_EX_DIR))
# C++ examples relevant directory
CC_EX_DIR = $(OR_ROOT)examples/cpp
CC_GEN_DIR = $(GEN_DIR)/examples/cpp
CC_EX_PATH = $(subst /,$S,$(CC_EX_DIR))
CC_GEN_PATH = $(subst /,$S,$(CC_GEN_DIR))
# Python relevant directory
PYTHON_EX_DIR = $(OR_ROOT)examples/python
PYTHON_EX_PATH = $(subst /,$S,$(PYTHON_EX_DIR))
# Java relevant directory
JAVA_EX_DIR = $(OR_ROOT)examples/java
JAVA_EX_PATH = $(subst /,$S,$(JAVA_EX_DIR))
# .Net relevant directory
DOTNET_EX_DIR = $(OR_ROOT)examples/dotnet
DOTNET_EX_PATH = $(subst /,$S,$(DOTNET_EX_DIR))
# Contrib examples directory
CONTRIB_EX_DIR = $(OR_ROOT)examples/contrib
CONTRIB_EX_PATH = $(subst /,$S,$(CONTRIB_EX_DIR))
# Test examples directory
TEST_DIR = $(OR_ROOT)examples/tests
TEST_PATH = $(subst /,$S,$(TEST_DIR))
# Get github revision level
ifneq ($(wildcard .git),)
ifneq ($(wildcard .git/shallow),)
$(warning you are using a shallow copy)
GIT_REVISION:= 9999
else
GIT_REVISION:= $(shell git rev-list --count HEAD)
endif
GIT_HASH:= $(shell git rev-parse --short HEAD)
else
GIT_REVISION:= 9999
GIT_HASH:= "not_on_git"
endif
OR_TOOLS_VERSION := $(OR_TOOLS_MAJOR).$(OR_TOOLS_MINOR).$(GIT_REVISION)
OR_TOOLS_SHORT_VERSION := $(OR_TOOLS_MAJOR).$(OR_TOOLS_MINOR)
ifdef PRE_RELEASE
OR_TOOLS_VERSION := $(OR_TOOLS_VERSION)-beta
OR_TOOLS_SHORT_VERSION := $(OR_TOOLS_SHORT_VERSION)-beta
endif
INSTALL_DIR = or-tools_$(PORT)_v$(OR_TOOLS_VERSION)
FZ_INSTALL_DIR = or-tools_flatzinc_$(PORT)_v$(OR_TOOLS_VERSION)
DATA_INSTALL_DIR = or-tools_data_v$(OR_TOOLS_VERSION)
BUILD_PYTHON ?= OFF
BUILD_JAVA ?= OFF
BUILD_DOTNET ?= OFF
.PHONY: detect_port # Show variables used to build OR-Tools.
detect_port:
@echo Relevant info on the system:
@echo OS = $(OS)
@echo PLATFORM = $(PLATFORM)
@echo PORT = $(PORT)
@echo SHELL = $(SHELL)
@echo OR_TOOLS_TOP = $(OR_TOOLS_TOP)
@echo OR_TOOLS_VERSION = $(OR_TOOLS_VERSION)
@echo OR_TOOLS_SHORT_VERSION = $(OR_TOOLS_SHORT_VERSION)
@echo GIT_REVISION = $(GIT_REVISION)
@echo GIT_HASH = $(GIT_HASH)
@echo CMAKE = $(CMAKE)
@echo HAS_PYTHON = $(HAS_PYTHON)
@echo HAS_JAVA = $(HAS_JAVA)
@echo HAS_DOTNET = $(HAS_DOTNET)
@echo CMAKE_PLATFORM = $(CMAKE_PLATFORM)
ifeq ($(PLATFORM),WIN64)
@echo off & echo(
else
@echo
endif