diff --git a/Makefile b/Makefile index e9ffe1f40113..f7f505bc78f6 100644 --- a/Makefile +++ b/Makefile @@ -310,7 +310,7 @@ otel-from-tree: # 2. Run `make otel-from-tree` (only need to run it once to remap go modules) # 3. You can now build contrib and it will use your local otel core changes. # 4. Before committing/pushing your contrib changes, undo by running `make otel-from-lib`. - $(MAKE) for-all CMD="$(GOCMD) mod edit -replace go.opentelemetry.io/collector=$(SRC_ROOT)/../opentelemetry-collector" + $(MAKE) for-all CMD="$(GOCMD) mod edit -replace go.opentelemetry.io/collector=$(SRC_PARENT_DIR)/opentelemetry-collector" .PHONY: otel-from-lib otel-from-lib: diff --git a/Makefile.Common b/Makefile.Common index ddb3194f9c9a..0d19f3c8e57e 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -20,6 +20,8 @@ endif # SRC_ROOT is the top of the source tree. SRC_ROOT := $(shell git rev-parse --show-toplevel) +# SRC_PARENT_DIR is the absolute path of source tree's parent directory +SRC_PARENT_DIR := $(shell dirname $(SRC_ROOT)) # build tags required by any component should be defined as an independent variables and later added to GO_BUILD_TAGS below GO_BUILD_TAGS=""