-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
59 lines (50 loc) · 1.38 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
HMEMORY_BUILD_TEST ?= y
prefix ?= /usr/local
subdir-y = \
src
subdir-${HMEMORY_BUILD_TEST} += \
test
test_depends-y = \
src
include Makefile.lib
tests: test
${Q}( \
export hmemory_corruption_check_interval=250; \
export hmemory_show_reachable=1; \
sc=0; \
ss=0; \
sf=0; \
for t in `ls -1 test/success-*-debug`; do \
echo "testing $$t ..."; \
$$t; \
if [ "$$?" != "0" ]; then \
sf=$$((sf + 1)); \
else \
ss=$$((ss + 1)); \
fi; \
sc=$$((sc + 1)); \
done; \
export hmemory_corruption_check_interval=250; \
fc=0; \
fs=0; \
ff=0; \
for t in `ls -1 test/fail-*-debug`; do \
echo "testing $$t ..."; \
$$t; \
if [ "$$?" = "0" ]; then \
ff=$$((ff + 1)); \
else \
fs=$$((fs + 1)); \
fi; \
fc=$$((fc +1)); \
done; \
echo "success tests total: $$sc, success: $$ss, fail: $$sf"; \
echo "fail tests total: $$fc, success: $$fs, fail: $$ff"; \
)
install: src test
install -d ${DESTDIR}/${prefix}/include/hmemory
install -m 0644 dist/include/hmemory.h ${DESTDIR}/${prefix}/include/hmemory/hmemory.h
install -d ${DESTDIR}/${prefix}/lib
install -m 0644 dist/lib/libhmemory.o ${DESTDIR}/${prefix}/lib/libhmemory.o
install -m 0644 dist/lib/libhmemory.a ${DESTDIR}/${prefix}/lib/libhmemory.a
install -m 0755 dist/lib/libhmemory.so ${DESTDIR}/${prefix}/lib/libhmemory.so