Files
ortools-clone/tools/Makefile.python

62 lines
1.7 KiB
Makefile
Raw Normal View History

2016-10-03 15:41:48 +02:00
##############################Windows specific part##############################
# set this variable to the full path to your Python installation
WINDOWS_PATH_TO_PYTHON =
2016-12-21 13:38:46 +01:00
2016-10-03 15:41:48 +02:00
# Set this variable to use it as PYTHONPATH
2016-12-19 12:41:48 +01:00
WINDOWS_PYTHONPATH =
2016-10-03 15:41:48 +02:00
###############################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
2016-12-19 12:41:48 +01:00
UNIX_PYTHON_VER =
2016-10-03 15:41:48 +02:00
# Set this variable to use it as PYTHONPATH.
2016-12-19 12:41:48 +01:00
UNIX_PYTHONPATH =
2016-10-03 15:41:48 +02:00
##################################################################################
.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),)
2016-12-19 12:41:48 +01:00
SET_PYTHONPATH = @set PYTHONPATH=$(WINDOWS_PYTHONPATH) &&
endif
else #UNIX
2016-12-19 12:41:48 +01:00
PYTHON_EXECUTABLE = python$(UNIX_PYTHON_VER)
#Set PYTHONPATH only when UNIX_PYTHONPATH is used.
ifneq ($(UNIX_PYTHONPATH),)
2016-12-19 12:41:48 +01:00
SET_PYTHONPATH = @PYTHONPATH=$(UNIX_PYTHONPATH)
2016-10-03 15:41:48 +02:00
endif
endif #ifeq ($(SYSTEM),win)
2016-10-03 15:41:48 +02:00
install:
$(PYTHON_EXECUTABLE) setup.py install --user
2016-12-19 12:41:48 +01:00
$(SET_PYTHONPATH) $(PYTHON_EXECUTABLE) check_python_deps.py --log=ERROR
2016-10-03 15:41:48 +02:00
check:
2016-12-19 12:41:48 +01:00
$(SET_PYTHONPATH) $(PYTHON_EXECUTABLE) check_python_deps.py --log=INFO
2016-10-03 15:41:48 +02:00
rpy: $(EX)
@echo Running $(EX)
2016-12-19 12:41:48 +01:00
$(SET_PYTHONPATH) $(PYTHON_EXECUTABLE) check_python_deps.py --log=ERROR
$(SET_PYTHONPATH) $(PYTHON_EXECUTABLE) $(EX) $(ARGS)
2016-10-03 15:41:48 +02:00
print-% : ; @echo $* = $($*)