From a68ee60ec0aa7b2a3d6bed960c96b421cb86d4c1 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Wed, 19 Feb 2014 20:56:05 -0800 Subject: [PATCH] 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 --- make.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/make.go b/make.go index c50f4009a..d755c7f55 100644 --- a/make.go +++ b/make.go @@ -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