You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,15 @@
6
6
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
7
7
# SPDX-License-Identifier: Apache-2.0
8
8
9
+
# macOS ships with make 3.81 from 2006, which does not support all the features that we want (e.g. --warn-undefined-variables)
10
+
ifeq ($(MAKE_VERSION),3.81)
11
+
ifeq (,$(shell which gmake 2>/dev/null))
12
+
$(error We do not support this "make" version ($(MAKE_VERSION)) which is two decades old. Please install a newer version, e.g. using "brew install make")
13
+
else
14
+
$(error We do not support this "make" version ($(MAKE_VERSION)) which is two decades old. You have a newer GNU make installed, so please run "gmake" instead)
15
+
endif
16
+
endif
17
+
9
18
MAKEFLAGS=--warn-undefined-variables
10
19
# /bin/sh is dash on Debian which does not support all features of ash/bash
11
20
# to fix that we use /bin/bash only on Debian to not break Alpine
@@ -35,7 +44,7 @@ install-modernize: FORCE
35
44
@if !hash modernize 2>/dev/null;thenprintf"\e[1;36m>> Installing modernize (this may take a while)...\e[0m\n"; go install golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest;fi
@if !hash go-licence-detector 2>/dev/null;thenprintf"\e[1;36m>> Installing go-licence-detector (this may take a while)...\e[0m\n"; go install go.elastic.co/go-licence-detector@latest;fi
@@ -54,7 +63,7 @@ install-controller-gen: FORCE
54
63
install-setup-envtest: FORCE
55
64
@if !hash setup-envtest 2>/dev/null;thenprintf"\e[1;36m>> Installing setup-envtest (this may take a while)...\e[0m\n"; go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest;fi
56
65
57
-
# To add additional flags or values, specify the variable in the environment, e.g. `GO_BUILDFLAGS='-tags experimental' make`.
66
+
# To add additional flags or values (before the default ones), specify the variable in the environment, e.g. `GO_BUILDFLAGS='-tags experimental' make`.
58
67
# To override the default flags or values, specify the variable on the command line, e.g. `make GO_BUILDFLAGS='-tags experimental'`.
59
68
GO_BUILDFLAGS +=
60
69
GO_LDFLAGS +=
@@ -97,7 +106,7 @@ run-shellcheck: FORCE install-shellcheck
97
106
98
107
build/cover.out: FORCE generate install-setup-envtest | build
99
108
@printf "\e[1;36m>> Running tests\e[0m\n"
100
-
KUBEBUILDER_ASSETS=$$(setup-envtest use 1.31 -p path) go test -shuffle=on -p 1 -coverprofile=build/coverprofile.out $(GO_BUILDFLAGS) -ldflags '-s -w $(GO_LDFLAGS)' -covermode=count -coverpkg=$(subst$(space),$(comma),$(GO_COVERPKGS))$(GO_TESTFLAGS)$(GO_TESTPKGS)
109
+
KUBEBUILDER_ASSETS=$$(setup-envtest use 1.31 -p path) go test -shuffle=on -coverprofile=build/coverprofile.out $(GO_BUILDFLAGS) -ldflags '-s -w $(GO_LDFLAGS)' -covermode=count -coverpkg=$(subst$(space),$(comma),$(GO_COVERPKGS))$(GO_TESTFLAGS)$(GO_TESTPKGS)
0 commit comments