-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathBUILD
152 lines (134 loc) · 3 KB
/
BUILD
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load(
"@rules_haskell//haskell:defs.bzl",
"haskell_binary",
"haskell_toolchain_library",
)
load(
"@io_tweag_clodl//clodl:clodl.bzl",
"binary_closure",
"library_closure",
)
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "bootstrap-bz",
srcs = ["src/main/cc/bootstrap.c"],
copts = ["-std=c99"],
deps = [
"@openjdk//:include",
"@rules_haskell_ghc_nixpkgs//:include",
],
)
cc_binary(
name = "libbootstrap.so",
linkshared = 1,
deps = ["bootstrap-bz"],
)
java_library(
name = "base-jar",
srcs = glob(["src/main/java/**/*.java"]),
)
haskell_toolchain_library(name = "base")
haskell_binary(
name = "hello-hs",
testonly = True,
srcs = ["src/test/haskell/hello/Main.hs"],
compiler_flags = [
"-threaded",
"-pie",
"-optl-Wl,--dynamic-list=main-symbol-list.ld",
],
extra_srcs = ["main-symbol-list.ld"],
linkstatic = False,
src_strip_prefix = "src/test/haskell/hello",
deps = [":base"],
)
library_closure(
name = "clotest",
testonly = True,
srcs = [
"hello-hs",
"libbootstrap.so",
],
excludes = [
"ld-linux-x86-64\\.so.*",
"libgcc_s\\.so.*",
"libc\\.so.*",
"libdl\\.so.*",
"libm\\.so.*",
"libpthread\\.so.*",
],
)
binary_closure(
name = "clotestbin",
testonly = True,
src = "hello-hs",
excludes = [
"ld-linux-x86-64\\.so.*",
"libgcc_s\\.so.*",
"libc\\.so.*",
"libdl\\.so.*",
"libm\\.so.*",
"libpthread\\.so.*",
],
)
java_binary(
name = "hello-java",
testonly = True,
classpath_resources = [":clotest"],
main_class = "io.tweag.jarify.JarifyMain",
runtime_deps = [":base-jar"],
)
cc_library(
name = "lib-cc",
testonly = True,
srcs = ["src/test/cc/hello/lib.c"],
)
cc_binary(
name = "libhello-cc.so",
testonly = True,
srcs = ["src/test/cc/hello/main.c"],
linkshared = 1,
deps = ["lib-cc"],
)
binary_closure(
name = "clotestbin-cc",
testonly = True,
src = "libhello-cc.so",
)
cc_binary(
name = "libhello-cc-norunfiles.so",
testonly = True,
srcs = ["src/test/cc/hello/main.c"],
linkshared = 1,
)
binary_closure(
name = "clotestbin-cc-norunfiles",
testonly = True,
src = "libhello-cc-norunfiles.so",
)
cc_binary(
name = "hello-cc-pie",
testonly = True,
srcs = ["src/test/cc/hello/main.c"],
linkopts = [
"-pie",
"-Wl,--dynamic-list=main-symbol-list.ld",
],
deps = ["main-symbol-list.ld"],
)
binary_closure(
name = "clotestbin-cc-pie",
testonly = True,
src = "hello-cc-pie",
)
sh_binary(
name = "deps",
srcs = ["src/main/bash/deps.sh"],
)
buildifier(
name = "buildifier",
lint_mode = "warn",
)