aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..cdf3f67
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
1#this file builds lua-term \o/
2
3LUA_VER := 5.1
4LUA_DIR := /usr
5LUA_LIBDIR := $(LUA_DIR)/lib/lua/$(LUA_VER)/term
6LUA_INC := $(LUA_DIR)/include/lua$(LUA_VER)
7LUA_SHARE := $(LUA_DIR)/share/lua/$(LUA_VER)/term
8CWARNS := -Wall -pedantic
9CFLAGS := $(CWARNS) -ansi -O3 -I$(LUA_INC) -fPIC
10LIB_OPTION := -shared
11
12SONAME := core.so
13SONAMEV := $(SONAME).1
14LIBRARY := $(SONAMEV).0.1
15SRC := core.c
16OBJ := $(patsubst %.c, %.o, $(SRC))
17
18FILES := term/init.lua term/cursor.lua term/colors.lua
19
20all: $(LIBRARY) $(SONAMEV) $(SONAME)
21
22$(SONAMEV):
23 ln -s $(LIBRARY) $@
24
25$(SONAME):
26 ln -s $(SONAMEV) $@
27
28$(LIBRARY): $(OBJ)
29 $(CC) $(CFLAGS) $(LIB_OPTION) -o $(LIBRARY) $(OBJ) -lc
30
31install:
32 mkdir -p $(LUA_LIBDIR)
33 cp $(SONAME) $(LUA_LIBDIR)
34 mkdir -p $(LUA_SHARE)
35 cp $(FILES) $(LUA_SHARE)
36
37clean:
38 $(RM) $(LIBRARY) $(SONAMEV) $(SONAME) *.o
39