unix: allow overriding GOOS using GOOS_TARGET in mksyscall.go

The syscall wrapper generator utility is platform independent and can in
principle be run on a GOOS other than the one we're generating the
syscall wrappers for. Allow overriding GOOS by setting GOOS_TARGET,
similar to other generator programs in the repo.

Also remove the unused GOARCH_TARGET override in the same file.

Change-Id: I91459113af9f662f12a99b99c581c7f2615cb394
Reviewed-on: https://go-review.googlesource.com/c/sys/+/256278
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/unix/mksyscall.go b/unix/mksyscall.go
index f667842..a8d73bb 100644
--- a/unix/mksyscall.go
+++ b/unix/mksyscall.go
@@ -86,16 +86,14 @@
 }
 
 func main() {
-	// Get the OS and architecture (using GOARCH_TARGET if it exists)
-	goos := os.Getenv("GOOS")
+	goos := os.Getenv("GOOS_TARGET")
+	if goos == "" {
+		goos = os.Getenv("GOOS")
+	}
 	if goos == "" {
 		fmt.Fprintln(os.Stderr, "GOOS not defined in environment")
 		os.Exit(1)
 	}
-	goarch := os.Getenv("GOARCH_TARGET")
-	if goarch == "" {
-		goarch = os.Getenv("GOARCH")
-	}
 
 	// Check that we are using the Docker-based build system if we should
 	if goos == "linux" {