-
Notifications
You must be signed in to change notification settings - Fork 72
/
Makefile
66 lines (52 loc) · 1.61 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.PHONY: all clean deps src cli examples bindings
all: check-env deps src cli examples
check-env:
ifndef ZROOT
$(error ZROOT is undefined. Need to source env file: . ./env)
endif
INSTALL_PREFIX ?= /usr/local
docs:
$(MAKE) -C docs
deps:
$(MAKE) -C deps
src:
$(MAKE) -C src
$(MAKE) -C cli
cli:
$(MAKE) -C cli
examples:
$(MAKE) -C examples
bindings:
$(MAKE) -C bindings
install-deps:
mkdir -p $(ZROOT)/deps/root/bin
mkdir -p $(INSTALL_PREFIX)
cp -r $(ZROOT)/deps/root/lib $(INSTALL_PREFIX)
cp -r $(ZROOT)/deps/root/include $(INSTALL_PREFIX)
cp -rn $(ZROOT)/deps/root/bin $(INSTALL_PREFIX)
install: install-deps
mkdir -p $(INSTALL_PREFIX)/bin
cp -r $(ZROOT)/root/lib $(INSTALL_PREFIX)
cp -r $(ZROOT)/root/include $(INSTALL_PREFIX)
install -m 755 $(ZROOT)/src/bench_libopenabe $(INSTALL_PREFIX)/bin
install -m 755 $(ZROOT)/src/profile_libopenabe $(INSTALL_PREFIX)/bin
install -m 755 $(ZROOT)/cli/oabe_setup $(INSTALL_PREFIX)/bin
install -m 755 $(ZROOT)/cli/oabe_keygen $(INSTALL_PREFIX)/bin
install -m 755 $(ZROOT)/cli/oabe_enc $(INSTALL_PREFIX)/bin
install -m 755 $(ZROOT)/cli/oabe_dec $(INSTALL_PREFIX)/bin
test:
(cd src && ./test_libopenabe) || exit 1
(cd src && ./test_zml) || exit 1
(cd src && ./test_abe) || exit 1
(cd src && ./test_pke) || exit 1
(cd src && ./test_ske) || exit 1
(cd src && ./test_zsym) || exit 1
(cd cli && echo "hello world!" > ./input.txt && ./runTest.sh input.txt) || exit 1
clean:
$(MAKE) -C src clean
$(MAKE) -C cli clean
$(MAKE) -C examples clean
$(RM) -rf $(ZROOT)/deps/root
$(RM) -rf $(ZROOT)/root/lib/* $(ZROOT)/root/include/*
distclean: clean
$(MAKE) -C deps distclean