forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.win.mk
154 lines (139 loc) · 4.73 KB
/
Makefile.win.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
# ----- You should not need to modify the following, unless the -----
# ----- configuration is not standard. In that case, please tell us -----
# ----- about it. -----
# Windows specific definitions
LIB_PREFIX =
PRE_LIB = $(OR_ROOT)lib\\
POST_LIB = .lib
LIB_SUFFIX = lib
SWIG_PYTHON_LIB_SUFFIX = dll
SWIG_DOTNET_LIB_SUFFIX = dll
JNI_LIB_EXT = dll
STATIC_PRE_LIB = $(OR_ROOT)lib\\
STATIC_POST_LIB = .lib
STATIC_LIB_SUFFIX = lib
LINK_CMD = lib
STATIC_LINK_CMD = lib
# C++ relevant directory
INC_DIR = $(OR_ROOT).
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++ 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
CLASS_DIR = $(OR_ROOT)classes
JAVA_EX_DIR = $(OR_ROOT)examples/java
JAVA_EX_PATH = $(subst /,$S,$(JAVA_EX_DIR))
# .Net relevant directory
PACKAGE_DIR = $(OR_ROOT)packages
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))
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
LD_OUT = /OUT:
DYNAMIC_LD = link /DLL /LTCG /debug
S = \\
CMDSEP = &
CPSEP = ;
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
# We Can't force SHELL to cmd.exe if sh.exe is in the PATH
# cf https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html
SHCHECK := $(shell where sh.exe 2>NUL)
ifneq ($(SHCHECK),)
$(error Please remove sh.exe ($(SHCHECK)) from your PATH (e.g. set PATH=%PATH:C:\Program Files\Git\bin\;=%))
else
SHELL = cmd
endif
CMAKE := $(shell $(WHICH) cmake)
ifeq ($(CMAKE),)
$(error Please add "cmake" to your PATH)
endif
MVN_BIN := $(shell $(WHICH) mvn.cmd)
# Add some additional macros
ATTRIB = attrib
TASKKILL = taskkill
# Compilation macros.
DEBUG=/O2 -DNDEBUG
CCC=cl /std:c++17 /EHsc /MD /nologo -nologo $(SYSCFLAGS) /D__WIN32__ /DPSAPI_VERSION=1 \
/DNOMINMAX /DWIN32_LEAN_AND_MEAN=1 /D_CRT_SECURE_NO_WARNINGS
PYTHON_VERSION = $(WINDOWS_PYTHON_VERSION)
PYTHON_INC=/I"$(WINDOWS_PATH_TO_PYTHON)\\include"
PYTHON_LNK="$(WINDOWS_PATH_TO_PYTHON)\\libs\\python$(PYTHON_VERSION).lib"
# This is needed to find GLPK include files and libraries.
ifdef WINDOWS_GLPK_DIR
GLPK_INC = /I"$(WINDOWS_GLPK_DIR)\\include" /DUSE_GLPK
GLPK_SWIG = -I"$(WINDOWS_GLPK_DIR)/include" -DUSE_GLPK
DYNAMIC_GLPK_LNK = "$(WINDOWS_GLPK_DIR)\\lib\\glpk.lib"
STATIC_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_SWIG = -I"$(WINDOWS_CPLEX_DIR)/cplex/include" -DUSE_CPLEX
STATIC_CPLEX_LNK = "$(WINDOWS_CPLEX_DIR)\\cplex\\lib\\x64_windows_msvc14\\stat_mda\\cplex$(WINDOWS_CPLEX_VERSION).lib"
DYNAMIC_CPLEX_LNK = $(STATIC_CPLEX_LNK)
endif
ifdef WINDOWS_XPRESS_DIR
XPRESS_INC = /I"$(WINDOWS_XPRESS_DIR)\\include" /DUSE_XPRESS /DXPRESS_PATH=\"$(WINDOWS_XPRESS_DIR)\"
XPRESS_SWIG = -I"$(WINDOWS_XPRESS_DIR)/include" -DUSE_XPRESS
STATIC_XPRESS_LNK = "$(WINDOWS_XPRESS_DIR)\\lib\\xprs.lib"
DYNAMIC_XPRESS_LNK = $(STATIC_XPRESS_LNK)
endif
SWIG_INC = \
-DUSE_GLOP -DUSE_BOP -DABSL_MUST_USE_RESULT \
$(GLPK_SWIG) $(GUROBI_SWIG) $(CPLEX_SWIG) $(XPRESS_SWIG)
SYS_LNK = psapi.lib ws2_32.lib shlwapi.lib
JAVA_INC=/I"$(JAVA_HOME)\\include" /I"$(JAVA_HOME)\\include\\win32"
JAVAC_BIN=$(shell $(WHICH) "$(JAVA_HOME)\bin\javac")
JAVA_BIN=$(shell $(WHICH) "$(JAVA_HOME)\bin\java")
JAR_BIN=$(shell $(WHICH) "$(JAVA_HOME)\bin\jar")
DEPENDENCIES_INC = /I$(INC_DIR) /I$(GEN_DIR) \
/DUSE_GLOP /DUSE_BOP \
$(GLPK_INC) $(GUROBI_INC) $(CPLEX_INC) $(XPRESS_INC)
CFLAGS = $(DEBUG) $(DEPENDENCIES_INC) /DOR_TOOLS_MAJOR=$(OR_TOOLS_MAJOR) /DOR_TOOLS_MINOR=$(OR_TOOLS_MINOR)
JNIFLAGS=$(CFLAGS) $(DEPENDENCIES_INC)
LDFLAGS =
DEPENDENCIES_LNK = $(SYS_LNK) $(STATIC_GLPK_LNK) $(STATIC_CPLEX_LNK) $(STATIC_XPRESS_LNK)
OR_TOOLS_LNK = $(PRE_LIB)ortools$(POST_LIB)
OR_TOOLS_LDFLAGS =