Skip to content

Commit

Permalink
[Makefile] Fix issues with common targets
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski committed May 10, 2022
1 parent 58c4b8b commit 8611cb6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ all-modules:
@echo $(ALL_MODULES) | tr ' ' '\n' | sort

.PHONY: all
all: common gotest otelcontribcol otelcontribcol-unstable
all: all-common gotest otelcontribcol otelcontribcol-unstable

.PHONY: all-common
all-common:
@$(MAKE) for-all-target TARGET="common"

.PHONY: e2e-test
e2e-test: otelcontribcol otelcontribcol-unstable otelcontribcol-testbed
Expand Down
30 changes: 18 additions & 12 deletions Makefile.Common
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# SRC_ROOT is the top of the source tree.
SRC_ROOT := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))

ALL_SRC := $(shell find . -name '*.go' \
-not -path '*/third_party/*' \
-type f | sort)

# All source code and documents. Used in spell check.
ALL_SRC_AND_DOC := $(shell find . \( -name "*.md" -o -name "*.go" -o -name "*.yaml" \) \
-type f | sort)

# ALL_PKGS is used with 'go cover'
ALL_PKGS := $(shell $(GOCMD) list $(sort $(dir $(ALL_SRC))) 2>/dev/null)

# build tags required by any component should be defined as an independent variables and later added to GO_BUILD_TAGS below
GO_BUILD_TAGS=""
GOTEST_OPT?= -race -v -timeout 300s --tags=$(GO_BUILD_TAGS)
Expand All @@ -30,16 +19,33 @@ IMPI=impi
# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release

ALL_PKG_DIRS := $(shell $(GOCMD) list -f '{{ .Dir }}' ./... | sort)

ALL_SRC := $(shell find $(ALL_PKG_DIRS) -name '*.go' \
-not -path '*/third_party/*' \
-type f | sort)

# All source code and documents. Used in spell check.
ALL_SRC_AND_DOC := $(shell find $(ALL_PKG_DIRS) -name "*.md" -o -name "*.go" -o -name "*.yaml" \
-not -path '*/third_party/*' \
-type f | sort)

# ALL_PKGS is used with 'go cover'
ALL_PKGS := $(shell $(GOCMD) list $(sort $(dir $(ALL_SRC))))

all-pkgs:
@echo $(ALL_PKGS) | tr ' ' '\n' | sort

all-srcs:
@echo $(ALL_SRC) | tr ' ' '\n' | sort

all-pkg-dirs:
@echo $(ALL_PKG_DIRS) | tr ' ' '\n' | sort

.DEFAULT_GOAL := common

.PHONY: common
common: checklicense checkdoc impi lint misspell
common: checklicense impi lint misspell

.PHONY: test
test:
Expand Down

0 comments on commit 8611cb6

Please sign in to comment.