[build] introduce a common target for core

To date we've been building the world of binaries that roughly work
and supplying them in core. This change introduces a "common" target
that is intended to be useful for exploration of the system, but not
so "full-featured" as to encourage the writing of target side shell
scripts. In addition, various commands are excluded from common that
are otherwise already present a shell builtins, as the shell builtins
are always availalbe, whereas most shell commands are ephemeral.

Bug: 50791
Change-Id: I7302dd58b342f79123967a74393334526f769bb8
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/sbase/+/383536
Reviewed-by: Adam Barth <abarth@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 611c9e5..1546bae 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -24,6 +24,35 @@
 # "time",
 # "uname",
 
+# The common binaries are the ones included in many product builds by
+# default.
+common_binaries = [
+  "basename",
+  "cat",
+  "cmp",
+  "cut",
+  "date",
+  "dirname",
+  "du",
+  "env",
+  "expr",
+  "find",
+  "grep",
+  "head",
+  "hostname",
+  "printf",
+  "seq",
+  "sleep",
+  "sort",
+  "tail",
+  "tee",
+  "touch",
+  "tr",
+  "uniq",
+  "wc",
+  "which",
+]
+
 sbase_binaries = [
   "basename",
   "cal",
@@ -145,3 +174,17 @@
     ]
   }
 }
+
+group("sbase") {
+  deps = []
+  foreach(pkg, sbase_binaries) {
+    deps += [ ":" + pkg ]
+  }
+}
+
+group("common") {
+  deps = []
+  foreach(pkg, common_binaries) {
+    deps += [ ":" + pkg ]
+  }
+}