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 59 60 61 62 63 64 65
|
# makefile for POSIX library for Lua
# change these to reflect your Lua installation
LUA= /tmp/lhf/lua-5.0
LUAINC= $(LUA)/include
LUALIB= $(LUA)/lib
LUABIN= $(LUA)/bin
# no need to change anything below here
CFLAGS= -fPIC $(INCS) $(WARN) -O2 $G
WARN= -pedantic -Wall
INCS= -I$(LUAINC)
MYNAME= posix
MYLIB= l$(MYNAME)
OBJS= $(MYLIB).o
T= $(MYLIB).so
all: test
test: $T
$(LUABIN)/lua -l$(MYNAME) test.lua
$T: $(OBJS)
$(CC) -o $@ -shared $(OBJS)
$(OBJS): modemuncher.c
tree: $T
$(LUABIN)/lua -l$(MYNAME) tree.lua .
clean:
rm -f $(OBJS) $T core core.* a.out
x:
@echo "$(MYNAME) library:"
@grep '},' $(MYLIB).c | cut -f2 | tr -d '{",' | sort | column
xx:
@echo "$(MYNAME) library:"
@fgrep '/**' $(MYLIB).c | cut -f2 -d/ | tr -d '*' | sort | column
# distribution
FTP= $(HOME)/public/ftp/lua
D= $(MYNAME)
A= $(MYLIB).tar.gz
TOTAR= Makefile,README,$(MYLIB).c,$(MYNAME).lua,test.lua,modemuncher.c,tree.lua
tar: clean
tar zcvf $A -C .. $D/{$(TOTAR)}
distr: tar
mv $A $(FTP)
diff: clean
tar zxf $(FTP)/$A
diff $D .
.stamp: $(FTP)/$A
touch --reference=$(FTP)/$A $@
# eof
|