Work on linux version
This commit is contained in:
1
luprex/.gitignore
vendored
1
luprex/.gitignore
vendored
@@ -9,6 +9,7 @@ core/main
|
|||||||
core/inc/**
|
core/inc/**
|
||||||
core/lib/**
|
core/lib/**
|
||||||
core/obj/**
|
core/obj/**
|
||||||
|
core/lobj/**
|
||||||
.vscode/**
|
.vscode/**
|
||||||
luajit/src/lj_bcdef.h
|
luajit/src/lj_bcdef.h
|
||||||
luajit/src/lj_ffdef.h
|
luajit/src/lj_ffdef.h
|
||||||
|
|||||||
@@ -3,54 +3,98 @@ OS=unspecified
|
|||||||
ifeq ($(OS),mingw)
|
ifeq ($(OS),mingw)
|
||||||
EXE=main.exe
|
EXE=main.exe
|
||||||
LIBS=-lws2_32
|
LIBS=-lws2_32
|
||||||
else
|
LUAFLAGS=-DLUA_USE_POSIX
|
||||||
|
else ifeq ($(OS),linux)
|
||||||
EXE=main
|
EXE=main
|
||||||
LIBS=
|
LIBS=
|
||||||
|
LUAFLAGS=-DLUA_USE_POSIX
|
||||||
|
else
|
||||||
|
$(error You must specify OS=linux or OS=mingw)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CXX=g++ -std=c++17 -Wall -g -Iinc -Icpp
|
LUA_OBJ_FILES=\
|
||||||
|
lobj/lapi.o \
|
||||||
|
lobj/lcode.o \
|
||||||
|
lobj/lctype.o \
|
||||||
|
lobj/ldebug.o \
|
||||||
|
lobj/ldo.o \
|
||||||
|
lobj/ldump.o \
|
||||||
|
lobj/lfunc.o \
|
||||||
|
lobj/lgc.o \
|
||||||
|
lobj/llex.o \
|
||||||
|
lobj/lmem.o \
|
||||||
|
lobj/lobject.o \
|
||||||
|
lobj/lopcodes.o \
|
||||||
|
lobj/lparser.o \
|
||||||
|
lobj/lstate.o \
|
||||||
|
lobj/lstring.o \
|
||||||
|
lobj/ltable.o \
|
||||||
|
lobj/ltm.o \
|
||||||
|
lobj/lundump.o \
|
||||||
|
lobj/lvm.o \
|
||||||
|
lobj/lzio.o \
|
||||||
|
lobj/lauxlib.o \
|
||||||
|
lobj/lbaselib.o \
|
||||||
|
lobj/lbitlib.o \
|
||||||
|
lobj/lcorolib.o \
|
||||||
|
lobj/ldblib.o \
|
||||||
|
lobj/liolib.o \
|
||||||
|
lobj/lmathlib.o \
|
||||||
|
lobj/loslib.o \
|
||||||
|
lobj/lstrlib.o \
|
||||||
|
lobj/ltablib.o \
|
||||||
|
lobj/loadlib.o \
|
||||||
|
lobj/linit.o \
|
||||||
|
lobj/eris.o \
|
||||||
|
|
||||||
CPP_FILES=\
|
|
||||||
cpp/invocation.cpp\
|
|
||||||
cpp/spookyv2.cpp\
|
|
||||||
cpp/debugcollector.cpp\
|
|
||||||
cpp/drivenengine.cpp\
|
|
||||||
cpp/util.cpp\
|
|
||||||
cpp/luastack.cpp\
|
|
||||||
cpp/traceback.cpp\
|
|
||||||
cpp/planemap.cpp\
|
|
||||||
cpp/pprint.cpp\
|
|
||||||
cpp/luaconsole.cpp\
|
|
||||||
cpp/idalloc.cpp\
|
|
||||||
cpp/globaldb.cpp\
|
|
||||||
cpp/sched.cpp\
|
|
||||||
cpp/table.cpp\
|
|
||||||
cpp/gui.cpp\
|
|
||||||
cpp/luasnap.cpp\
|
|
||||||
cpp/animqueue.cpp\
|
|
||||||
cpp/streambuffer.cpp\
|
|
||||||
cpp/source.cpp\
|
|
||||||
cpp/world-core.cpp\
|
|
||||||
cpp/world-accessor.cpp\
|
|
||||||
cpp/world-difftab.cpp\
|
|
||||||
cpp/world-diffxmit.cpp\
|
|
||||||
cpp/world-pairtab.cpp\
|
|
||||||
cpp/world-testing.cpp\
|
|
||||||
cpp/textgame.cpp\
|
|
||||||
cpp/lpxserver.cpp\
|
|
||||||
cpp/lpxclient.cpp\
|
|
||||||
cpp/drivertests.cpp\
|
|
||||||
cpp/printbuffer.cpp\
|
|
||||||
cpp/main.cpp \
|
|
||||||
cpp/driver-$(OS).cpp\
|
|
||||||
|
|
||||||
OBJ_FILES=$(patsubst cpp/%.cpp,obj/%.o,$(CPP_FILES))
|
CORE_OBJ_FILES=\
|
||||||
|
obj/invocation.o\
|
||||||
|
obj/spookyv2.o\
|
||||||
|
obj/debugcollector.o\
|
||||||
|
obj/drivenengine.o\
|
||||||
|
obj/util.o\
|
||||||
|
obj/luastack.o\
|
||||||
|
obj/traceback.o\
|
||||||
|
obj/planemap.o\
|
||||||
|
obj/pprint.o\
|
||||||
|
obj/luaconsole.o\
|
||||||
|
obj/idalloc.o\
|
||||||
|
obj/globaldb.o\
|
||||||
|
obj/sched.o\
|
||||||
|
obj/table.o\
|
||||||
|
obj/gui.o\
|
||||||
|
obj/luasnap.o\
|
||||||
|
obj/animqueue.o\
|
||||||
|
obj/streambuffer.o\
|
||||||
|
obj/source.o\
|
||||||
|
obj/world-core.o\
|
||||||
|
obj/world-accessor.o\
|
||||||
|
obj/world-difftab.o\
|
||||||
|
obj/world-diffxmit.o\
|
||||||
|
obj/world-pairtab.o\
|
||||||
|
obj/world-testing.o\
|
||||||
|
obj/textgame.o\
|
||||||
|
obj/lpxserver.o\
|
||||||
|
obj/lpxclient.o\
|
||||||
|
obj/drivertests.o\
|
||||||
|
obj/printbuffer.o\
|
||||||
|
obj/main.o \
|
||||||
|
obj/driver-$(OS).o\
|
||||||
|
|
||||||
|
|
||||||
|
lobj/%.o: ../eris-master/src/%.c
|
||||||
|
gcc -Wall -g -DLUA_USE_APICHECK $(LUAFLAGS) -c $< -o $@
|
||||||
|
|
||||||
obj/%.o: cpp/%.cpp
|
obj/%.o: cpp/%.cpp
|
||||||
$(CXX) -c -MMD $< -o $@
|
g++ -std=c++17 -Wall -g -Iinc -Icpp -c -MMD $< -o $@
|
||||||
|
|
||||||
$(EXE): $(OBJ_FILES)
|
|
||||||
$(CXX) -o $@ $(OBJ_FILES) $(LIBS) -Llib lib/liblua-dbg.a
|
|
||||||
|
|
||||||
|
|
||||||
-include $(OBJ_FILES:%.o=%.d)
|
$(EXE): $(CORE_OBJ_FILES) $(LUA_OBJ_FILES)
|
||||||
|
g++ -std=c++17 -Wall -g -o $@ $(CORE_OBJ_FILES) $(LUA_OBJ_FILES)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f main.exe main obj/* lobj/*
|
||||||
|
|
||||||
|
-include $(CORE_OBJ_FILES:%.o=%.d)
|
||||||
|
-include $(LUA_OBJ_FILES:%.o=%.d)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ void Channel::feed_readline(int nbytes, const char *bytes) {
|
|||||||
desired_command_ = "";
|
desired_command_ = "";
|
||||||
current_prompt_ = "";
|
current_prompt_ = "";
|
||||||
current_command_ = "";
|
current_command_ = "";
|
||||||
} else if (c == '\b') {
|
} else if ((c == '\b') || (c == 127)) {
|
||||||
int len = desired_command_.size();
|
int len = desired_command_.size();
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
desired_command_ = desired_command_.substr(0, len-1);
|
desired_command_ = desired_command_.substr(0, len-1);
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
cd src
|
|
||||||
|
|
||||||
make "CFLAGS=-g -DLUA_USE_APICHECK -DLUA_COMPAT_ALL" clean win-gcc-static
|
|
||||||
cp liblua.a ../../core/lib/liblua-dbg.a
|
|
||||||
|
|
||||||
make "CFLAGS=-O2 -DLUA_COMPAT_ALL" clean win-gcc-static
|
|
||||||
cp liblua.a ../../core/lib/liblua-opt.a
|
|
||||||
|
|
||||||
cp lua.h ../../core/inc/
|
|
||||||
cp luaconf.h ../../core/inc/
|
|
||||||
cp lauxlib.h ../../core/inc/
|
|
||||||
cp lualib.h ../../core/inc/
|
|
||||||
cp eris.h ../../core/inc/
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
cd src
|
|
||||||
|
|
||||||
make "CFLAGS=-g -DLUA_USE_APICHECK -DLUA_COMPAT_ALL" clean win-gcc-static
|
|
||||||
cp liblua.a ../../core/lib/liblua-dbg.a
|
|
||||||
|
|
||||||
make "CFLAGS=-O2 -DLUA_COMPAT_ALL" clean win-gcc-static
|
|
||||||
cp liblua.a ../../core/lib/liblua-opt.a
|
|
||||||
|
|
||||||
cp lua.h ../../core/inc/
|
|
||||||
cp luaconf.h ../../core/inc/
|
|
||||||
cp lauxlib.h ../../core/inc/
|
|
||||||
cp lualib.h ../../core/inc/
|
|
||||||
cp eris.h ../../core/inc/
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user