-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
38 lines (29 loc) · 931 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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