Added non-stripped debug target for LuCI
[project/luci.git] / contrib / luaposix / Makefile
1 include ../../build/config.mk
2 include ../../build/gccconfig.mk
3
4 LUAPOSIX_VERSION = 5.1.3
5 LUAPOSIX_SITE = http://luaforge.net/frs/download.php/3449/
6 LUAPOSIX_DIR = luaposix-$(LUAPOSIX_VERSION)
7 LUAPOSIX_FILE = $(LUAPOSIX_DIR).tar.gz
8 LUAPOSIX_URL = $(LUAPOSIX_SITE)/$(LUAPOSIX_FILE)
9 LUAPOSIX_PATCHDIR = patches
10
11 all: compile
12
13 $(LUAPOSIX_FILE):
14         wget -O $@ $(LUAPOSIX_URL) || rm -f $@
15
16 $(LUAPOSIX_PATCHDIR)/series:
17         (cd $(LUAPOSIX_PATCHDIR); ls *.patch | sort > series)
18
19 $(LUAPOSIX_DIR)/.prepared: $(LUAPOSIX_FILE)
20         rm -rf $(LUAPOSIX_DIR)
21         tar xvfz $(LUAPOSIX_FILE)
22         ln -s ../$(LUAPOSIX_PATCHDIR) $(LUAPOSIX_DIR)/patches
23         touch $@
24
25 $(LUAPOSIX_DIR)/.patched: $(LUAPOSIX_DIR)/.prepared $(LUAPOSIX_PATCHDIR)/series
26         (cd $(LUAPOSIX_DIR); \
27                 if [ -x "$$(which quilt 2>/dev/null)" ]; then \
28                         quilt push -a; \
29                 else \
30                         cat patches/*.patch | patch -p1; \
31                 fi; \
32         )
33         touch $@
34
35 compile: $(LUAPOSIX_DIR)/.patched
36         $(MAKE) -C $(LUAPOSIX_DIR) CC=$(CC) CFLAGS="$(CFLAGS) $(LUA_CFLAGS)" LDFLAGS="$(LDFLAGS) $(LUA_SHLIBS)" OS="$(OS)"
37         mkdir -p dist$(LUA_LIBRARYDIR)
38         cp $(LUAPOSIX_DIR)/posix.so dist$(LUA_LIBRARYDIR)
39
40 luasource:
41 luastrip:
42 luacompile:
43 compile-all: compile
44
45 clean:
46         rm -rf $(LUAPOSIX_DIR) $(LUAPOSIX_FILE)
47         rm -f $(LUAPOSIX_PATCHDIR)/series