Add per-directory build targets

Build a map of blueprint directory to modules built from that
directory, and then add phony rules to build.ninja that emulate
the behavior of mma in the current build system.

Also fixes checkbuild to depend on checkbuild files and installable
files, but not installed files.

Change-Id: I8bad6e93387940df7439dbd4554f6d79f924c65f
diff --git a/common/util.go b/common/util.go
index 599b3b1..0a0ed13 100644
--- a/common/util.go
+++ b/common/util.go
@@ -14,6 +14,8 @@
 
 package common
 
+import "sort"
+
 func JoinWithPrefix(strs []string, prefix string) string {
 	if len(strs) == 0 {
 		return ""
@@ -65,3 +67,12 @@
 	}
 	return string(ret)
 }
+
+func sortedKeys(m map[string][]string) []string {
+	s := make([]string, 0, len(m))
+	for k := range m {
+		s = append(s, k)
+	}
+	sort.Strings(s)
+	return s
+}