blob: 0e62260ca024324efbf99fd7b348f79eef1d7fe7 [file] [log] [blame]
Joey Armstrong04cdd9f2023-06-09 15:18:23 -04001# -*- 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 doc8 tool
25## -----------------------------------------------------------------------
26.PHONY: lint-doc8-install
27
28## Define a macro to standardize and simplify access
29# DOC8 ?= $(venv-activate-bin)/doc8
30# DOC8 ?= $(activate) && doc8
31
32## -----------------------------------------------------------------------
33## Intent: Display doc8 command version string.
34## Note: As a side effect, install doc8 by dependency
35## -----------------------------------------------------------------------
36.PHONY: lint-doc8-cmd-version
37lint-doc8-cmd-version : $(venv-activate-bin)/doc8
38
39 $(HIDE) echo
40 $< --version
41
42## -----------------------------------------------------------------------
43## Intent: On-demand instalation of the doc8 command
44## -----------------------------------------------------------------------
45lint-doc8-install := $(venv-activate-bin)/doc8
46$(lint-doc8-install) : $(venv-activate-script)
47
48 $(call banner-enter,Target $@)
49 $(activate) && pip install doc8
50 $(call banner-leave,Target $@)
51
52## -----------------------------------------------------------------------
53## Intent: Purge doc8 tool installation
54## -----------------------------------------------------------------------
55sterile ::
56 $(HIDE)$(RM) "$(venv-abs-bin)/doc8"
57# HIDE)$(RM) -r .venv/lib/*/site-packages/doc8
58
59## -----------------------------------------------------------------------
60## Intent: Display command usage
61## -----------------------------------------------------------------------
62help::
63 @echo ' lint-doc8-install Install the doc8 tool'
64
65# [EOF]