util: Update makefiles for junit testing

- Have clean remove junit.xml files.
- Remove junit.xml target from cbmem makefile - this is in the top
level Makefile.inc now.
- add distclean targets to makefiles.
- Make sure all makefiles have .PHONY set up.
- rm commands need -f or they will fail if the file they're trying
to remove doesn't exist, causing the build to fail.

Change-Id: I2f0635f2c0a9417e3377a90c8d67103323c4a72f
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: http://review.coreboot.org/12120
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
diff --git a/util/cbmem/Makefile b/util/cbmem/Makefile
index 91bb045..41079b01 100644
--- a/util/cbmem/Makefile
+++ b/util/cbmem/Makefile
@@ -31,7 +31,7 @@
 $(PROGRAM): $(OBJS)
 
 clean:
-	rm -f $(PROGRAM) *.o *~
+	rm -f $(PROGRAM) *.o *~ junit.xml
 
 distclean: clean
 	rm -f .dependencies
@@ -43,20 +43,3 @@
 
 -include .dependencies
 
-junit.xml:
-	echo '<?xml version="1.0" encoding="utf-8"?><testsuite>' > $@.tmp
-	$(MAKE) clean; \
-	echo "<testcase classname='cbmem' name='cbmem'>" >> $@.tmp; \
-	$(MAKE) >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \
-	if [ $$type = "failure" ]; then \
-		echo "<failure type='buildFailed'>" >> $@.tmp; \
-	else \
-		echo "<$$type>" >> $@.tmp; \
-	fi; \
-	echo '<![CDATA[' >> $@.tmp; \
-	cat $@.tmp.2 >> $@.tmp; \
-	echo "]]></$$type>" >>$@.tmp; \
-	rm -f $@.tmp.2; \
-	echo "</testcase>" >> $@.tmp; \
-	echo "</testsuite>" >> $@.tmp
-	mv $@.tmp $@