MCPcopy
hub / github.com/perkeep/perkeep / main

Function main

make.go:65–189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63)
64
65func 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 {

Callers

nothing calls this directly

Calls 15

failIfCamlistoreOrgDirFunction · 0.85
verifyGoModulesFunction · 0.85
verifyGoVersionFunction · 0.85
verifyPerkeepRootFunction · 0.85
getGitVersionFunction · 0.85
actualBinDirFunction · 0.85
goEnvFunction · 0.85
ParseMethod · 0.80
PrintfMethod · 0.80
FatalMethod · 0.80
getVersionFunction · 0.70
FatalfMethod · 0.65

Tested by

no test coverage detected