Index: src/examples/Makefile.example
===================================================================
--- src/examples/Makefile.example	(revision ca2650989b8d7b480a285a0967ff5bcf23fa1f74)
+++ src/examples/Makefile.example	(revision ca2650989b8d7b480a285a0967ff5bcf23fa1f74)
@@ -0,0 +1,42 @@
+CFA ?= ../driver/cfa-cpp
+CFAOPT ?= -a
+OUTPUT ?= Output
+EXPECT ?= Expect
+OUTPUTDIR ?= ${OUTPUT}${CFAOPT}
+EXPECTDIR ?= ${EXPECT}${CFAOPT}
+EXAMPLES = ${wildcard *.c}
+OUTPUTS = ${addprefix ${OUTPUTDIR}/,${EXAMPLES:.c=.txt}}
+
+#.SILENT :
+
+all :
+	+for opt in -a -e -f -r -s -v ; do \
+	    make test CFAOPT=$${opt} ; \
+	done ; \
+	rm -f core
+
+test : ${OUTPUTS} ${OUTPUTDIR}/report
+
+${OUTPUTDIR}/%.txt : %.c ${CFA} Makefile
+	-${CFA} -n ${CFAOPT} $< > $@ 2>&1
+
+${OUTPUTDIR}/report : ${OUTPUTS} ${EXPECTDIR}
+	rm -f $@
+	echo "===== regression test using cfa-cpp flag ${CFAOPT} ====="
+	@for i in ${OUTPUTS} ; do \
+	     echo "---"`basename $$i`"---" | tee -a $@; \
+	     diff -B -w ${EXPECTDIR}/`basename $$i` $$i | tee -a $@; \
+	done
+
+${OUTPUTS} : | ${OUTPUTDIR}		# order only prerequisite
+
+${OUTPUTDIR} :
+	mkdir -p $@
+
+# remove the expected results directories to generate new ones from the current output
+
+${EXPECTDIR} : | ${OUTPUTS}		# new Expected results ?
+	cp -pr ${OUTPUTDIR} $@
+
+clean :
+	rm -rf ${OUTPUT}-* core
