[VOL-5308] - bbsim test failure
Makefile
--------
o Temporary flag USE_LF_MK=1 added to enable library repo:onf-make use.
o Default behavior will use legacy makefiles from repo:bbsim/makefiles/.
o Fixed typo on line 76
lf/include.mk
makefiles/
-------------
o Transition bridge for using repo:onf-make.
o Define variable legacy-mk= as bbsim/makefiles/
o Replace path variable $(MAKEDIR=) with $(legacy-mk).
o Replace variable $(ONF_MAKEDIR=) with $(legacy-mk).
o These edits help break dependency on non-library makefiles/ directory.
allowing repo:onf-make to be used as a transparent replacement.
Change-Id: Ida8c020384cf78ddf19fa6375702429d992d10a1
Signed-off-by: Joey Armstrong <jarmstrong@linuxfoundation.org>
diff --git a/Makefile b/Makefile
index 5829b5d..ab0533b 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,20 @@
##-------------------##
##---] GLOBALS [---##
##-------------------##
-ifeq ($(USER),joey-disable) # temporary for transition
+
+# -----------------------------------------------------------------------
+# 2024-04-10
+# Usage: make USE_LF_MK=1 -or- USER is 'joey'
+# -----------------------------------------------------------------------
+# This makefile flag/conditional is temporary:
+# repo:onf-make is configured as a git submodule for the repository.
+# Passing USE_LF_MK will enable on-demand library makefile use.
+# Default makefile behavior is legacy, use repo:bbsim/makefiles/.
+# -----------------------------------------------------------------------
+$(if $(findstring joey-disabled,$(USER)),\
+ $(eval USE_LF_MK := 1)) # special snowflake
+
+ifdef USE_LF_MK
##--------------------##
##---] INCLUDES [---##
@@ -40,19 +53,23 @@
##-------------------##
##---] GLOBALS [---##
##-------------------##
-TOP ?=$(strip \
+TOP ?= $(strip \
$(dir \
$(abspath $(lastword $(MAKEFILE_LIST)))\
)\
)
+TOP := $(patsubst %/,%,$(TOP))
##--------------------##
##---] INCLUDES [---##
##--------------------##
include $(TOP)/config.mk
-include $(TOP)/makefiles/include.mk
-include $(ONF_MAKEDIR)/release/include.mk
+# export needed by docs/Makefile -> include makefiles/include.
+export legacy-mk := $(TOP)/makefiles
+include $(TOP)/makefiles/include.mk
+
+include $(legacy-mk)/release/include.mk
endif # USER==
##--------------------##
@@ -60,16 +77,16 @@
##--------------------##
help-targets := help-all help HELP
$(if $(filter $(help-targets),$(MAKECMDGOALS))\
- ,$(eval include $(MAKEDIR)/help.mk))
+ ,$(eval include $(legacy-mk)/help.mk))
##-------------------##
##---] GLOBALS [---##
##-------------------##
-VERSION ?= $(shell cat ./VERSION)
+VERSION ?= $(shell cat ./VERSION)
DIFF ?= $(git diff --shortstat 2> /dev/null | tail -n1)
GIT_STATUS ?= $(shell [ -z "$DIFF" ] && echo "Dirty" || echo "Clean")
-include $(MAKEDIR)/tools.mk # Command macros for DOCKER_*, GO_*
+include $(legacy-mk)/tools.mk # Command macros for DOCKER_*, GO_*
## use local vars to shorten paths
bbsim-tag = ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}bbsim:${DOCKER_TAG}
@@ -89,7 +106,8 @@
build-target-deps += build-bbsimctl
build-target-deps += build-bbr
-.PHONY: build $(build-target-deps)
+# .PHONY: build
+.PHONY: $(build-target-deps)
build: protos $(build-target-deps)
## -----------------------------------------------------------------------
@@ -192,7 +210,7 @@
chmod o+w $(dir $(results-xml) $(coverage-xml)))
${GOCOVER_COBERTURA} < $(coverage-out) > $(coverage-xml)
$(if $(LOCAL_FIX_PERMS),\
- chmod o-w $(dir $(results-xml) $(coverage-xml)))
+ chmod o-w $(dir $(results-xml) $(coverage-xml)))
$(call banner,Coverage report directory perms:)
@@ -405,7 +423,8 @@
## -----------------------------------------------------------------------
## Intent: Helper target used to exercise release script changes
## -----------------------------------------------------------------------
-include $(MAKEDIR)/release/onf-publish.mk
+# include $(MAKEDIR)/release/onf-publish.mk
+include $(legacy-mk)/release/onf-publish.mk
$(if $(DEBUG),$(warning LEAVE))