Joey Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 7ebfb1f | 2024-02-29 12:24:08 -0500 | [diff] [blame] | 3 | # Copyright 2022-2024 Open Networking Foundation Contributors |
Joey Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 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. |
Joey Armstrong | 7ebfb1f | 2024-02-29 12:24:08 -0500 | [diff] [blame] | 16 | # ----------------------------------------------------------------------- |
| 17 | # SPDX-FileCopyrightText: 2022-2024 Open Networking Foundation Contributors |
Joey Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ----------------------------------------------------------------------- |
Joey Armstrong | 7ebfb1f | 2024-02-29 12:24:08 -0500 | [diff] [blame] | 20 | ## Intent: This makefile will install the reuse tool used for license checking |
| 21 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 22 | |
| 23 | $(if $(DEBUG),$(warning ENTER)) |
| 24 | |
| 25 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 26 | ## Intent: Display reuse command version string. |
| 27 | ## Note: As a side effect, install reuse by dependency |
| 28 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 7ebfb1f | 2024-02-29 12:24:08 -0500 | [diff] [blame] | 29 | .PHONY: lint-reuse-version |
| 30 | lint-reuse-version : lint-reuse-install |
Joey Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 31 | |
| 32 | $(HIDE) echo |
Joey Armstrong | 7ebfb1f | 2024-02-29 12:24:08 -0500 | [diff] [blame] | 33 | $(venv-activate-bin)/reuse --version |
Joey Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 34 | |
| 35 | ## ----------------------------------------------------------------------- |
| 36 | ## Intent: On-demand instalation of the reuse command |
| 37 | ## ----------------------------------------------------------------------- |
| 38 | .PHONY: lint-reuse-install |
| 39 | lint-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 | ## ----------------------------------------------------------------------- |
| 49 | sterile :: |
| 50 | $(HIDE)$(RM) "$(venv-abs-bin)/reuse" |
| 51 | |
| 52 | ## ----------------------------------------------------------------------- |
| 53 | ## Intent: Display command usage |
| 54 | ## ----------------------------------------------------------------------- |
| 55 | help:: |
| 56 | @printf ' %-30s %s\n' 'lint-reuse-install'\ |
| 57 | 'Install the reuse compliance tool' |
Joey Armstrong | 7ebfb1f | 2024-02-29 12:24:08 -0500 | [diff] [blame] | 58 | @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 Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 67 | |
| 68 | # [SEE ALSO] |
| 69 | # ----------------------------------------------------------------------- |
| 70 | # o https://github.com/fsfe/reuse-tool#install |
Joey Armstrong | 7ebfb1f | 2024-02-29 12:24:08 -0500 | [diff] [blame] | 71 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 0e0f05a | 2023-10-02 17:41:31 -0400 | [diff] [blame] | 72 | |
| 73 | # [EOF] |