summaryrefslogtreecommitdiff
path: root/lang/python/tool.mk
blob: fae0e172dfa9605b75e51a615b429e9bd72b5326 (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
# $NetBSD: tool.mk,v 1.3 2019/12/15 23:59:00 gutteridge Exp $
#
# Create `python' interpreter wrapper for applicable Python bin.
#
# This mk fragment can be included in all packages that use `python'
# as a tool without a pkgsrc-style version suffix.
#
# Keywords: python
#

.if !defined(PYTHON_TOOL_MK)
PYTHON_TOOL_MK=	defined

.if !defined(PYTHON_PYVERSION_MK)
.include "../../lang/python/pyversion.mk"
.endif

BUILDLINK_TARGETS+=	buildlink-bin-python

.PHONY: buildlink-bin-python
buildlink-bin-python:
.for bin in python python${PYVERSSUFFIX:R}
	${RUN} \
	t=${BUILDLINK_DIR}/bin/${bin}; \
	if ${TEST} -f "${PYTHONBIN}" -a ! -f $$t; then \
		${LN} -sf "${PYTHONBIN}" $$t; \
	fi
.endfor

.endif # PYTHON_TOOL_MK