forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.python
58 lines (45 loc) · 1.55 KB
/
Makefile.python
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
##############################Windows specific part##############################
# set this variable to the full path to your Python installation
WINDOWS_PATH_TO_PYTHON =
# Set this variable to use it as PYTHONPATH
WINDOWS_PYTHONPATH =
###############################Unix specific part################################
# Set UNIX_PYTHON_VER to the version number of the Python installation on your computer that you wish to use with or-tools.
#Example : UNIX_PYTHON_VER = 3.5 or UNIX_PYTHON_VER = 2.7
UNIX_PYTHON_VER =
# Set this variable to use it as PYTHONPATH.
UNIX_PYTHONPATH =
##################################################################################
.PHONY: rpy install check
# Let's discover something about where we run
ifeq "$(SHELL)" "cmd.exe"
SYSTEM = win
else
ifeq "$(SHELL)" "sh.exe"
SYSTEM = win
S = \\
else
SYSTEM = unix
S = /
endif
endif
ifeq ($(SYSTEM),win)
PYTHON_EXECUTABLE = $(WINDOWS_PATH_TO_PYTHON)$Spython
#Set PYTHONPATH only when WINDOWS_PYTHONPATH is used.
ifneq ($(WINDOWS_PYTHONPATH),)
SET_PYTHONPATH = @set PYTHONPATH=$(WINDOWS_PYTHONPATH) &&
endif
else #UNIX
PYTHON_EXECUTABLE = python$(UNIX_PYTHON_VER)
#Set PYTHONPATH only when UNIX_PYTHONPATH is used.
ifneq ($(UNIX_PYTHONPATH),)
SET_PYTHONPATH = @PYTHONPATH=$(UNIX_PYTHONPATH)
endif
endif #ifeq ($(SYSTEM),win)
check:
$(SET_PYTHONPATH) $(PYTHON_EXECUTABLE) check_python_deps.py --log=INFO
rpy: $(EX)
@echo Running $(EX)
$(SET_PYTHONPATH) $(PYTHON_EXECUTABLE) check_python_deps.py --log=ERROR
$(SET_PYTHONPATH) $(PYTHON_EXECUTABLE) $(EX) $(ARGS)
print-% : ; @echo $* = $($*)