Add crossgcc target to automatically build reference toolchain

This means that a simple:

$ make crossgcc

creates the reference toolchain in the correct directory. Thanks to the
dependency on the clean-for-update target, an existing .xcompile along
with any compiled objects in build/ will be cleaned out, so the next
build will automatically use the newly created reference toolchain.

Signed-off-by: Cristian Magherusan-Stanciu <>
Acked-by: Peter Stuge <>

git-svn-id: svn:// 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/Makefile b/Makefile
index ac7115d..69e32a4 100644
--- a/Makefile
+++ b/Makefile
@@ -242,6 +242,12 @@
 	cscope -bR
+crossgcc: clean-for-update
+	$(MAKE) -C util/crossgcc build
+crossgcc-clean: clean-for-update
+	$(MAKE) -C util/crossgcc clean
 doxy: doxygen
 	$(DOXYGEN) documentation/Doxyfile.coreboot
diff --git a/util/crossgcc/Makefile b/util/crossgcc/Makefile
new file mode 100644
index 0000000..6aa07d6
--- /dev/null
+++ b/util/crossgcc/Makefile
@@ -0,0 +1,9 @@
+all: build
+	./buildgcc
+	rm -rf xgcc
+.PHONY: all build clean