-
Notifications
You must be signed in to change notification settings - Fork 171
Expand file tree
/
Copy pathMakefile
More file actions
206 lines (180 loc) · 5.9 KB
/
Makefile
File metadata and controls
206 lines (180 loc) · 5.9 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
CONFIG=config.mk
include ./${CONFIG}
export CONFIG_FILE=${CURDIR}/${CONFIG}
# user config options
setup1=$(shell mkdir -p /tmp/build-charm)
dest_build=/tmp/build-charm
help:
@echo "Build targets:"
@echo " make deps - Build dependency libs locally."
@echo " make source - Create source package."
@echo " make install - Install on local system."
@echo " make clean - Get rid of scratch and byte files."
@echo " make doc - Compile documentation"
@echo ""
@echo "Test targets:"
@echo " make test - Run all tests via pytest (same as test-all)"
@echo " make test-unit - Run unit tests only (toolbox, serialize, vectors)"
@echo " make test-schemes - Run cryptographic scheme tests only"
@echo " make test-toolbox - Run toolbox tests only"
@echo " make test-zkp - Run ZKP compiler tests only"
@echo " make test-adapters - Run adapter tests only"
@echo " make test-all - Run all test categories sequentially"
@echo " make test-embed - Build and run C/C++ embedding API tests"
@echo " make xmltest - Run tests and produce XML results"
.PHONY: setup
setup:
@echo "Setup build/staging directories"
set -x
${setup1}
set +x
.PHONY: all
all: setup
@echo "Building the Charm Framework"
${PYTHON} setup.py build ${PYTHONFLAGS} ${PYTHONBUILDEXT}
@echo "Complete"
.PHONY: deps
deps:
@echo "Building the dependency libs"
make -C deps
.PHONY: source
source:
$(PYTHON) setup.py sdist --formats=gztar,zip # --manifest-only
.PHONY: install
install:
$(PYTHON) setup.py install
.PHONY: uninstall
uninstall:
$(PYTHON) setup.py uninstall
.PHONY: test
test:
$(PYTHON) setup.py test
# Test category targets
.PHONY: test-unit
test-unit:
@echo "========================================"
@echo "Running Unit Tests (toolbox, serialize, vectors)"
@echo "========================================"
$(PYTHON) -m pytest charm/test/toolbox/ charm/test/serialize/ charm/test/vectors/ -v
@find . -name '*.pyc' -delete
@echo "Unit tests complete."
.PHONY: test-schemes
test-schemes:
@echo "========================================"
@echo "Running Scheme Tests"
@echo "========================================"
$(PYTHON) -m pytest charm/test/schemes/ -v
@find . -name '*.pyc' -delete
@echo "Scheme tests complete."
.PHONY: test-toolbox
test-toolbox:
@echo "========================================"
@echo "Running Toolbox Tests"
@echo "========================================"
$(PYTHON) -m pytest charm/test/toolbox/ -v
@find . -name '*.pyc' -delete
@echo "Toolbox tests complete."
.PHONY: test-zkp
test-zkp:
@echo "========================================"
@echo "Running ZKP Compiler Tests"
@echo "========================================"
$(PYTHON) -m pytest charm/test/zkp_compiler/ -v
@find . -name '*.pyc' -delete
@echo "ZKP compiler tests complete."
.PHONY: test-adapters
test-adapters:
@echo "========================================"
@echo "Running Adapter Tests"
@echo "========================================"
$(PYTHON) -m pytest charm/test/adapters/ -v
@find . -name '*.pyc' -delete
@echo "Adapter tests complete."
.PHONY: test-integration
test-integration:
@echo "========================================"
@echo "Running Integration Tests"
@echo "========================================"
@echo "Note: Integration tests run benchmark and cross-module tests"
$(PYTHON) -m pytest charm/test/benchmark/ -v --ignore=charm/test/fuzz/
@find . -name '*.pyc' -delete
@echo "Integration tests complete."
.PHONY: test-all
test-all:
@echo "========================================"
@echo "Running All Test Categories"
@echo "========================================"
@echo ""
@echo ">>> [1/6] Unit Tests (toolbox, serialize, vectors)"
$(PYTHON) -m pytest charm/test/toolbox/ charm/test/serialize/ charm/test/vectors/ -v
@echo ""
@echo ">>> [2/6] Scheme Tests"
$(PYTHON) -m pytest charm/test/schemes/ -v
@echo ""
@echo ">>> [3/6] ZKP Compiler Tests"
$(PYTHON) -m pytest charm/test/zkp_compiler/ -v
@echo ""
@echo ">>> [4/6] Adapter Tests"
$(PYTHON) -m pytest charm/test/adapters/ -v
@echo ""
@echo ">>> [5/6] Benchmark Tests"
$(PYTHON) -m pytest charm/test/benchmark/ -v
@echo ""
@echo ">>> [6/6] Doctest Tests"
$(PYTHON) -m pytest --doctest-modules charm/zkp_compiler/ --ignore=charm/zkp_compiler/zkp_generator.py --ignore=charm/zkp_compiler/zk_demo.py -v
@find . -name '*.pyc' -delete
@echo ""
@echo "========================================"
@echo "All test categories complete!"
@echo "========================================"
.PHONY: test-embed
test-embed:
@echo "========================================"
@echo "Running C/C++ Embed API Tests"
@echo "========================================"
@echo "Building embed test..."
@cd embed && $(MAKE) clean
@cd embed && $(MAKE)
@echo ""
@echo "Running embed test..."
ifeq ($(OS),Windows_NT)
@cd embed && PYTHONPATH=.. ./test.exe
else
@cd embed && PYTHONPATH=.. ./test
endif
@echo ""
@echo "Embed API tests complete."
# Legacy target alias
.PHONY: test-charm
test-charm: test-toolbox
.PHONY: xmltest
xmltest:
$(PYTHON) tests/all_tests_with_xml_test_result.py
find . -name '*.pyc' -delete
.PHONY: doc
doc:
if test "${BUILD_DOCS}" = "yes" ; then \
${MAKE} -C doc html; \
fi
# .PHONY: buildrpm
# buildrpm:
# $(PYTHON) setup.py bdist_rpm # --post-install=rpm/postinstall --pre-uninstall=rpm/preuninstall
.PHONY: builddeb
builddeb:
# build the source package in the parent directory
# then rename it to project_version.orig.tar.gz
$(PYTHON) setup.py sdist --dist-dir=../ --prune
#rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
# build the package
#dpkg-buildpackage -i -I -rfakeroot
.PHONY: clean
clean:
$(PYTHON) setup.py clean
# cd doc; $(MAKE) clean
# $(MAKE) -f $(CURDIR)/debian/rules clean
rm -rf build/ dist/ ${dest_build} MANIFEST
rm ${CONFIG}
find . -name '*.pyc' -delete
find . -name '*.so' -delete
find . -name '*.o' -delete
find . -name '*.dll' -delete