source: tests/example_scripts/c/Makefile.am @ 7764378

abac0-leak
Last change on this file since 7764378 was 7764378, checked in by Mei <mei@…>, 6 years ago

1) tweak according valgrind's leak report

  • Property mode set to 100644
File size: 2.3 KB
Line 
1#
2# example_scripts/c
3#
4
5include  ../../abac.mk
6
7.PHONY: clean-local
8
9all: attr prove
10
11abac_attr.o: abac_attr.c
12        gcc -g $(MY_INCLUDES_VAL) -c abac_attr.c -o abac_attr.o
13
14abac_attr: abac_attr.o
15        gcc -g -o abac_attr abac_attr.o $(MY_LDFLAGS_VAL)
16
17abac_prover.o: abac_prover.c
18        gcc -g $(MY_INCLUDES_VAL) -c abac_prover.c -o abac_prover.o
19
20abac_prover: abac_prover.o
21        gcc -g -o abac_prover abac_prover.o $(MY_LDFLAGS_VAL)
22
23tchunk: tchunk.c
24        gcc -g $(MY_INCLUDES_VAL) -c tchunk.c -o tchunk.o
25        gcc -g -o tchunk tchunk.o $(MY_LDFLAGS_VAL)
26        ./tchunk 0 IceCream_ID.pem IceCream_private.pem
27        ./tchunk 1 IceCream_ID.pem IceCream_private.pem
28
29tleak: abac_attr.c
30        make clean
31        @$(MY_ENV) ./setup.sh 1>/dev/null 2>&1
32        gcc -g -O1 $(MY_INCLUDES_VAL) -c abac_attr.c -o abac_attr.o
33        gcc -g -O1 -o leak_attr abac_attr.o $(MY_LDFLAGS_VAL) 
34        gcc -g -O1 $(MY_INCLUDES_VAL) -c abac_prover.c -o abac_prover.o
35        gcc -g -O1 -o leak_prover abac_prover.o $(MY_LDFLAGS_VAL)
36        $(MY_ENV) ./run_leak_prover
37
38tt: tbasic.c
39        gcc -g $(MY_INCLUDES_VAL) -c tbasic.c -o tbasic.o
40        gcc -g -o tt tbasic.o $(MY_LDFLAGS_VAL)
41        ./tt
42
43clean-local:
44        @rm -rf abac_attr.o abac_attr *.pem *.xml abac_prover.o
45        @rm -rf abac_prover *.log
46        @rm -rf tt tbasic.o tbasic
47
48setup2: abac_attr abac_prover abac_attr_partial
49
50attr:
51        echo '---running (c) attr script'
52        $(MY_ENV) ./setup.sh 1>/dev/null 2>&1
53        make abac_attr
54        (rc=`$(MY_ENV) ./abac_attr IceCream_ID.pem  IceCream_private.pem IceCream_attr.xml Chocolate_ID.pem 2>/dev/null 2>/dev/null | grep "attr success"` ; \
55        if [ -z "$$rc" ]; then \
56          echo "BAD:example_scripts/c/abac_attr:using libabac c to make attributes"; \
57        else \
58          echo "GOOD:example_scripts/c/abac_attr:using libabac c to make attributes"; \
59        fi)
60
61
62prove: abac_prover
63        @echo '---running (c) prover script'
64        @$(MY_ENV) ./setup.sh 1>/dev/null 2>&1
65        @make abac_attr
66        @$(MY_ENV) ./abac_attr IceCream_ID.pem  IceCream_private.pem IceCream_attr.xml Chocolate_ID.pem 1>/dev/null 2>&1
67        (rc=`$(MY_ENV) ./run_prover | grep "prover success" ` ; \
68        if [ -z "$$rc" ]; then \
69          echo "BAD:example_scripts/c/abac_prover:using libabac c to make a prover"; \
70        else \
71          echo "GOOD:example_scripts/c/abac_prover:using libabac c to make a prover"; \
72        fi)
73
74
75
76mattr: attr.c
77        gcc -g -o mattr attr.c $(MY_LDFLAGS_VAL)
78mload: loader.c
79        gcc -g -o mload loader.c $(MY_LDFLAGS_VAL)
Note: See TracBrowser for help on using the repository browser.