summaryrefslogtreecommitdiff
path: root/lang/lua/tool.mk
blob: 28f8e5811917bf1886656aed226b95db626988ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# $NetBSD: tool.mk,v 1.1 2014/05/03 13:00:44 alnsn Exp $
#
# Create `lua' interpreter wrapper for applicable Lua bin.
#
# This mk fragment can be included in all packages that uses `lua'
# as a tool without version suffix.
#
# Keywords: Lua
#

.if !defined(LUA_TOOL_MK)
LUA_TOOL_MK=	defined

.if !defined(LUA_LUAVERSION_MK)
.include "../../lang/lua/luaversion.mk"
.endif

BUILDLINK_TARGETS+=	buildlink-bin-lua buildlink-bin-luac

.PHONY: buildlink-bin-lua
buildlink-bin-lua:
	${RUN} \
	f="${LUA_INTERPRETER}"; \
	t="${BUILDLINK_DIR}/bin/lua"; \
	if ${TEST} -f $$f -a ! -f $$t ; then \
		${LN} -sf $$f $$t; \
	fi

.PHONY: buildlink-bin-luac
buildlink-bin-luac:
	${RUN} \
	f="${LUA_COMPILER}"; \
	t="${BUILDLINK_DIR}/bin/luac"; \
	if ${TEST} -f $$f -a ! -f $$t ; then \
		${LN} -sf $$f $$t; \
	fi

.endif # LUA_TOOL_MK