-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.go
47 lines (43 loc) · 858 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// 24 september 2014
package main
import (
"fmt"
"os"
"flag"
"path/filepath"
"strings"
)
func fail(format string, args ...interface{}) {
fmt.Fprintf(os.Stderr, "[FAIL] ")
fmt.Fprintf(os.Stderr, format, args...)
fmt.Fprintf(os.Stderr, "\n")
os.Exit(1)
}
func main() {
flag.Parse()
if *selectedToolchain == "list" {
listToolchains()
os.Exit(0)
}
if *targetOS == "list" {
fmt.Printf("%s\n", strings.Join(supportedOSs, "\n"))
os.Exit(0)
}
if *targetArch == "list" {
fmt.Printf("%s\n", strings.Join(supportedArchs, "\n"))
os.Exit(0)
}
computeExcludeSuffixes()
err := filepath.Walk(".", walker)
if err != nil {
fail("Error collecting files: %v", err)
}
compileFlags()
buildScript()
err = os.MkdirAll(".qoobj", 0755)
if err != nil {
fail("Error making work directory .qoobj: %v", err)
}
run()
os.Exit(0) // success
}