forked from cselab/Mirheo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (26 loc) · 834 Bytes
/
Makefile
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
CMAKE ?= cmake
PIP ?= python -m pip
CMAKE_FLAGS ?= ""
.PHONY: build install compile_and_copy uninstall docs test clean
build:
mkdir -p build
(cd build && ${CMAKE} ${CMAKE_FLAGS} -DBUILD_TESTS=OFF ../)
(cd build && $(MAKE))
# https://stackoverflow.com/questions/1871549/determine-if-python-is-running-inside-virtualenv
# The --user argument is given only if we are not inside a virtualenv.
install: build
$(PIP) install . $(shell python -c "import sys; hasattr(sys, 'real_prefix') or print('--user')") --upgrade
uninstall:
$(PIP) uninstall mirheo -y
docs:
$(MAKE) -C docs/
test: install
(cd tests && ./run.sh)
units:
mkdir -p build
(cd build && ${CMAKE} ${CMAKE_FLAGS} -DBUILD_TESTS=ON ../)
(cd build && $(MAKE))
(cd build && $(MAKE) test)
clean:
rm -rf build
.PHONY: install uninstall build test clean docs units