forked from quantumlib/qsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (37 loc) · 841 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
TARGETS = qsim
TESTS = run-cxx-tests
CXX=g++
CXXFLAGS = -O3 -march=native -fopenmp
PYBIND11 = true
export CXX
export CXXFLAGS
ifeq ($(PYBIND11), true)
TARGETS += pybind
TESTS += run-py-tests
endif
.PHONY: all
all: $(TARGETS)
.PHONY: qsim
qsim:
$(MAKE) -C apps/
.PHONY: pybind
pybind:
$(MAKE) -C pybind_interface/ pybind
.PHONY: cxx-tests
tests:
-git submodule update --init --recursive tests/googletest
$(MAKE) -C tests/
.PHONY: run-cxx-tests
run-cxx-tests: cxx-tests
$(MAKE) -C tests/ run-all
PYTESTS = $(shell find qsimcirq_tests/ -name '*_test.py')
.PHONY: run-py-tests
run-py-tests: pybind
for exe in $(PYTESTS); do if ! python3 -m pytest $$exe; then exit 1; fi; done
.PHONY: run-tests
run-tests: $(TESTS)
.PHONY: clean
clean:
-$(MAKE) -C apps/ clean
-$(MAKE) -C tests/ clean
-$(MAKE) -C pybind_interface/ clean