Implementation of CgptManager C++ library and unit tests.

CgptManager exposes the cgpt commands via a C++ library so that
the post-installer for 32- to 64-bit upgrade can link directly
against a library and thus avoid any shell dependency.

The default make target will not build libcgpt-cc.a since it
requires some dependencies that are available only in chroot.
A separate follow-up checkin to the vboot_reference
ebuild will enable emerging the libcgpt-cc.a by default.

BUG=chromium-os:25374
TEST=Tested with the new unit tests for CgptManager,
     ran existing cgpt unit tests,  as well as running the
     cgpt commands manually. Built on both amd64 and x86.
     Tested that vboot_reference is also buildable outside of chroot.
     Tested that vboot_reference-firmware and vboot_reference-tests
     also build fine with these changes.
CQ-DEPEND=I99f6c321e09c2425eaa8171d78685d2d731954c8
Change-Id: I59a896255b8ea2fc8b1b2150ae7c4ff9d0769699
Reviewed-on: https://gerrit.chromium.org/gerrit/15730
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
diff --git a/Makefile b/Makefile
index d939768..9b4e162 100644
--- a/Makefile
+++ b/Makefile
@@ -105,6 +105,10 @@
 		make -C $$i; \
 	done
 
+libcgpt_cc: all
+	$(MAKE) -C cgpt libcgpt_cc
+	$(MAKE) -C tests CgptManagerTests
+
 clean:
 	/bin/rm -rf ${BUILD}
 
@@ -115,6 +119,9 @@
 runtests:
 	$(MAKE) -C tests runtests
 
+runcgptmanagertests:
+	$(MAKE) -C tests runcgptmanagertests
+
 rbtest:
 	$(MAKE) -C tests rbtest