forked from LuaDist/lpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (41 loc) · 892 Bytes
/
Copy pathMakefile
File metadata and controls
57 lines (41 loc) · 892 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
# makefile for pack library for Lua
# change these to reflect your Lua installation
LUA= /tmp/lhf/lua-5.1.2
LUAINC= $(LUA)/src
LUALIB= $(LUA)/src
LUABIN= $(LUA)/src
# 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