summaryrefslogtreecommitdiffhomepage
path: root/contrib/bitlib/Makefile
blob: 6b7c82483d3a54de6968b86240749538bf1fb0eb (plain)
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
include ../../build/config.mk
include ../../build/gccconfig.mk

BITLIB_VERSION = 25
BITLIB_SITE = http://luaforge.net/frs/download.php/3065/
BITLIB_DIR = bitlib-$(BITLIB_VERSION)
BITLIB_FILE = $(BITLIB_DIR).tar.gz
BITLIB_URL = $(BITLIB_SITE)/$(BITLIB_FILE)

all: compile

include ../../build/module.mk

$(BITLIB_FILE):
	wget -O $@ $(BITLIB_URL) || rm -f $@

$(BITLIB_DIR)/.prepared: $(BITLIB_FILE)
	rm -rf $(BITLIB_DIR)
	tar xvfz $(BITLIB_FILE)
	test -f $(BITLIB_DIR)/config.h || cp $(BITLIB_DIR)/config.h.in $(BITLIB_DIR)/config.h
	touch $@

compile: $(BITLIB_DIR)/.prepared
	mkdir -p dist$(LUA_LIBRARYDIR)
	$(COMPILE) -DHAVE_CONFIG_H -I$(BITLIB_DIR) -O2 -c $(BITLIB_DIR)/lbitlib.c $(FPIC) $(LUA_CFLAGS) -o $(BITLIB_DIR)/lbitlib.o
	$(LINK) $(SHLIB_FLAGS) $(LDFLAGS) $(BITLIB_DIR)/lbitlib.o $(LUA_SHLIBS) -lm -ldl -o dist$(LUA_LIBRARYDIR)/bit.so

luasource:
luastrip:
luacompile:
compile-all: compile

clean:
	rm -rf $(BITLIB_DIR) $(BITLIB_FILE)