Makefile improvements
.gitignore
----------
o Added .venv/ so git will ignore local python virtual env.
Makefile
--------
o Update copyright notice to latest syntax (w/SPDX tokens).
o Remove dup go-protos and java-protos as build target dependencies,
build depends on protos which depends on {build,go}-protos.
o Changed "python ./setup.py sdist" to "$(activate) && python ...",
difference: cmd[1] is system interpreter, cmd[2] is installed
virtualenv interpreter used by all other commands.
makefiles/help/include.mk
makefiles/help/go.mk
makefiles/help/java.mk
makefiles/help/python.mk
------------------------
o Help target formatting and cleanup.
o Not all language targets {go,java,python}-* were documented.
Change-Id: I752ec3f38ae28f868934f36460e5fd3f588bd810
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
diff --git a/.gitignore b/.gitignore
index 8a1cfba..f4317eb 100755
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,5 @@
#editors
.idea/
+
+.venv/
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 5cbd2b9..23b73c5 100755
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# -*- makefile -*-
# -----------------------------------------------------------------------
-# Copyright 2019-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# Copyright 2019-2024 Open Networking Foundation Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,9 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# -----------------------------------------------------------------------
+# SPDX-FileCopyrightText: 2019-2024 Open Networking Foundation Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
.PHONY: test
-.DEFAULT_GOAL := test
+export .DEFAULT_GOAL := test
##-------------------##
##---] GLOBALS [---##
@@ -91,11 +94,16 @@
@echo "Go PB files: $(PROTO_GO_PB)"
@echo "JAVA PB files: $(PROTO_JAVA_PB)"
-# Generic targets
+## -----------------------------------------------------------------------
+## Generic targets
+## -----------------------------------------------------------------------
+.PHONY: protos
protos: python-protos go-protos java-protos
-build: protos python-build go-protos java-protos
+.PHONY: build
+build: protos python-build
+.PHONY: test
test: python-test go-test java-test
clean :: python-clean java-clean go-clean
@@ -144,7 +152,7 @@
$(call banner-enter,target $@)
$(RM) -r dist/
- python ./setup.py sdist
+ $(activate) && python ./setup.py sdist
$(call banner-leave,target $@)
diff --git a/makefiles/help/go.mk b/makefiles/help/go.mk
index 9ec36db..57d2b0a 100644
--- a/makefiles/help/go.mk
+++ b/makefiles/help/go.mk
@@ -16,10 +16,9 @@
# -----------------------------------------------------------------------
help ::
- @echo
- @echo '[GO]'
- @echo ' go-all Build & test all go targets'
- @echo ' go-protos'
- @echo ' go-test'
+ @printf '\n[LANGUAGE: go]\n'
+ @printf ' %-33.33s %s\n' 'go-all' 'Build & test all go targets'
+ @printf ' %-33.33s %s\n' 'go-protos' 'Generate go prototypes'
+ @printf ' %-33.33s %s\n' 'go-test' 'Validate generated prototypes'
# [EOF]
diff --git a/makefiles/help/include.mk b/makefiles/help/include.mk
index 4237f11..31ca208 100644
--- a/makefiles/help/include.mk
+++ b/makefiles/help/include.mk
@@ -23,23 +23,15 @@
@echo
@echo '[ACTION] - golang, java and python'
- @echo ' protos'
- @echo ' build'
- @echo ' test'
-
- @echo
- @echo '[HELP]'
- @echo ' help Display program help'
+ @printf ' %-33.33s %s\n' 'protos' 'Generate prototypes'
+ @printf ' %-33.33s %s\n' 'build' 'Invoke build for prototypes'
+ @printf ' %-33.33s %s\n' 'test' 'Invoke prototype testing'
+ @printf ' %-33.33s %s\n' 'repair' 'Local builds: repair generated docker file ownership'
# @echo ' help-verbose Display additional targets and help'
- @echo
- @echo '[PROTOS: generate]'
- @echo ' go-protos'
- @echo ' java-protos'
- @echo ' python-protos'
-
- @echo
- @echo '[MISC]'
- @echo ' repair Recover from a common fatal build condition'
+include $(MAKEDIR)/help/go.mk
+include $(MAKEDIR)/help/java.mk
+include $(MAKEDIR)/help/python.mk
+include $(MAKEDIR)/help/variables.mk
# [EOF]
diff --git a/makefiles/help/java.mk b/makefiles/help/java.mk
index ddfed44..09ca00e 100644
--- a/makefiles/help/java.mk
+++ b/makefiles/help/java.mk
@@ -16,9 +16,9 @@
# -----------------------------------------------------------------------
help ::
- @echo '[JAVA]'
- @echo ' java-all Build & test all java targets'
- @echo ' java-protos'
- @echo ' java-test'
+ @printf '\n[LANGUAGE: java]\n'
+ @printf ' %-33.33s %s\n' 'java-all' 'Build & test all java targets'
+ @printf ' %-33.33s %s\n' 'java-protos' 'Generate java prototypes'
+ @printf ' %-33.33s %s\n' 'java-test' 'Validate generated prototypes'
# [EOF]
diff --git a/makefiles/help/python.mk b/makefiles/help/python.mk
index 4aaeade..0ebe8ff 100644
--- a/makefiles/help/python.mk
+++ b/makefiles/help/python.mk
@@ -16,12 +16,10 @@
# -----------------------------------------------------------------------
help ::
- @echo
- @echo '[PYTHON]'
- @echo ' python-all Build & test all python targets'
- @echo ' python-protos'
- @echo ' python-build'
- @echo ' python-test'
- @echo
+ @printf '\n[LANGUAGE: python]\n'
+ @printf ' %-33.33s %s\n' 'python-all' 'Invoke all python makefile targets'
+ @printf ' %-33.33s %s\n' 'python-protos' 'Generate python prototypes'
+ @printf ' %-33.33s %s\n' 'python-build' 'Compile python prototypes'
+ @printf ' %-33.33s %s\n' 'python-test' 'Validate generated prototypes'
# [EOF]
diff --git a/makefiles/include.mk b/makefiles/include.mk
index ecf52d5..e35fe5d 100644
--- a/makefiles/include.mk
+++ b/makefiles/include.mk
@@ -40,7 +40,7 @@
include $(MAKEDIR)/golang/include.mk
-include $(MAKEDIR)/help/variables.mk
+# include $(MAKEDIR)/help/variables.mk
include $(MAKEDIR)/lint/include.mk
include $(MAKEDIR)/todo.mk