blob: 03b59939ba015e036155c1dd63ca7cecd3467992 [file] [log] [blame]
Martin Cosynsbf2daa02021-09-29 13:23:45 +02001# Copyright 2020-present Open Networking Foundation
2# Original copyright 2020-present ADTRAN, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14
15# set default shell
16SHELL = bash -e -o pipefail
17
18# Variables
19VERSION ?= $(shell cat ./VERSION)
20LINT_ARGS ?= --verbose --configure LineTooLong:130 -e LineTooLong \
21 --configure TooManyTestSteps:60 -e TooManyTestSteps \
22 --configure TooManyTestCases:50 -e TooManyTestCases \
23 --configure TooFewTestSteps:1 \
24 --configure TooFewKeywordSteps:1 \
25 --configure FileTooLong:1500 -e FileTooLong \
26 -e TrailingWhitespace
27
28ROBOT_FILES := $(shell find . -name *.robot -print)
29
30# For each makefile target, add ## <description> on the target line and it will be listed by 'make help'
31help: ## Print help for each Makefile target
32 @echo "Usage: make [<target>]"
33 @echo "where available targets are:"
34 @echo
35 @grep '^[[:alpha:]_-]*:.* ##' $(MAKEFILE_LIST) \
36 | sort | awk 'BEGIN {FS=":.* ## "}; {printf "%-25s : %s\n", $$1, $$2};'
37
38vst_venv:
39 virtualenv -p python3 $@ ;\
40 source ./$@/bin/activate ;\
41 python -m pip install -r requirements.txt
42
43test: vst_venv
44 source ./$</bin/activate ; set -u ;\
45 rflint $(LINT_ARGS) $(ROBOT_FILES)
46
47clean:
48 find . -name output.xml -print
49
50clean-all: clean
51 rm -rf vst_venv gendocs
52
53# end file