Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 2c03936 | 2024-02-04 18:51:52 -0500 | [diff] [blame] | 3 | # Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 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 | # ----------------------------------------------------------------------- |
Joey Armstrong | 2c03936 | 2024-02-04 18:51:52 -0500 | [diff] [blame] | 17 | # SPDX-FileCopyrightText: 2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ----------------------------------------------------------------------- |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 20 | |
| 21 | ## ----------------------------------------------------------------------- |
| 22 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 23 | .PHONY: mod-update |
| 24 | mod-update: mod-tidy mod-vendor |
| 25 | |
| 26 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 4d6878e | 2024-02-08 16:29:26 -0500 | [diff] [blame] | 27 | ## Intent: Invoke the golang mod tidy command |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 28 | ## ----------------------------------------------------------------------- |
| 29 | .PHONY: mod-tidy |
| 30 | mod-tidy : |
| 31 | $(call banner-enter,Target $@) |
Joey Armstrong | 4d6878e | 2024-02-08 16:29:26 -0500 | [diff] [blame] | 32 | $(if $(LOCAL_FIX_PERMS),chmod o+w $(CURDIR)) |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 33 | ${GO} mod tidy |
Joey Armstrong | 4d6878e | 2024-02-08 16:29:26 -0500 | [diff] [blame] | 34 | $(if $(LOCAL_FIX_PERMS),chmod o-w $(CURDIR)) |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 35 | $(call banner-leave,Target $@) |
| 36 | |
| 37 | ## ----------------------------------------------------------------------- |
| 38 | ## ----------------------------------------------------------------------- |
| 39 | .PHONY: mod-vendor |
| 40 | mod-vendor : mod-tidy |
| 41 | mod-vendor : |
| 42 | $(call banner-enter,Target $@) |
| 43 | $(if $(LOCAL_FIX_PERMS),chmod o+w $(CURDIR)) |
| 44 | ${GO} mod vendor |
| 45 | $(if $(LOCAL_FIX_PERMS),chmod o-w $(CURDIR)) |
| 46 | $(call banner-leave,Target $@) |
| 47 | |
| 48 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 4d6878e | 2024-02-08 16:29:26 -0500 | [diff] [blame] | 49 | ## Intent: Display topic help |
| 50 | ## Usage: |
| 51 | ## % make help |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 52 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 4d6878e | 2024-02-08 16:29:26 -0500 | [diff] [blame] | 53 | help-summary :: |
| 54 | @printf ' %-30s %s\n' 'mod-update' \ |
| 55 | 'Alias for make mod-tidy mod-update (GOLANG)' |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 56 | ifdef VERBOSE |
Joey Armstrong | 4d6878e | 2024-02-08 16:29:26 -0500 | [diff] [blame] | 57 | @$(MAKE) --no-print-directory mod-update-help |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 58 | endif |
| 59 | |
Joey Armstrong | 4d6878e | 2024-02-08 16:29:26 -0500 | [diff] [blame] | 60 | ## ----------------------------------------------------------------------- |
| 61 | ## Intent: Display extended topic help |
| 62 | ## Usage: |
| 63 | ## % make mod-update-help |
| 64 | ## % make help VERBOSE=1 |
| 65 | ## ----------------------------------------------------------------------- |
| 66 | .PHONY: mod-update-help |
| 67 | mod-update-help :: |
| 68 | @printf ' %-30s %s\n' 'mod-tidy'\ |
| 69 | 'Invoke go mod tidy' |
| 70 | @printf ' %-30s %s\n' 'mod-vendor'\ |
| 71 | 'Invoke go mod vendor' |
| 72 | @echo |
| 73 | @echo '[MODIFIER]' |
| 74 | @printf ' %-30s %s\n' 'LOCAL_FIX_PERMS=1' \ |
| 75 | 'Local dev hack to fix docker uid/gid volume problem' |
| 76 | |
Joey Armstrong | 96bcf1b | 2023-06-27 14:49:40 -0400 | [diff] [blame] | 77 | # [EOF] |