From c935e8a14296be251b574c05f7df2f4b232bf987 Mon Sep 17 00:00:00 2001 From: Anton Carver Date: Mon, 22 Jun 2015 17:25:47 +0100 Subject: Fix dependencies. Remove some confusing target names. Change-Id: Id429017d9bd47bfea4e1c50754df256168ea862d --- build/cpp/make_cpp.go | 12 +++++++----- make.go | 11 +++++++---- maker/go.go | 1 + 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/build/cpp/make_cpp.go b/build/cpp/make_cpp.go index 824c93b4b..75721ec3d 100644 --- a/build/cpp/make_cpp.go +++ b/build/cpp/make_cpp.go @@ -49,7 +49,9 @@ func makeStep(name string, output build.File, source build.FileSet, always bool, if always { s.AlwaysRun() } - maker.List(name).DependsOn(e) + if name != "" { + maker.List("cc:" + name).DependsOn(e) + } maker.List("cc").DependsOn(e) return s } @@ -82,7 +84,7 @@ func MakeCompile(sources build.FileSet, cfg Config, env build.Environment) build // skip any objects which have existing build steps continue } - s := makeStep(cfg.Name, object, build.Files(source), env.ForceBuild, + s := makeStep("", object, build.Files(source), env.ForceBuild, func(*maker.Step) error { env.Logger = env.Logger.Enter(object.Name()) env.Logger.Enter("C++.Compile") @@ -118,7 +120,7 @@ func MakeStaticLibrary(inputs build.FileSet, cfg Config, env build.Environment) output = output.ChangeExt(*cfg.OutputExt) } - makeStep(cfg.Name, output, objects, env.ForceBuild, + makeStep("", output, objects, env.ForceBuild, func(*maker.Step) error { env.Logger = logger(env, cfg.Name).Enter("C++.StaticLibrary") return cfg.Toolchain.Archiver(objects, output, cfg, env) @@ -196,9 +198,9 @@ func MakeExecutable(inputs build.FileSet, cfg Config, env build.Environment) bui func MakeRunTest(test build.File, cfg Config) { // We only run tests on the host OS. if cfg.OS == maker.HostOS { - phony := maker.Virtual("") + phony := maker.Virtual("cc:" + test.Name() + ":run") maker.Command(makeEntity(test)).Creates(phony) - maker.List("test").DependsOn(phony) + maker.List("cc_test").DependsOn(phony) } } diff --git a/make.go b/make.go index 9cab09360..da67231b9 100644 --- a/make.go +++ b/make.go @@ -111,7 +111,7 @@ func init() { // List("code").DependsOn("embed", "rpcapi", "apic", "codergen") // The native code rules - Apps.Gapir = Virtual("gapir") + Apps.Gapir = Virtual("cc:replayd") cctargets := []string{*targetOS} if os.Getenv("ANDROID_NDK_ROOT") != "" { cctargets = append(cctargets, []string{"android-arm", "android-arm64"}...) @@ -119,8 +119,11 @@ func init() { cc.Graph(cctargets) // The testing rules gotest := GoTest(GPURoot + "/...") - Creator(gotest).DependsOn("code", Apps.Gapir) - List("test").DependsOn(gotest) + // Runtime dependencies + Creator(Tools.Gapit).DependsOn("cc:spy") + List("runtime").DependsOn(Apps.Gapir, "cc:spy") + Creator(gotest).DependsOn("code", "runtime") + List("test").DependsOn("go_test", "cc_test") // The main binary rules Apps.Gapis = GoInstall(GPURoot + "/server/gapis") Creator(Apps.Gapis).DependsOn("code") @@ -129,7 +132,7 @@ func init() { List("apps").DependsStruct(Apps) // Application launchers Command(Apps.Gapis).Creates(Virtual("gapis")).DependsOn(Apps.Gapir) - Command(Apps.Gapid, "--gxuidebug").Creates(Virtual("gapid")).DependsOn(Apps.Gapis, Apps.Gapir) + Command(Apps.Gapid, "--gxuidebug").Creates(Virtual("gapid")).DependsOn(Apps.Gapis, "runtime") // Utilties GoRun(Path(gpusrc, "tools/clean_generated/main.go"), gpusrc).Creates(Virtual("clean_gpu")) GoRun(Path(gpusrc, "tools/copyright/copyright/main.go"), "-o", gpusrc).Creates(Virtual("copyright")).DependsOn(embedCopyright) diff --git a/maker/go.go b/maker/go.go index 54c8dbf35..90053db74 100644 --- a/maker/go.go +++ b/maker/go.go @@ -39,6 +39,7 @@ func GoInstall(module string) Entity { func GoTest(module string) Entity { test := Virtual("") GoCommand("test", module).Creates(test) + List("go_test").DependsOn(test) return test } -- cgit v1.2.3