make: only build binaries and their dependencies.

New behavior for -targets:
- Empty only builds default binaries for this requested platform.
- * builds binaries and recursively builds pkg/..., server/..., and
    third_party/... (old empty behavior).
- Or specify the packages you want to build separated by commas.

This should fix the failing build on FreeBSD.

Change-Id: I3e19fd26b7fa5526bb2139487f25a07fa01952c4
This commit is contained in:
Bill Thiede 2014-02-19 20:56:05 -08:00
parent 513a45eb06
commit a68ee60ec0
1 changed files with 7 additions and 2 deletions

View File

@ -53,7 +53,7 @@ var (
all = flag.Bool("all", false, "Force rebuild of everything (go install -a)")
race = flag.Bool("race", false, "Build race-detector version of binaries (they will run slowly)")
verbose = flag.Bool("v", false, "Verbose mode")
targets = flag.String("targets", "", "Optional comma-separated list of targets (i.e go packages) to build and install. Empty means all. Example: camlistore.org/server/camlistored,camlistore.org/cmd/camput")
targets = flag.String("targets", "", "Optional comma-separated list of targets (i.e go packages) to build and install. '*' builds everything. Empty builds defaults for this platform. Example: camlistore.org/server/camlistored,camlistore.org/cmd/camput")
quiet = flag.Bool("quiet", false, "Don't print anything unless there's a failure.")
onlysync = flag.Bool("onlysync", false, "Only populate the temporary source/build tree and output its full path. It is meant to prepare the environment for running the full test suite with 'devcam test'.")
// TODO(mpl): looks like ifModsSince is not used anywhere?
@ -169,7 +169,12 @@ func main() {
"camlistore.org/cmd/camtool",
"camlistore.org/server/camlistored",
}
if *targets != "" {
switch *targets {
case "*":
buildAll = true
case "":
buildAll = false
default:
if t := strings.Split(*targets, ","); len(t) != 0 {
targs = t
buildAll = false