Joey Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
| 3 | # Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors |
| 4 | # |
| 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. |
| 16 | # |
| 17 | # SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors |
| 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ----------------------------------------------------------------------- |
| 20 | |
| 21 | $(if $(DEBUG),$(warning ENTER)) |
| 22 | |
| 23 | ## ----------------------------------------------------------------------- |
| 24 | ## Intent: Install the reuse tool |
| 25 | ## ----------------------------------------------------------------------- |
| 26 | |
| 27 | ## Define a macro to standardize and simplify access |
| 28 | # REUSE ?= $(venv-activate-bin)/reuse |
| 29 | # REUSE ?= $(activate) && reuse |
| 30 | |
| 31 | ## ----------------------------------------------------------------------- |
| 32 | ## Intent: Display reuse command version string. |
| 33 | ## Note: As a side effect, install reuse by dependency |
| 34 | ## ----------------------------------------------------------------------- |
| 35 | .PHONY: lint-reuse-cmd-version |
| 36 | lint-reuse-cmd-version : $(venv-activate-bin)/reuse |
| 37 | |
| 38 | $(HIDE) echo |
| 39 | $< --version |
| 40 | |
| 41 | ## ----------------------------------------------------------------------- |
| 42 | ## Intent: On-demand instalation of the reuse command |
| 43 | ## ----------------------------------------------------------------------- |
| 44 | .PHONY: lint-reuse-install |
| 45 | lint-reuse-install : $(venv-activate-bin)/reuse |
| 46 | $(venv-activate-bin)/reuse : $(venv-activate-script) |
| 47 | |
| 48 | $(call banner-enter,Target $@) |
| 49 | $(activate) && pip install reuse |
| 50 | $(call banner-leave,Target $@) |
| 51 | |
| 52 | ## ----------------------------------------------------------------------- |
| 53 | ## Intent: Purge reuse tool installation |
| 54 | ## ----------------------------------------------------------------------- |
| 55 | sterile :: |
| 56 | $(HIDE)$(RM) "$(venv-abs-bin)/reuse" |
| 57 | |
| 58 | ## ----------------------------------------------------------------------- |
| 59 | ## Intent: Display command usage |
| 60 | ## ----------------------------------------------------------------------- |
| 61 | help:: |
| 62 | @printf ' %-30s %s\n' 'lint-reuse-install'\ |
| 63 | 'Install the reuse compliance tool' |
| 64 | |
| 65 | # [SEE ALSO] |
| 66 | # ----------------------------------------------------------------------- |
| 67 | # o https://github.com/fsfe/reuse-tool#install |
| 68 | |
| 69 | # [EOF] |