-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile.venv
26 lines (19 loc) · 1.05 KB
/
Makefile.venv
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
PYTHON_VERSION := 3.10
BINARY_NINJA_PATH := /opt/binaryninja
PREFIX := .
.PHONY: venv
venv: $(VENV_PATH) $(VENV_PATH)/lib/python$(PYTHON_VERSION)/site-packages/binaryninja.pth
.ONESHELL: $(VENV_PATH)
$(VENV_PATH):
virtualenv -ppython$(PYTHON_VERSION) $(VENV_PATH)
$(VENV_PATH)/bin/python -mpip install -r $(PREFIX)/requirements.txt
$(VENV_PATH)/lib/python$(PYTHON_VERSION)/site-packages/binaryninja.pth: $(BINARY_NINJA_PATH)/python $(BINARY_NINJA_PATH)/scripts/install_api.py
$(VENV_PATH)/bin/python $$(readlink -f $(BINARY_NINJA_PATH)/scripts/install_api.py)
echo "$(BINARY_NINJA_PATH)/python" > $(VENV_PATH)/lib/python$(PYTHON_VERSION)/site-packages/binaryninja.pth
$(BINARY_NINJA_PATH)/python:
@$(error Failed to find Binary Ninja at '$(BINARY_NINJA_PATH)'. \
Please set the BINARY_NINJA_PATH variable manually, e.g. \
make ... BINARY_NINJA_PATH=/your/path/to/binja)
$(BINARY_NINJA_PATH)/scripts/install_api.py:
@$(error install_api.py not found. Please install the Binary Ninja API package manually using \
the install_api.py script from Binary Ninja.)