Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 1 | # -*- makefile -*- |
| 2 | ## ----------------------------------------------------------------------- |
| 3 | # Copyright 2020-2023 Open Networking Foundation (ONF) and the ONF Contributors <support@opennetworking.org> |
| 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: Copyright 2020-2023 Open Networking Foundation (ONF) and the ONF Contributors <support@opennetworking.org> |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 18 | # SPDX-License-Identifier: Apache-2.0 |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 19 | # ----------------------------------------------------------------------- |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 20 | |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 21 | ## Boot loader |
| 22 | onf-mk-abs ?= $(abspath $(lastword $(MAKEFILE_LIST))) |
| 23 | onf-mk-top := $(dir $(onf-mk-abs)) |
| 24 | onf-mk-top := $(patsubst %/,%,$(onf-mk-top)) |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 25 | |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 26 | include $(onf-mk-top)/makefiles/include.mk |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 27 | |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 28 | ##-------------------## |
| 29 | ##---] GLOBALS [---## |
| 30 | ##-------------------## |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 31 | # change to be 'python3 -m cProfile -s cumtime' to profile a script |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 32 | # PYTHON ?= python3 |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 33 | |
| 34 | .DEFAULT_GOAL := help |
| 35 | .PHONY: cggs license clean-all help |
| 36 | |
| 37 | # build targets |
| 38 | |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 39 | ## ----------------------------------------------------------------------- |
| 40 | ## ----------------------------------------------------------------------- |
| 41 | CGGS_ARGS ?= --debug |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 42 | |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 43 | cggs : $(venv-activate-script) |
| 44 | $(activate) && python cggs.py $(CGGS_ARGS) settings.json |
| 45 | |
| 46 | ## ----------------------------------------------------------------------- |
| 47 | ## ----------------------------------------------------------------------- |
| 48 | # test : venv-activate-script |
| 49 | test : $(venv-activate-script) |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 50 | tox |
| 51 | |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 52 | ## ----------------------------------------------------------------------- |
| 53 | ## ----------------------------------------------------------------------- |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 54 | license: ## Check code for licensing with REUSE |
| 55 | reuse --root . lint |
| 56 | |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 57 | ## ----------------------------------------------------------------------- |
| 58 | ## Intent: Show supported targets |
| 59 | ## ----------------------------------------------------------------------- |
| 60 | help :: ## Print help for each target |
Zack Williams | 7f87d3e | 2020-06-05 12:36:39 -0700 | [diff] [blame] | 61 | @echo |
Joey Armstrong | ab48322 | 2023-11-28 12:41:12 -0500 | [diff] [blame^] | 62 | @echo "Usage: $(MAKE)" |
| 63 | @printf ' %-33.33s %s\n' 'cggs' 'Crowd Group Gerrit Sync' |
| 64 | @printf ' %-33.33s %s\n' 'test' 'Run all tests' |
| 65 | @printf ' %-33.33s %s\n' 'license'\ |
| 66 | 'Check code for licensing with REUSE' |
| 67 | |
| 68 | # [EOF] |