msspec_python3/Makefile

59 lines
1.4 KiB
Makefile
Raw Normal View History

include src/options.mk
PYTHON = python
PYMAJ = 3
PYMIN = 6
# Checking Python path and version
PYTHON_EXE := $(shell command -v $(PYTHON) 2> /dev/null)
ifndef PYTHON_EXE
$(error Unable to find the $(PYTHON) executable!)
endif
ifeq ($(shell $(PYTHON_EXE) -c "import sys; exit(sys.version_info >= ($(PYMAJ),$(PYMIN)))"; echo $$?),0)
$(error Python version >= $(PYMAJ).$(PYMIN) is needed!)
endif
.PHONY: pybinding install devel venv doc clean
2020-12-02 08:49:59 +01:00
pybinding: venv
@+. $(VENV_PATH)/bin/activate && $(MAKE) -C src pybinding
venv:
@virtualenv --python=$(PYTHON_EXE) --prompt="(msspec-$(VERSION)) " $(VENV_PATH)
@. $(VENV_PATH)/bin/activate && pip install --upgrade pip && pip install -r src/pip.freeze
install: pybinding
@+. $(VENV_PATH)/bin/activate && $(MAKE) -C src sdist
@+. $(VENV_PATH)/bin/activate && $(MAKE) -C src frontend
@+. $(VENV_PATH)/bin/activate && pip install src/dist/msspec-$(VERSION).tar.gz
@echo "Do not forget to check that $(INSTALL_PREFIX)/bin is set in your \$$PATH"
devel: VENV_PATH = ./_venv
devel: pybinding venv
@. $(VENV_PATH)/bin/activate && pip install -e src/
doc:
@echo "Building pdf and html documentation..."
@mkdir -p package/
@+$(MAKE) -C doc/ latexpdf
@rm -rf package/*.pdf
@cp "doc/build/latex/MsSpec-python.pdf" "./package/MsSpec-$(VERSION).pdf"
@+$(MAKE) -C doc/ html
clean::
@+$(MAKE) -C src/ clean
2021-01-13 18:26:08 +01:00
help:
@echo "Top Makefile help message"