Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame^] | 1 | # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | SHELL = bash -e -o pipefail |
| 5 | |
| 6 | # Common set of args, set to --debug for more output |
| 7 | COMMON_ARGS ?= --debug |
| 8 | |
| 9 | # change to be 'python3 -m cProfile -s cumtime' to profile a script |
| 10 | PYTHON ?= python3 |
| 11 | |
| 12 | .DEFAULT_GOAL := help |
| 13 | .PHONY: cggs license clean-all help |
| 14 | |
| 15 | # build targets |
| 16 | |
| 17 | cggs: ## Sync crowd groups |
| 18 | $(PYTHON) cggs.py $(COMMON_ARGS) settings.json |
| 19 | |
| 20 | # testing targets |
| 21 | test: ## run all tests |
| 22 | tox |
| 23 | |
| 24 | license: ## Check code for licensing with REUSE |
| 25 | reuse --root . lint |
| 26 | |
| 27 | clean-all: clean ## Delete virtualenv and all cached job information |
| 28 | rm -rf .tox *.pyc |
| 29 | |
| 30 | help: ## Print help for each target |
| 31 | @echo cggs test targets |
| 32 | @echo |
| 33 | @grep '^[[:alnum:]_-]*:.* ##' $(MAKEFILE_LIST) \ |
| 34 | | sort | awk 'BEGIN {FS=":.* ## "}; {printf "%-25s %s\n", $$1, $$2};' |