forked from LuaDist/lpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (42 loc) · 1012 Bytes
/
Copy pathMakefile
File metadata and controls
58 lines (42 loc) · 1012 Bytes
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# makefile for pack library for Lua
# change these to reflect your Lua installation
# LUA=$(word 1,$(shell which lua5.1$(_LUAEXT)) $(shell which lua51$(_LUAEXT)) lua$(_LUAEXT))
# LUA=~/temp/lede/build_dir/hostpkg/lua-5.1.5/src1
# LUAINC= 123/src2
# LUALIB= 234/src3
# LUABIN= 345/src4
# probably no need to change anything below here
CFLAGS= $(INCS) $(WARN) -O2 $G
WARN= -ansi -pedantic -Wall
INCS= -I$(LUAINC)
MYNAME= pack
MYLIB= l$(MYNAME)
T= $(MYNAME).so
OBJS= $(MYLIB).o
TEST= test.lua
all: test
test: $T
$(LUABIN)/lua $(TEST)
o: $(MYLIB).o
so: $T
$T: $(OBJS)
$(CC) -o $@ -shared $(OBJS)
clean:
rm -f $(OBJS) $T core core.* a.out
doc:
@echo "$(MYNAME) library:"
@fgrep '/**' $(MYLIB).c | cut -f2 -d/ | tr -d '*' | sort | column
# distribution
FTP= $(HOME)/public/ftp/lua/5.1
D= $(MYNAME)
A= $(MYLIB).tar.gz
TOTAR= Makefile,README,$(MYLIB).c,test.lua
tar: clean
tar zcvf $A -C .. $D/{$(TOTAR)}
distr: tar
touch -r $A .stamp
mv $A $(FTP)
diff: clean
tar zxf $(FTP)/$A
diff $D .
# eof