2022-06-06 10:16:20 +05:30
|
|
|
LUA_VERSION = 5.3.6
|
|
|
|
LUA_SOURCES = https://www.lua.org/ftp/lua-$(LUA_VERSION).tar.gz
|
|
|
|
LUA_TARBALL = lua-$(LUA_VERSION).tar.gz
|
2022-06-06 11:22:47 +05:30
|
|
|
LUA_BUILDIR = src
|
2022-06-06 10:16:20 +05:30
|
|
|
LUA_DESTDIR = dist
|
|
|
|
LUA_DESTDIR_ABS = $(shell realpath $(LUA_DESTDIR))
|
2022-06-06 13:21:31 +05:30
|
|
|
LUA_ARCHIVE = lua-dist.tar.gz
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 13:21:31 +05:30
|
|
|
all: $(LUA_BUILDIR) $(LUA_DESTDIR) $(LUA_ARCHIVE)
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 11:22:47 +05:30
|
|
|
$(LUA_BUILDIR):
|
|
|
|
@if ! [ -d "$(LUA_BUILDIR)" ]; then mkdir -v "$(LUA_BUILDIR)"; fi
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 11:22:47 +05:30
|
|
|
$(LUA_BUILDIR)/lua-$(LUA_VERSION).tar.gz: $(LUA_BUILDIR)
|
2022-06-06 10:16:20 +05:30
|
|
|
curl -sSL -o "$(LUA_TARBALL)" "$(LUA_SOURCES)"
|
|
|
|
|
2022-06-06 11:22:47 +05:30
|
|
|
build: $(LUA_BUILDIR)/lua-$(LUA_VERSION).tar.gz
|
|
|
|
tar -C $(LUA_BUILDIR) --strip-components=1 -xf "$(LUA_TARBALL)"
|
|
|
|
$(MAKE) -C $(LUA_BUILDIR) -j$(shell nproc) linux
|
2022-06-06 10:16:20 +05:30
|
|
|
|
|
|
|
$(LUA_DESTDIR): build
|
|
|
|
if ! [ -d "$(LUA_DESTDIR)" ]; then mkdir -v "$(LUA_DESTDIR)"; fi
|
2022-06-06 11:22:47 +05:30
|
|
|
$(MAKE) -C $(LUA_BUILDIR) -j$(shell nproc) install INSTALL_TOP="$(LUA_DESTDIR_ABS)"
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 13:21:31 +05:30
|
|
|
$(LUA_ARCHIVE): $(LUA_DESTDIR)
|
|
|
|
tar -C "$(LUA_DESTDIR)" -cjf "$(LUA_ARCHIVE)" $$(ls -1 $(LUA_DESTDIR))
|
|
|
|
|
2022-06-06 10:16:20 +05:30
|
|
|
clean:
|
2022-06-06 11:22:47 +05:30
|
|
|
rm -rf "$(LUA_BUILDIR)"
|
2022-06-06 10:16:20 +05:30
|
|
|
rm -rf "$(LUA_DESTDIR)"
|
2022-06-06 11:22:47 +05:30
|
|
|
rm -fv "$(LUA_TARBALL)"
|
2022-06-06 13:21:31 +05:30
|
|
|
rm -fv "$(LUA_ARCHIVE)"
|
2022-06-06 10:16:20 +05:30
|
|
|
|
|
|
|
.PHONY: clean build
|