diff options
Diffstat (limited to 'contrib/luaposix/Makefile')
-rw-r--r-- | contrib/luaposix/Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/luaposix/Makefile b/contrib/luaposix/Makefile new file mode 100644 index 000000000..4f16b5362 --- /dev/null +++ b/contrib/luaposix/Makefile @@ -0,0 +1,43 @@ +include ../../build/config.mk + +LUAPOSIX_VERSION = 5.1.2 +LUAPOSIX_SITE = http://luaforge.net/frs/download.php/3063/ +LUAPOSIX_DIR = luaposix-$(LUAPOSIX_VERSION) +LUAPOSIX_FILE = $(LUAPOSIX_DIR).tar.gz +LUAPOSIX_URL = $(LUAPOSIX_SITE)/$(LUAPOSIX_FILE) +LUAPOSIX_PATCHDIR = patches + +all: compile + +$(LUAPOSIX_FILE): + wget -O $@ $(LUAPOSIX_URL) || rm -f $@ + +$(LUAPOSIX_PATCHDIR)/series: + (cd $(LUAPOSIX_PATCHDIR); ls *.patch | sort > series) + +$(LUAPOSIX_DIR)/.prepared: $(LUAPOSIX_FILE) + rm -rf $(LUAPOSIX_DIR) + tar xvfz $(LUAPOSIX_FILE) + ln -s ../$(LUAPOSIX_PATCHDIR) $(LUAPOSIX_DIR)/patches + touch $@ + +$(LUAPOSIX_DIR)/.patched: $(LUAPOSIX_DIR)/.prepared $(LUAPOSIX_PATCHDIR)/series + (cd $(LUAPOSIX_DIR); \ + if [ -x "$$(which quilt 2>/dev/null)" ]; then \ + quilt push -a; \ + else \ + cat patches/*.patch | patch -p1; \ + fi; \ + ) + touch $@ + +compile: $(LUAPOSIX_DIR)/.patched + $(MAKE) -C $(LUAPOSIX_DIR) CC=$(CC) CFLAGS="$(CFLAGS)" OS="$(OS)" + mkdir -p dist/usr/lib/lua + cp $(LUAPOSIX_DIR)/posix.so dist/usr/lib/lua/ + +compile-all: compile + +clean: + rm -rf $(LUAPOSIX_DIR) $(LUAPOSIX_FILE) + rm -f $(LUAPOSIX_PATCHDIR)/series |