diff options
Diffstat (limited to 'lib/lua-term/Makefile')
| -rw-r--r-- | lib/lua-term/Makefile | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/lua-term/Makefile b/lib/lua-term/Makefile new file mode 100644 index 00000000..75a87f34 --- /dev/null +++ b/lib/lua-term/Makefile @@ -0,0 +1,38 @@ +#this file builds lua-term \o/ + +LUA_VER ?= 5.1 +LUA_DIR ?= /usr +LUA_LIBDIR := $(LUA_DIR)/lib/lua/$(LUA_VER)/term +LUA_INC := $(LUA_DIR)/include/lua$(LUA_VER) +LUA_SHARE := $(LUA_DIR)/share/lua/$(LUA_VER)/term +CWARNS := -Wall -pedantic +CFLAGS += $(CWARNS) -O3 -I$(LUA_INC) -fPIC +LIB_OPTION := -shared + +SONAME := core.so +SONAMEV := $(SONAME).1 +LIBRARY := $(SONAMEV).0.1 +SRC := core.c +OBJ := $(patsubst %.c, %.o, $(SRC)) + +FILES := term/init.lua term/cursor.lua term/colors.lua + +all: $(LIBRARY) $(SONAMEV) $(SONAME) + +$(SONAMEV): + ln -s $(LIBRARY) $@ + +$(SONAME): + ln -s $(SONAMEV) $@ + +$(LIBRARY): $(OBJ) + $(CC) $(CFLAGS) $(LIB_OPTION) -o $(LIBRARY) $(OBJ) -lc + +install: + mkdir -p $(LUA_LIBDIR) + cp $(SONAME) $(LUA_LIBDIR) + mkdir -p $(LUA_SHARE) + cp $(FILES) $(LUA_SHARE) + +clean: + $(RM) $(LIBRARY) $(SONAMEV) $(SONAME) *.o |
