blob: 3017e49cfb1e17bd483e896d5314340d6582b2c7 [file] [log] [blame]
Joey Armstrongab483222023-11-28 12:41:12 -05001# -*- 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 Williams7f87d3e2020-06-05 12:36:39 -070018# SPDX-License-Identifier: Apache-2.0
Joey Armstrongab483222023-11-28 12:41:12 -050019# -----------------------------------------------------------------------
Zack Williams7f87d3e2020-06-05 12:36:39 -070020
Joey Armstrongab483222023-11-28 12:41:12 -050021## Boot loader
22onf-mk-abs ?= $(abspath $(lastword $(MAKEFILE_LIST)))
23onf-mk-top := $(dir $(onf-mk-abs))
24onf-mk-top := $(patsubst %/,%,$(onf-mk-top))
Zack Williams7f87d3e2020-06-05 12:36:39 -070025
Joey Armstrongab483222023-11-28 12:41:12 -050026include $(onf-mk-top)/makefiles/include.mk
Zack Williams7f87d3e2020-06-05 12:36:39 -070027
Joey Armstrongab483222023-11-28 12:41:12 -050028##-------------------##
29##---] GLOBALS [---##
30##-------------------##
Zack Williams7f87d3e2020-06-05 12:36:39 -070031# change to be 'python3 -m cProfile -s cumtime' to profile a script
Joey Armstrongab483222023-11-28 12:41:12 -050032# PYTHON ?= python3
Zack Williams7f87d3e2020-06-05 12:36:39 -070033
34.DEFAULT_GOAL := help
35.PHONY: cggs license clean-all help
36
37# build targets
38
Joey Armstrongab483222023-11-28 12:41:12 -050039## -----------------------------------------------------------------------
40## -----------------------------------------------------------------------
41CGGS_ARGS ?= --debug
Zack Williams7f87d3e2020-06-05 12:36:39 -070042
Joey Armstrongab483222023-11-28 12:41:12 -050043cggs : $(venv-activate-script)
44 $(activate) && python cggs.py $(CGGS_ARGS) settings.json
45
46## -----------------------------------------------------------------------
47## -----------------------------------------------------------------------
48# test : venv-activate-script
49test : $(venv-activate-script)
Zack Williams7f87d3e2020-06-05 12:36:39 -070050 tox
51
Joey Armstrongab483222023-11-28 12:41:12 -050052## -----------------------------------------------------------------------
53## -----------------------------------------------------------------------
Zack Williams7f87d3e2020-06-05 12:36:39 -070054license: ## Check code for licensing with REUSE
55 reuse --root . lint
56
Joey Armstrongab483222023-11-28 12:41:12 -050057## -----------------------------------------------------------------------
58## Intent: Show supported targets
59## -----------------------------------------------------------------------
60help :: ## Print help for each target
Zack Williams7f87d3e2020-06-05 12:36:39 -070061 @echo
Joey Armstrongab483222023-11-28 12:41:12 -050062 @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]