* luci/contrib: packaged bitlib
[project/luci.git] / contrib / bitlib / Makefile
1 include ../../build/config.mk
2 include ../../build/gccconfig.mk
3
4 BITLIB_VERSION = 25
5 BITLIB_SITE = http://luaforge.net/frs/download.php/3065/
6 BITLIB_DIR = bitlib-$(BITLIB_VERSION)
7 BITLIB_FILE = $(BITLIB_DIR).tar.gz
8 BITLIB_URL = $(BITLIB_SITE)/$(BITLIB_FILE)
9
10 all: compile
11
12 include ../../build/module.mk
13
14 $(BITLIB_FILE):
15 wget -O $@ $(BITLIB_URL) || rm -f $@
16
17 $(BITLIB_DIR)/.prepared: $(BITLIB_FILE)
18 rm -rf $(BITLIB_DIR)
19 tar xvfz $(BITLIB_FILE)
20 touch $@
21
22 $(BITLIB_DIR)/.configured: $(BITLIB_DIR)/.prepared
23 ( cd $(BITLIB_DIR); ./configure )
24 touch $@
25
26 compile: $(BITLIB_DIR)/.configured
27 $(MAKE) -C $(BITLIB_DIR) CC=$(CC) CFLAGS="$(CFLAGS) $(LUA_CFLAGS)" LDFLAGS="$(LDFLAGS) $(LUA_SHLIBS)" OS="$(OS)"
28 mkdir -p dist$(LUA_LIBRARYDIR)
29 cp $(BITLIB_DIR)/.libs/bit.so.0.0.0 dist$(LUA_LIBRARYDIR)/bit.so
30
31 luasource:
32 luastrip:
33 luacompile:
34 compile-all: compile
35
36 clean:
37 rm -rf $(BITLIB_DIR) $(BITLIB_FILE)