blob: abaa77829d9c79faf11786442994418a1bf4e474 [file] [log] [blame]
Joey Armstrong0e0f05a2023-10-02 17:41:31 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong7ebfb1f2024-02-29 12:24:08 -05003# Copyright 2022-2024 Open Networking Foundation Contributors
Joey Armstrong0e0f05a2023-10-02 17:41:31 -04004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Joey Armstrong7ebfb1f2024-02-29 12:24:08 -050016# -----------------------------------------------------------------------
17# SPDX-FileCopyrightText: 2022-2024 Open Networking Foundation Contributors
Joey Armstrong0e0f05a2023-10-02 17:41:31 -040018# SPDX-License-Identifier: Apache-2.0
19# -----------------------------------------------------------------------
Joey Armstrong7ebfb1f2024-02-29 12:24:08 -050020## Intent: This makefile will install the reuse tool used for license checking
21## -----------------------------------------------------------------------
Joey Armstrong0e0f05a2023-10-02 17:41:31 -040022
23$(if $(DEBUG),$(warning ENTER))
24
25## -----------------------------------------------------------------------
Joey Armstrong0e0f05a2023-10-02 17:41:31 -040026## Intent: Display reuse command version string.
27## Note: As a side effect, install reuse by dependency
28## -----------------------------------------------------------------------
Joey Armstrong7ebfb1f2024-02-29 12:24:08 -050029.PHONY: lint-reuse-version
30lint-reuse-version : lint-reuse-install
Joey Armstrong0e0f05a2023-10-02 17:41:31 -040031
32 $(HIDE) echo
Joey Armstrong7ebfb1f2024-02-29 12:24:08 -050033 $(venv-activate-bin)/reuse --version
Joey Armstrong0e0f05a2023-10-02 17:41:31 -040034
35## -----------------------------------------------------------------------
36## Intent: On-demand instalation of the reuse command
37## -----------------------------------------------------------------------
38.PHONY: lint-reuse-install
39lint-reuse-install : $(venv-activate-bin)/reuse
40$(venv-activate-bin)/reuse : $(venv-activate-script)
41
42 $(call banner-enter,Target $@)
43 $(activate) && pip install reuse
44 $(call banner-leave,Target $@)
45
46## -----------------------------------------------------------------------
47## Intent: Purge reuse tool installation
48## -----------------------------------------------------------------------
49sterile ::
50 $(HIDE)$(RM) "$(venv-abs-bin)/reuse"
51
52## -----------------------------------------------------------------------
53## Intent: Display command usage
54## -----------------------------------------------------------------------
55help::
56 @printf ' %-30s %s\n' 'lint-reuse-install'\
57 'Install the reuse compliance tool'
Joey Armstrong7ebfb1f2024-02-29 12:24:08 -050058 @printf ' %-30s %s\n' 'lint-reuse-version'\
59 'Display version of the installed reuse tool'
60
61# [NOTES]
62## -----------------------------------------------------------------------
63## o Installable tool target explicitly defined as $(venv-activate-bin)/reuse.
64## o Var $(REUSE) is not used as a dependency due to arbitray command
65## assignment with arguments. ie: make REUSE=/opt/reuse/bin/reuse
66## -----------------------------------------------------------------------
Joey Armstrong0e0f05a2023-10-02 17:41:31 -040067
68# [SEE ALSO]
69# -----------------------------------------------------------------------
70# o https://github.com/fsfe/reuse-tool#install
Joey Armstrong7ebfb1f2024-02-29 12:24:08 -050071## -----------------------------------------------------------------------
Joey Armstrong0e0f05a2023-10-02 17:41:31 -040072
73# [EOF]