aboutsummaryrefslogtreecommitdiffstats
path: root/sys/fuchsia
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2025-04-02 05:12:30 -0700
committerDmitry Vyukov <dvyukov@google.com>2025-04-02 15:19:47 +0000
commit671f31019d4018554d672c78ff08172d2a3ad71e (patch)
tree44e188122c5b9c3259b98ef64269ee6d27f61b28 /sys/fuchsia
parentd539c2ec8ff6d9dae25b81fb1408b67877303827 (diff)
Makefile: simplify Go generation
Make fidlgen non special and run go generate for all packages. This will avoid stale go:generate commands, and missed packages (like we had for pkg/ifuzz/{x86,arm64} for years).
Diffstat (limited to 'sys/fuchsia')
-rw-r--r--sys/fuchsia/fidlgen/main.go15
-rw-r--r--sys/fuchsia/init.go3
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/fuchsia/fidlgen/main.go b/sys/fuchsia/fidlgen/main.go
index 937ef62d1..ab2bcf0cd 100644
--- a/sys/fuchsia/fidlgen/main.go
+++ b/sys/fuchsia/fidlgen/main.go
@@ -19,17 +19,20 @@ import (
)
func main() {
+ targetOS := os.Getenv("TARGETOS")
targetArch := os.Getenv("TARGETARCH")
- target := targets.Get(targets.Fuchsia, targetArch)
- if target == nil {
- tool.Failf("unknown TARGETARCH %s", targetArch)
- }
- arch := target.KernelHeaderArch
-
sourceDir := os.Getenv("SOURCEDIR")
+ if targetOS != targets.Fuchsia || sourceDir == "" {
+ return
+ }
if !osutil.IsExist(sourceDir) {
tool.Failf("cannot find SOURCEDIR %s", sourceDir)
}
+ target := targets.Get(targetOS, targetArch)
+ if target == nil {
+ tool.Failf("unknown TARGETARCH %s", targetArch)
+ }
+ arch := target.KernelHeaderArch
fidlgenPath := filepath.Join(
sourceDir,
diff --git a/sys/fuchsia/init.go b/sys/fuchsia/init.go
index 2fbbd4bdf..c3ca8ca9b 100644
--- a/sys/fuchsia/init.go
+++ b/sys/fuchsia/init.go
@@ -1,7 +1,8 @@
// Copyright 2017 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-//go:generate go run fidlgen/main.go
+//go:generate bash -c "TARGETARCH=amd64 go run fidlgen/main.go"
+//go:generate bash -c "TARGETARCH=arm64 go run fidlgen/main.go"
package fuchsia