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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
# -*- coding: utf-8 -*-
# :Project: python-rapidjson -- Development Makefile
# :Author: Lele Gaifax <lele@metapensiero.it>
# :License: MIT License
# :Copyright: © 2017, 2018, 2019, 2020 Lele Gaifax
#
export TOPDIR := $(CURDIR)
ifdef VIRTUAL_ENV
export VENVDIR := $(VIRTUAL_ENV)
else
export VENVDIR := $(TOPDIR)/env
endif
export PYTHON := $(VENVDIR)/bin/python
export SHELL := /bin/bash
export SYS_PYTHON := $(shell which python3.7 || which python3)
all: rapidjson/license.txt virtualenv help
rapidjson/license.txt:
git submodule update --init
rapidjson_exact_version.txt: .git/modules/rapidjson/FETCH_HEAD
(cd rapidjson; git describe --tags) > $@
.PHONY: help
help::
@printf "\nBuild targets\n"
@printf "=============\n\n"
help::
@printf "build\n\tbuild the module\n"
.PHONY: build
build: virtualenv rapidjson_exact_version.txt
$(PYTHON) setup.py build_ext --inplace
help::
@printf "clean\n\tremove rebuildable stuff\n"
.PHONY: clean
clean:
$(MAKE) -C docs clean
rm -f *.so
rm -rf build
help::
@printf "distclean\n\tremove anything superfluous\n"
.PHONY: distclean
distclean:: clean
rm -rf .tox build dist rapidjson_exact_version.txt
git submodule deinit --all
help::
@printf "doc\n\tbuild Sphinx documentation\n"
SPHINXBUILD := $(VENVDIR)/bin/sphinx-build
.PHONY: doc
doc:
$(MAKE) -C docs SPHINXBUILD=$(SPHINXBUILD) html
help::
@printf "check\n\trun the test suite\n"
PYTEST = $(VENVDIR)/bin/pytest $(PYTEST_OPTIONS)
.PHONY: check
check: build
$(PYTEST) tests/
LANG=C $(MAKE) -C docs SPHINXBUILD=$(SPHINXBUILD) doctest
help::
@printf "benchmarks\n\trun the benchmarks\n"
.PHONY: benchmarks
benchmarks: build
$(PYTEST) benchmarks/
help::
@printf "benchmarks-others\n\trun the benchmarks against other engines\n"
.PHONY: benchmarks-others
benchmarks-others: PYTEST_OPTIONS = --compare-other-engines
benchmarks-others: benchmarks
help::
@printf "benchmarks-tables\n\tproduce a reST table out of benchmarks-others results\n"
.PHONY: benchmarks-tables
benchmarks-tables: PYTEST_OPTIONS = --compare-other-engines --benchmark-json=comparison.json
benchmarks-tables: benchmarks
$(PYTHON) benchmarks/tablize.py | tee docs/benchmarks-tables.rst
include Makefile.virtualenv
include Makefile.release
|