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

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

1) ran with valgrind and did some leak patching

  • Property mode set to 100644
File size: 2.2 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        gcc -g -O1 $(MY_INCLUDES_VAL) -c abac_attr.c -o leak_attr.o
31        gcc -g -O1 -o tleak leak_attr.o $(MY_LDFLAGS_VAL) 
32        valgrind -v --leak-check=full ./tleak IceCream_ID.pem  IceCream_private.pem IceCream_attr.xml Chocolate_ID.pem
33
34
35tt: tbasic.c
36        gcc -g $(MY_INCLUDES_VAL) -c tbasic.c -o tbasic.o
37        gcc -g -o tt tbasic.o $(MY_LDFLAGS_VAL)
38        ./tt
39
40clean-local:
41        @rm -rf abac_attr.o abac_attr *.pem *.xml abac_prover.o
42        @rm -rf abac_prover *.log
43        @rm -rf tt tbasic.o tbasic
44
45setup2: abac_attr abac_prover abac_attr_partial
46
47attr:
48        echo '---running (c) attr script'
49        $(MY_ENV) ./setup.sh 1>/dev/null 2>&1
50        make abac_attr
51        (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"` ; \
52        if [ -z "$$rc" ]; then \
53          echo "BAD:example_scripts/c/abac_attr:using libabac c to make attributes"; \
54        else \
55          echo "GOOD:example_scripts/c/abac_attr:using libabac c to make attributes"; \
56        fi)
57
58
59prove: abac_prover
60        @echo '---running (c) prover script'
61        @$(MY_ENV) ./setup.sh 1>/dev/null 2>&1
62        @make abac_attr
63        @$(MY_ENV) ./abac_attr IceCream_ID.pem  IceCream_private.pem IceCream_attr.xml Chocolate_ID.pem 1>/dev/null 2>&1
64        (rc=`$(MY_ENV) ./run_prover | grep "prover success" ` ; \
65        if [ -z "$$rc" ]; then \
66          echo "BAD:example_scripts/c/abac_prover:using libabac c to make a prover"; \
67        else \
68          echo "GOOD:example_scripts/c/abac_prover:using libabac c to make a prover"; \
69        fi)
70
71
72
73mattr: attr.c
74        gcc -g -o mattr attr.c $(MY_LDFLAGS_VAL)
75mload: loader.c
76        gcc -g -o mload loader.c $(MY_LDFLAGS_VAL)
Note: See TracBrowser for help on using the repository browser.