-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ss
executable file
·50 lines (45 loc) · 1.3 KB
/
build.ss
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
48
49
50
#!/usr/bin/env gxi
;; -*- Gerbil -*-
(import :std/make)
(def cc-options
"-I/usr/local/include -I/usr/include")
(def ld-options
"-L/usr/local/lib -L/usr/lib -lpthread -lunicorn")
(def build-spec
`((gxc: "core"
"-cc-options" ,cc-options
"-ld-options" ,ld-options)
(gxc: "arm64"
"-cc-options" ,cc-options
"-ld-options" ,ld-options)
(gxc: "arm"
"-cc-options" ,cc-options
"-ld-options" ,ld-options)
(gxc: "x86"
"-cc-options" ,cc-options
"-ld-options" ,ld-options)
(gxc: "mips"
"-cc-options" ,cc-options
"-ld-options" ,ld-options)
(gxc: "sparc"
"-cc-options" ,cc-options
"-ld-options" ,ld-options)
(gxc: "m68k"
"-cc-options" ,cc-options
"-ld-options" ,ld-options)))
(def srcdir
(path-normalize (path-directory (this-source-file))))
(def (main . args)
(match args
(["deps"]
(let (build-deps (make-depgraph/spec build-spec))
(call-with-output-file "build-deps" (cut write build-deps <>))))
([]
(let (depgraph (call-with-input-file "build-deps" read))
(make srcdir: srcdir
debug: 'src
optimize: #f
static: #f
depgraph: depgraph
verbose: #t
build-spec)))))