()
| 63 | ) |
| 64 | |
| 65 | func main() { |
| 66 | log.SetFlags(0) |
| 67 | flag.Parse() |
| 68 | |
| 69 | if *buildARCH == "386" && *buildOS == "darwin" { |
| 70 | if ok, _ := strconv.ParseBool(os.Getenv("CAMLI_FORCE_OSARCH")); !ok { |
| 71 | log.Fatalf("You're trying to build a 32-bit binary for a Mac. That is almost always a mistake.\nTo do it anyway, set env CAMLI_FORCE_OSARCH=1 and run again.\n") |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | failIfCamlistoreOrgDir() |
| 76 | verifyGoModules() |
| 77 | verifyGoVersion() |
| 78 | verifyPerkeepRoot() |
| 79 | version := getVersion() |
| 80 | gitRev := getGitVersion() |
| 81 | |
| 82 | if *verbose { |
| 83 | log.Printf("Perkeep version = %q, git = %q", version, gitRev) |
| 84 | log.Printf("Project source: %s", pkRoot) |
| 85 | log.Printf("Output binaries: %s", actualBinDir()) |
| 86 | } |
| 87 | |
| 88 | buildAll := false |
| 89 | targs := []string{ |
| 90 | "perkeep.org/dev/devcam", |
| 91 | "perkeep.org/cmd/pk-get", |
| 92 | "perkeep.org/cmd/pk-put", |
| 93 | "perkeep.org/cmd/pk", |
| 94 | "perkeep.org/server/perkeepd", |
| 95 | "perkeep.org/app/hello", |
| 96 | "perkeep.org/app/scanningcabinet", |
| 97 | "perkeep.org/app/scanningcabinet/scancab", |
| 98 | } |
| 99 | switch *targets { |
| 100 | case "*": |
| 101 | buildAll = true |
| 102 | case "": |
| 103 | // Add pk-mount to default build targets on OSes that support FUSE. |
| 104 | switch *buildOS { |
| 105 | case "linux": |
| 106 | targs = append(targs, "perkeep.org/cmd/pk-mount") |
| 107 | } |
| 108 | default: |
| 109 | if *website { |
| 110 | log.Fatal("--targets and --website are mutually exclusive") |
| 111 | } |
| 112 | if t := strings.Split(*targets, ","); len(t) != 0 { |
| 113 | targs = t |
| 114 | } |
| 115 | } |
| 116 | if *website { |
| 117 | buildAll = false |
| 118 | targs = []string{"perkeep.org/website/pk-web"} |
| 119 | } |
| 120 | |
| 121 | tags := []string{"purego"} // for cznic/zappy |
| 122 | if *static { |
nothing calls this directly
no test coverage detected