-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.wren
70 lines (49 loc) · 1.33 KB
/
build.wren
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// install dependencies
Deps.git_inherit("https://github.com/inobulles/umber")
Deps.git_inherit("https://github.com/inobulles/iar")
// options
var aqua_data_path = "%(Meta.prefix())/share/aqua"
var default_devices_path = "%(aqua_data_path)/devices"
var default_root_path = "~/.aqua"
var default_boot_path = "%(default_root_path)/boot.zpk"
// C compilation
var cc = CC.new()
cc.add_opt("-std=c99")
cc.add_opt("-g")
cc.add_opt("-I/usr/local/include")
cc.add_opt("-L/usr/local/lib")
cc.add_opt("-Wall")
cc.add_opt("-Wextra")
cc.add_opt("-Werror")
cc.add_opt("-Wno-unused-command-line-argument")
cc.add_opt("-DKOS_DEFAULT_DEVICES_PATH=\"%(default_devices_path)\"")
cc.add_opt("-DKOS_DEFAULT_ROOT_PATH=\"%(default_root_path)\"")
cc.add_opt("-DKOS_DEFAULT_BOOT_PATH=\"%(default_boot_path)\"")
if (Meta.os().contains("WSL")) {
cc.add_opt("-D__WSL__")
}
var src = File.list("src")
.where { |path| path.endsWith(".c") }
src
.each { |path| cc.compile(path) }
// linking
var libs = ["iar", "umber"]
if (Meta.os().contains("FreeBSD") || Meta.os().contains("aquaBSD")) {
libs.add("stdthreads")
}
var linker = Linker.new()
linker.link(src.toList, libs, "kos")
// running
class Runner {
static run(args) {
return File.exec("kos", args)
}
}
// installation map
var install = {
"kos": "bin/aqua",
}
// TODO testing
class Tests {
}
var tests = []