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 98 99 100 101 102
|
#
# Basic makefile. Use this for building the C++ library and the SWIG
# bindings.
#
# Notes:
# - can compile with clang++ using:
# % make GXX=clang++
# - 32-bit build:
# % make MACHINE=-m32
# - debug build:
# % make DEBUG=1
#
include make/Defs.mk
all: lib
lib:
${MAKE} -f make/Cpp.mk -j8
#
# SWIG targets
#
python: lib
$(MAKE) -f make/Python.mk
echo-python-build-directory:
@echo $(PYTHON_BUILD_DIR)
csharp: lib
$(MAKE) -f make/CSharp.mk
before-xbuild: csharp
-mkdir -p bin/Debug
-mkdir -p bin/Release
-cp $(BUILD_ROOT)/CSharp/libConsensusCore.so bin/Debug/
-cp $(BUILD_ROOT)/CSharp/libConsensusCore.so bin/Release/
#
# Clean targets
#
clean-python:
-rm -rf $(PYTHON_BUILD_DIR)
-rm -rf ConsensusCore.egg-info
-rm -rf dist
clean-csharp:
-rm -rf $(CSHARP_BUILD_DIR)
-rm -rf bin obj
clean-cxx:
-rm -rf $(BUILD_ROOT)/C++
clean: clean-cxx clean-python clean-csharp
-rm -rf $(BUILD_ROOT)
#
# Test targets
#
test-python:
@make -f make/Python.mk test-python
test-csharp:
@make -f make/CSharp.mk test-csharp
test: lib
@make -f make/Tests.mk
check: test
tests: test
#
# Lint targets
#
lint:
-find src -name "*.[ch]pp" | xargs ./tools/cpplint.py --verbose=0 --counting=toplevel
pre-commit-hook:
# for speed, apply cpplint only to changed files.
git diff --cached --name-only --diff-filter=ACM | \
grep -e '.*.[ch]pp$$' | xargs tools/cpplint.py --verbose=3
#
# Targets used by PBI internal build
#
pip-uninstall: $(shell which pip > /dev/null)
@pip freeze|grep 'ConsensusCore=='>/dev/null \
&& pip uninstall -y ConsensusCore \
|| true
pip-install: $(shell which pip > /dev/null)
@pip install --no-index \
--install-option="--swig=$(SWIG)" \
--install-option="--boost=$(BOOST)" \
./
.PHONY: all lib clean-cxx clean test tests check python clean-python \
csharp clean-csharp echo-python-build-directory \
test-python test-csharp pip-uninstall pip-install \
lint pre-commit-hook
|