2020-11-30 16:39:29 +01:00
|
|
|
include src/options.mk
|
2020-11-24 09:57:35 +01:00
|
|
|
|
2020-12-02 18:18:47 +01:00
|
|
|
PYTHON = python
|
2021-01-21 11:12:24 +01:00
|
|
|
PYMAJ = 3
|
|
|
|
PYMIN = 6
|
2020-11-24 09:57:35 +01:00
|
|
|
|
2021-01-21 11:12:24 +01:00
|
|
|
# Checking Python path and version
|
2020-11-30 16:39:29 +01:00
|
|
|
PYTHON_EXE := $(shell command -v $(PYTHON) 2> /dev/null)
|
2020-11-24 09:57:35 +01:00
|
|
|
|
2020-11-30 16:39:29 +01:00
|
|
|
ifndef PYTHON_EXE
|
|
|
|
$(error Unable to find the $(PYTHON) executable!)
|
|
|
|
endif
|
2020-11-24 09:57:35 +01:00
|
|
|
|
2021-01-22 17:03:53 +01:00
|
|
|
ifeq ($(shell $(PYTHON_EXE) -c "import sys; exit(sys.version_info >= ($(PYMAJ),$(PYMIN)))"; echo $$?),0)
|
2021-01-21 11:12:24 +01:00
|
|
|
$(error Python version >= $(PYMAJ).$(PYMIN) is needed!)
|
2020-11-30 16:39:29 +01:00
|
|
|
endif
|
2020-11-24 09:57:35 +01:00
|
|
|
|
|
|
|
|
2020-12-08 21:28:22 +01:00
|
|
|
.PHONY: pybinding install devel venv doc clean
|
2020-12-02 08:49:59 +01:00
|
|
|
|
|
|
|
|
2021-02-19 08:22:47 +01:00
|
|
|
pybinding:
|
2021-01-22 17:03:53 +01:00
|
|
|
@+. $(VENV_PATH)/bin/activate && $(MAKE) -C src pybinding
|
2020-11-24 09:57:35 +01:00
|
|
|
|
|
|
|
|
2021-01-12 12:20:13 +01:00
|
|
|
venv:
|
2021-01-22 17:03:53 +01:00
|
|
|
@virtualenv --python=$(PYTHON_EXE) --prompt="(msspec-$(VERSION)) " $(VENV_PATH)
|
|
|
|
@. $(VENV_PATH)/bin/activate && pip install --upgrade pip && pip install -r src/pip.freeze
|
2021-01-12 12:20:13 +01:00
|
|
|
|
|
|
|
|
2021-02-19 08:22:47 +01:00
|
|
|
install: venv pybinding
|
2021-01-22 17:03:53 +01:00
|
|
|
@+. $(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"
|
2020-12-02 18:18:47 +01:00
|
|
|
|
2021-01-12 12:20:13 +01:00
|
|
|
|
|
|
|
devel: VENV_PATH = ./_venv
|
2021-02-19 08:22:47 +01:00
|
|
|
devel: venv pybinding
|
2020-12-08 21:28:22 +01:00
|
|
|
@. $(VENV_PATH)/bin/activate && pip install -e src/
|
|
|
|
|
2020-11-24 09:57:35 +01:00
|
|
|
|
|
|
|
doc:
|
|
|
|
@echo "Building pdf and html documentation..."
|
|
|
|
@mkdir -p package/
|
2020-12-02 18:18:47 +01:00
|
|
|
@+$(MAKE) -C doc/ latexpdf
|
2020-11-24 09:57:35 +01:00
|
|
|
@rm -rf package/*.pdf
|
2020-12-02 18:18:47 +01:00
|
|
|
@cp "doc/build/latex/MsSpec-python.pdf" "./package/MsSpec-$(VERSION).pdf"
|
|
|
|
@+$(MAKE) -C doc/ html
|
|
|
|
|
2021-01-12 12:20:13 +01:00
|
|
|
|
2020-12-02 18:18:47 +01:00
|
|
|
clean::
|
|
|
|
@+$(MAKE) -C src/ clean
|
|
|
|
|
2021-01-13 18:26:08 +01:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Top Makefile help message"
|
|
|
|
|