summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-05-19 10:50:57 +0300
committerTimo Teräs <timo.teras@iki.fi>2020-05-19 10:50:57 +0300
commit12fdf6fc219321d22825042ae08efd322acc0310 (patch)
tree007ebbc061b54a7cc0173e4a6ff5dd60cc3da17f /src/Makefile
parent5e251b21fd791ec5f6830af5ca18333c8db1b1c8 (diff)
downloadapk-tools-12fdf6fc219321d22825042ae08efd322acc0310.tar.gz
apk-tools-12fdf6fc219321d22825042ae08efd322acc0310.tar.bz2
apk-tools-12fdf6fc219321d22825042ae08efd322acc0310.tar.xz
apk-tools-12fdf6fc219321d22825042ae08efd322acc0310.zip
allow building without help when lua interpreter is not available
fixes #10696
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile
index bea4cdf..4a055ce 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,8 +1,14 @@
-PKG_CONFIG ?= pkg-config
-LUAAPK ?= yes
-
+PKG_CONFIG ?= pkg-config
LUA ?= $(firstword $(wildcard /usr/bin/lua5.3 /usr/bin/lua5.2))
+ifeq ($(LUA),no)
+LUAAPK ?= no
+else ifneq ($(LUA),)
+LUAAPK ?= yes
+else
+$(error Lua interpreter not found. Please specify LUA interpreter, or use LUA=no to build without help.)
+endif
+
OPENSSL_CFLAGS := $(shell $(PKG_CONFIG) --cflags openssl)
OPENSSL_LIBS := $(shell $(PKG_CONFIG) --libs openssl)
@@ -86,10 +92,14 @@ LIBS := -Wl,--as-needed \
# Help generation
quiet_cmd_genhelp = GENHELP $@
+ifneq ($(LUA),no)
cmd_genhelp = $(LUA) $(src)/genhelp.lua $(filter %.scd, $^) > $@
+else
+ cmd_genhelp = echo \\\#define NO_HELP > $@
+endif
-$(obj)/help.h: $(src)/genhelp.lua $(wildcard doc/apk*.8.scd)
- @$(call echo-cmd,genhelp) $(cmd_genhelp)
+$(obj)/help.h: $(src)/genhelp.lua $(wildcard doc/apk*.8.scd) FORCE
+ $(call if_changed,genhelp)
CFLAGS_help.o := -I$(obj)