34 lines
1.0 KiB
Makefile
34 lines
1.0 KiB
Makefile
include src/options.mk
|
|
|
|
PYTHON = python
|
|
|
|
# Checking Python version
|
|
PYTHON_EXE := $(shell command -v $(PYTHON) 2> /dev/null)
|
|
|
|
ifndef PYTHON_EXE
|
|
$(error Unable to find the $(PYTHON) executable!)
|
|
endif
|
|
|
|
PYTHON_VERSION_MAJOR := $(shell $(PYTHON_EXE) --version 2>&1 | cut -d" " -f2 | cut -d. -f1)
|
|
PYTHON_VERSION_MINOR := $(shell $(PYTHON_EXE) --version 2>&1 | cut -d" " -f2 | cut -d. -f2)
|
|
|
|
ifneq ($(shell test $(PYTHON_VERSION_MAJOR) -ge 3 -a $(PYTHON_VERSION_MINOR) -ge 6; echo $$?),0)
|
|
$(error Python version >= 3.6 is needed!)
|
|
endif
|
|
|
|
|
|
.PHONY: venv doc
|
|
|
|
|
|
venv:
|
|
virtualenv --python=python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) --system-site-packages --prompt="(msspec-$(VERSION)) " venv
|
|
. ./venv/bin/activate && pip install --upgrade pip && pip install -r src/pip.freeze
|
|
|
|
doc:
|
|
@echo "Building pdf and html documentation..."
|
|
@mkdir -p package/
|
|
@+$(MAKE) -C doc/ latexpdf $(SUPPRESS_OUPUT)
|
|
@rm -rf package/*.pdf
|
|
@cp "doc/build/latex/MsSpec-python.pdf" "./package/MsSpec-${VERSION}.pdf"
|
|
@+$(MAKE) -C doc/ html $(SUPPRESS_OUPUT)
|