diff options
author | Rob Hoelz <rob@hoelz.ro> | 2014-04-15 17:00:38 -0500 |
---|---|---|
committer | Rob Hoelz <rob@hoelz.ro> | 2014-04-15 17:00:38 -0500 |
commit | 1ba9a8eb70bfccf1ce5f8fe78c02be46692ee9d8 (patch) | |
tree | e9b9601c46c2a7013a5f13b9ddb0086716976100 | |
parent | 76d7c992a22d4481969a977ad36d6d35d3b2ca6f (diff) | |
parent | 2ebf08f07589cb391539b7e8364f48dfe086aabd (diff) | |
download | lua-term-1ba9a8eb70bfccf1ce5f8fe78c02be46692ee9d8.tar.gz lua-term-1ba9a8eb70bfccf1ce5f8fe78c02be46692ee9d8.tar.bz2 lua-term-1ba9a8eb70bfccf1ce5f8fe78c02be46692ee9d8.zip |
Merge pull request #9 from azet/master
added proper makefile (issue: #8)
-rw-r--r-- | Makefile | 39 |
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 | |||
3 | LUA_VER := 5.1 | ||
4 | LUA_DIR := /usr | ||
5 | LUA_LIBDIR := $(LUA_DIR)/lib/lua/$(LUA_VER)/term | ||
6 | LUA_INC := $(LUA_DIR)/include/lua$(LUA_VER) | ||
7 | LUA_SHARE := $(LUA_DIR)/share/lua/$(LUA_VER)/term | ||
8 | CWARNS := -Wall -pedantic | ||
9 | CFLAGS := $(CWARNS) -ansi -O3 -I$(LUA_INC) -fPIC | ||
10 | LIB_OPTION := -shared | ||
11 | |||
12 | SONAME := core.so | ||
13 | SONAMEV := $(SONAME).1 | ||
14 | LIBRARY := $(SONAMEV).0.1 | ||
15 | SRC := core.c | ||
16 | OBJ := $(patsubst %.c, %.o, $(SRC)) | ||
17 | |||
18 | FILES := term/init.lua term/cursor.lua term/colors.lua | ||
19 | |||
20 | all: $(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 | |||
31 | install: | ||
32 | mkdir -p $(LUA_LIBDIR) | ||
33 | cp $(SONAME) $(LUA_LIBDIR) | ||
34 | mkdir -p $(LUA_SHARE) | ||
35 | cp $(FILES) $(LUA_SHARE) | ||
36 | |||
37 | clean: | ||
38 | $(RM) $(LIBRARY) $(SONAMEV) $(SONAME) *.o | ||
39 | |||