Index: tests/example_scripts/Makefile.am
===================================================================
--- tests/example_scripts/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -2,15 +2,15 @@
 # example_scripts
 #
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
+
+EXPECTED_OKAY = 23
 
 DIRECTORY = c perl python wiki
 SUBDIRS = $(DIRECTORY)
 
-.PHONY : runcheck clean-local
-
+.PHONY : runcheck clean-local clean
 all: runcheck
 
 clean-local:
+clean:
 	@for i in $(DIRECTORY); do \
 	  here=`pwd`; \
@@ -34,5 +34,9 @@
 	  then \
 	    (if test `cat error | wc -l ` -eq 0 ; \
-	      then echo "   PASSED"; \
+	      then \
+	        (if test `grep GOOD result | wc -l ` -eq $(EXPECTED_OKAY) ; \
+	          then echo "   PASSED!!!"; \
+	          else echo "   ERROR, no error but not enough good results!!!"; \
+                fi); \
 	      else (echo "   ERROR!!!"; cat error;); \
 	    fi); \
Index: tests/example_scripts/c/Makefile.am
===================================================================
--- tests/example_scripts/c/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/c/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,38 +3,31 @@
 #
 
+include  ${TESTDIR}/abac.mk
+
 .PHONY: clean-local 
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV) LD_LIBRARY_PATH=$(abs_top_builddir)/libabac/.libs
-
-LDFLAGS =-L$(abs_top_builddir)/libabac/.libs -labac -lm -lpthread -Wl,-rpath
 
 all: attr prove 
 
 abac_attr.o: abac_attr.c
-	@gcc -g $(INCLUDES) -c abac_attr.c -o abac_attr.o
+	gcc -g $(MY_INCLUDES_VAL) -c abac_attr.c -o abac_attr.o
 
 abac_attr: abac_attr.o
-	@gcc -g -o abac_attr abac_attr.o $(LDFLAGS)
+	gcc -g -o abac_attr abac_attr.o $(MY_LDFLAGS_VAL)
 
 abac_prover.o: abac_prover.c
-	@gcc -g $(INCLUDES) -c abac_prover.c -o abac_prover.o
+	gcc -g $(MY_INCLUDES_VAL) -c abac_prover.c -o abac_prover.o
 
 abac_prover: abac_prover.o
-	@gcc -g -o abac_prover abac_prover.o $(LDFLAGS)
+	gcc -g -o abac_prover abac_prover.o $(MY_LDFLAGS_VAL)
 
 tchunk: tchunk.c
-	gcc -g $(INCLUDES) -c tchunk.c -o tchunk.o
-	gcc -g -o tchunk tchunk.o $(LDFLAGS)
+	gcc -g $(MY_INCLUDES_VAL) -c tchunk.c -o tchunk.o
+	gcc -g -o tchunk tchunk.o $(MY_LDFLAGS_VAL)
 	./tchunk 0 IceCream_ID.pem IceCream_private.pem
 	./tchunk 1 IceCream_ID.pem IceCream_private.pem
 
 tt: tbasic.c
-	gcc -g $(INCLUDES) -c tbasic.c -o tbasic.o
-	gcc -g -o tt tbasic.o $(LDFLAGS)
+	gcc -g $(MY_INCLUDES_VAL) -c tbasic.c -o tbasic.o
+	gcc -g -o tt tbasic.o $(MY_LDFLAGS_VAL)
 	./tt
 
@@ -47,8 +40,8 @@
 
 attr: 
-	@echo '---running (c) attr script'
-	@$(MY_ENV) ./setup.sh 1>/dev/null 2>&1
-	@make abac_attr
-	@(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"` ; \
+	echo '---running (c) attr script'
+	$(MY_ENV) ./setup.sh 1>/dev/null 2>&1
+	make abac_attr
+	(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"` ; \
 	if [ -z "$$rc" ]; then \
 	  echo "BAD:example_scripts/c/abac_attr:using libabac c to make attributes"; \
@@ -73,5 +66,5 @@
 
 mattr: attr.c
-	gcc -g -o mattr attr.c $(LDFLAGS)
+	gcc -g -o mattr attr.c $(MY_LDFLAGS_VAL)
 mload: loader.c
-	gcc -g -o mload loader.c $(LDFLAGS)
+	gcc -g -o mload loader.c $(MY_LDFLAGS_VAL)
Index: tests/example_scripts/perl/Makefile.am
===================================================================
--- tests/example_scripts/perl/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/perl/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,13 +3,7 @@
 #
 
+include  ${TESTDIR}/abac.mk
+
 .PHONY: clean-local
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-PERL_ENV = PERLLIB=$(abs_top_builddir)/swig/perl:$(abs_top_builddir)/swig/perl/.libs
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV) $(PERL_ENV)
 
 all: run bad prove
Index: tests/example_scripts/python/Makefile.am
===================================================================
--- tests/example_scripts/python/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/python/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,14 +3,7 @@
 #
 
+include  ${TESTDIR}/abac.mk
+
 .PHONY: clean-local
-
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-PYTHON_ENV = PYTHONPATH=$(abs_top_builddir)/swig/python:$(abs_top_builddir)/swig/python/.libs:$(abs_top_builddir)/tests
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(PYTHON_ENV) $(TEST_ENV)
 
 all: run_attr run_id run_id2 run_id3 run_prove
Index: tests/example_scripts/wiki/Makefile.am
===================================================================
--- tests/example_scripts/wiki/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/wiki/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,14 +3,7 @@
 #
 
+include  ${TESTDIR}/abac.mk
+
 .PHONY: runcheck clean-local
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-PYTHON_ENV = PYTHONPATH=$(abs_top_builddir)/swig/python:$(abs_top_builddir)/swig/python/.libs:$(abs_top_builddir)/tests
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(PYTHON_ENV) $(TEST_ENV)
-
 
 TESTS=id1 id2 id3 id4 id5 attr1 attr2 attr3 attr4 ctxtQuery1 ctxtQuery2 ctxtQuery3 ctxtQuery4
