| @@ -1,27 +1,28 @@ | | | @@ -1,27 +1,28 @@ |
1 | # $NetBSD: tool.mk,v 1.4 2023/06/27 10:31:21 riastradh Exp $ | | 1 | # $NetBSD: tool.mk,v 1.5 2023/11/23 11:00:52 jperkin Exp $ |
2 | # | | 2 | # |
3 | # Create `python' interpreter wrapper for applicable Python bin. | | 3 | # Create `python' interpreter wrapper for applicable Python bin. |
4 | # | | 4 | # |
5 | # This mk fragment can be included in all packages that use `python' | | 5 | # This mk fragment can be included in all packages that use `python' |
6 | # as a tool without a pkgsrc-style version suffix. | | 6 | # as a tool without a pkgsrc-style version suffix. |
7 | # | | 7 | # |
8 | # Keywords: python | | 8 | # Keywords: python |
9 | # | | 9 | # |
10 | | | 10 | |
11 | .if !defined(PYTHON_TOOL_MK) | | 11 | .if !defined(PYTHON_TOOL_MK) |
12 | PYTHON_TOOL_MK= defined | | 12 | PYTHON_TOOL_MK= defined |
13 | | | 13 | |
14 | .if !defined(PYTHON_PYVERSION_MK) | | 14 | .if !defined(PYTHON_PYVERSION_MK) |
| | | 15 | PYTHON_FOR_BUILD_ONLY?= tool |
15 | .include "../../lang/python/pyversion.mk" | | 16 | .include "../../lang/python/pyversion.mk" |
16 | .endif | | 17 | .endif |
17 | | | 18 | |
18 | BUILDLINK_TARGETS+= buildlink-bin-python | | 19 | BUILDLINK_TARGETS+= buildlink-bin-python |
19 | | | 20 | |
20 | .PHONY: buildlink-bin-python | | 21 | .PHONY: buildlink-bin-python |
21 | buildlink-bin-python: | | 22 | buildlink-bin-python: |
22 | .for bin in python python${PYVERSSUFFIX:R} | | 23 | .for bin in python python${PYVERSSUFFIX:R} |
23 | ${RUN} \ | | 24 | ${RUN} \ |
24 | t=${BUILDLINK_DIR}/bin/${bin}; \ | | 25 | t=${BUILDLINK_DIR}/bin/${bin}; \ |
25 | if ${TEST} -f "${TOOL_PYTHONBIN}" -a ! -f $$t; then \ | | 26 | if ${TEST} -f "${TOOL_PYTHONBIN}" -a ! -f $$t; then \ |
26 | ${LN} -sf "${TOOL_PYTHONBIN}" $$t; \ | | 27 | ${LN} -sf "${TOOL_PYTHONBIN}" $$t; \ |
27 | fi | | 28 | fi |