aboutsummaryrefslogtreecommitdiffstats
path: root/out
diff options
context:
space:
mode:
Diffstat (limited to 'out')
-rw-r--r--out/main.c13
-rw-r--r--out/makefile14
2 files changed, 15 insertions, 12 deletions
diff --git a/out/main.c b/out/main.c
index ea3c487..be01f97 100644
--- a/out/main.c
+++ b/out/main.c
@@ -1,10 +1,13 @@
+#include "../lua5/lauxlib.h"
+#include "../lua5/lua.h"
+#include "../lua5/lualib.h"
#include "./wasm_tables.h"
-#include <stdio.h>
#include <inttypes.h>
-#include "/home/bloodstalker/devi/hell2/bruiser/lua-5.3.4/src/lauxlib.h"
-#include "/home/bloodstalker/devi/hell2/bruiser/lua-5.3.4/src/lua.h"
-#include "/home/bloodstalker/devi/hell2/bruiser/lua-5.3.4/src/lualib.h"
+#include <stdio.h>
#pragma weak main
-int main (int argc, char** argv) {
+int main(int argc, char **argv) {
+ lua_State *ls = luaL_newstate();
+ luaL_openlibs(ls);
+ reg_tablegen_tables(ls);
}
diff --git a/out/makefile b/out/makefile
index f3a0757..86b90b3 100644
--- a/out/makefile
+++ b/out/makefile
@@ -8,7 +8,7 @@ CC_EXTRA?=
CTAGS_I_PATH?=./
LD_FLAGS=
LIB_LUA=../lua5/liblua.a
-EXTRA_LD_FLAGS?=-L ../lua5
+EXTRA_LD_FLAGS?=-lm -ldl -llua
ADD_SANITIZERS_CC= -g -fsanitize=address -fno-omit-frame-pointer
ADD_SANITIZERS_LD= -g -fsanitize=address
MEM_SANITIZERS_CC= -g -fsanitize=memory -fno-omit-frame-pointer
@@ -80,16 +80,16 @@ depend:.depend
$(LIB_LUA):
$(MAKE) -C ../lua5 a
-$(TARGET): $(TARGET).o $(LIB_LUA)
+$(TARGET): $(TARGET).o $(LIB_LUA) $(OBJ_LIST)
$(CC) $^ $(LD_FLAGS) -o $@
-$(TARGET)-static: $(TARGET).o $(LIB_LUA)
+$(TARGET)-static: $(TARGET).o $(LIB_LUA) $(OBJ_LIST)
$(CC) $^ $(LD_FLAGS) -static -o $@
-$(TARGET)-dbg: $(TARGET).odbg $(LIB_LUA)
+$(TARGET)-dbg: $(TARGET).odbg $(LIB_LUA) $(OBJ_LIST)
$(CC) $^ $(LD_FLAGS) -g -o $@
-$(TARGET)-cov: $(TARGET).ocov $(LIB_LUA)
+$(TARGET)-cov: $(TARGET).ocov $(LIB_LUA) $(OBJ_LIST)
$(CC) $^ $(LD_FLAGS) $(COV_LD) -o $@
cov:
@@ -116,10 +116,10 @@ tags:$(SRCS)
%.dis: %.o
objdump -r -d -M intel -S $< > $@
-$(TARGET).so: $(TARGET).o $(LIB_LUA)
+$(TARGET).so: $(TARGET).o $(LIB_LUA) $(OBJ_LIST)
$(CC) $^ $(LD_FLAGS) -shared -o $@
-$(TARGET).a: $(TARGET).o $(LIB_LUA)
+$(TARGET).a: $(TARGET).o $(LIB_LUA) $(OBJ_LIST)
ar rcs $(TARGET).a $(TARGET).o
runcov: $(TARGET)-cov