1package(
2    default_visibility = ["//visibility:public"],
3)
4
5cc_library(
6    name = "liblua_headers",
7    hdrs = [
8        "src/lauxlib.h",
9        "src/lua.h",
10        "src/lua.hpp",
11        "src/luaconf.h",
12        "src/lualib.h",
13    ],
14    defines = ["LUA_USE_LINUX"],
15    includes = ["src"],
16)
17
18cc_library(
19    name = "liblua",
20    srcs = [
21        "src/lapi.c",
22        "src/lapi.h",
23        "src/lauxlib.c",
24        "src/lauxlib.h",
25        "src/lbaselib.c",
26        "src/lbitlib.c",
27        "src/lcode.c",
28        "src/lcode.h",
29        "src/lcorolib.c",
30        "src/lctype.c",
31        "src/lctype.h",
32        "src/ldblib.c",
33        "src/ldebug.c",
34        "src/ldebug.h",
35        "src/ldo.c",
36        "src/ldo.h",
37        "src/ldump.c",
38        "src/lfunc.c",
39        "src/lfunc.h",
40        "src/lgc.c",
41        "src/lgc.h",
42        "src/linit.c",
43        "src/liolib.c",
44        "src/llex.c",
45        "src/llex.h",
46        "src/llimits.h",
47        "src/lmathlib.c",
48        "src/lmem.c",
49        "src/lmem.h",
50        "src/loadlib.c",
51        "src/lobject.c",
52        "src/lobject.h",
53        "src/lopcodes.c",
54        "src/lopcodes.h",
55        "src/loslib.c",
56        "src/lparser.c",
57        "src/lparser.h",
58        "src/lstate.c",
59        "src/lstate.h",
60        "src/lstring.c",
61        "src/lstring.h",
62        "src/lstrlib.c",
63        "src/ltable.c",
64        "src/ltable.h",
65        "src/ltablib.c",
66        "src/ltm.c",
67        "src/ltm.h",
68        "src/lundump.c",
69        "src/lundump.h",
70        "src/lvm.c",
71        "src/lvm.h",
72        "src/lzio.c",
73        "src/lzio.h",
74    ],
75    hdrs = [
76        "src/lauxlib.h",
77        "src/lua.h",
78        "src/lua.hpp",
79        "src/luaconf.h",
80        "src/lualib.h",
81    ],
82    defines = ["LUA_USE_LINUX"],
83    includes = ["src"],
84    linkopts = [
85        "-lm",
86        "-ldl",
87    ],
88)
89
90cc_binary(
91    name = "lua",
92    srcs = [
93        "src/lua.c",
94    ],
95    linkopts = [
96        "-lreadline",
97        "-rdynamic",
98    ],
99    deps = [
100        ":liblua",
101    ],
102)
103