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-07 08:36:13 +05:30
|
|
|
all: build $(LUA_DESTDIR) $(LUA_ARCHIVE)
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-07 08:36:13 +05:30
|
|
|
$(LUA_TARBALL):
|
|
|
|
curl -fsSL -o "$(LUA_TARBALL)" "$(LUA_SOURCES)"
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-07 08:36:13 +05:30
|
|
|
$(LUA_BUILDIR): $(LUA_TARBALL)
|
|
|
|
@if ! [ -d "$(LUA_BUILDIR)" ]; then mkdir -v "$(LUA_BUILDIR)"; fi
|
2022-06-06 11:22:47 +05:30
|
|
|
tar -C $(LUA_BUILDIR) --strip-components=1 -xf "$(LUA_TARBALL)"
|
2022-06-07 08:36:13 +05:30
|
|
|
|
|
|
|
build: $(LUA_BUILDIR)
|
2022-06-23 18:53:25 +05:30
|
|
|
$(MAKE) build_$(shell uname -s)
|
|
|
|
|
|
|
|
.PHONY: build_Linux
|
|
|
|
build_Linux:
|
2022-06-06 11:22:47 +05:30
|
|
|
$(MAKE) -C $(LUA_BUILDIR) -j$(shell nproc) linux
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-23 18:53:25 +05:30
|
|
|
.PHONY: build_Darwin
|
|
|
|
build_Darwin:
|
|
|
|
$(MAKE) -C $(LUA_BUILDIR) -j$(shell nproc) macosx
|
|
|
|
|
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-07 08:36:13 +05:30
|
|
|
rm -fv "$(LUA_TARBALL)"
|
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 13:21:31 +05:30
|
|
|
rm -fv "$(LUA_ARCHIVE)"
|
2022-06-06 10:16:20 +05:30
|
|
|
|
|
|
|
.PHONY: clean build
|