aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile59
1 files changed, 21 insertions, 38 deletions
diff --git a/Makefile b/Makefile
index 0f933ed40..ad4b0f594 100644
--- a/Makefile
+++ b/Makefile
@@ -146,7 +146,8 @@ CROSS_BUILD_TARGETS := \
# Dereference variable $(1), return value if non-empty, otherwise raise an error.
err_if_empty = $(if $(strip $($(1))),$(strip $($(1))),$(error Required variable $(1) value is undefined, whitespace, or empty))
-# Podman does not work w/o CGO_ENABLED, except in some very specific cases
+# Podman does not work w/o CGO_ENABLED, except in some very specific cases.
+# Windows and Mac (both podman-remote client only) require CGO_ENABLED=0.
CGO_ENABLED ?= 1
# Default to the native OS type and architecture unless otherwise specified
NATIVE_GOOS := $(shell env -u GOOS $(GO) env GOOS)
@@ -157,9 +158,11 @@ GOARCH ?= $(NATIVE_GOARCH)
ifeq ($(call err_if_empty,GOOS),windows)
BINSFX := .exe
SRCBINDIR := bin/windows
+CGO_ENABLED := 0
else ifeq ($(GOOS),darwin)
BINSFX :=
SRCBINDIR := bin/darwin
+CGO_ENABLED := 0
else
BINSFX := -remote
SRCBINDIR := bin
@@ -261,7 +264,7 @@ codespell:
codespell -S bin,vendor,.git,go.sum,.cirrus.yml,"RELEASE_NOTES.md,*.xz,*.gz,*.ps1,*.tar,swagger.yaml,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go" -L pullrequest,uint,iff,od,seeked,splitted,marge,erro,hist,ether -w
.PHONY: validate
-validate: lint .gitvalidation validate.completions man-page-check swagger-check tests-included tests-expect-exit
+validate: lint .gitvalidation validate.completions man-page-check swagger-check tests-included tests-expect-exit pr-removes-fixed-skips
.PHONY: build-all-new-commits
build-all-new-commits:
@@ -302,7 +305,8 @@ endif
$(SRCBINDIR):
mkdir -p $(SRCBINDIR)
-$(SRCBINDIR)/podman$(BINSFX): $(SRCBINDIR) $(SOURCES) go.mod go.sum
+# '|' is to ignore SRCBINDIR mtime; see: info make 'Types of Prerequisites'
+$(SRCBINDIR)/podman$(BINSFX): $(SOURCES) go.mod go.sum | $(SRCBINDIR)
$(GOCMD) build \
$(BUILDFLAGS) \
$(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \
@@ -322,28 +326,13 @@ $(SRCBINDIR)/podman-remote-static: $(SRCBINDIR) $(SOURCES) go.mod go.sum
.PHONY: podman
podman: bin/podman
+# This will map to the right thing on Linux, Windows, and Mac.
.PHONY: podman-remote
-podman-remote: $(SRCBINDIR) $(SRCBINDIR)/podman$(BINSFX) ## Build podman-remote binary
-
-# A wildcard podman-remote-% target incorrectly sets GOOS for release targets
-.PHONY: podman-remote-linux
-podman-remote-linux: ## Build podman-remote for Linux
- $(MAKE) \
- CGO_ENABLED=0 \
- GOOS=linux \
- GOARCH=$(GOARCH) \
- bin/podman-remote
+podman-remote: $(SRCBINDIR)/podman$(BINSFX)
PHONY: podman-remote-static
podman-remote-static: $(SRCBINDIR)/podman-remote-static
-.PHONY: podman-remote-windows
-podman-remote-windows: ## Build podman-remote for Windows
- $(MAKE) \
- CGO_ENABLED=0 \
- GOOS=windows \
- bin/windows/podman.exe
-
.PHONY: podman-winpath
podman-winpath: $(SOURCES) go.mod go.sum
CGO_ENABLED=0 \
@@ -354,14 +343,6 @@ podman-winpath: $(SOURCES) go.mod go.sum
-o bin/windows/winpath.exe \
./cmd/winpath
-.PHONY: podman-remote-darwin
-podman-remote-darwin: podman-mac-helper ## Build podman-remote for macOS
- $(MAKE) \
- CGO_ENABLED=$(DARWIN_GCO) \
- GOOS=darwin \
- GOARCH=$(GOARCH) \
- bin/darwin/podman
-
.PHONY: podman-mac-helper
podman-mac-helper: ## Build podman-mac-helper for macOS
CGO_ENABLED=0 \
@@ -456,8 +437,10 @@ docdir:
docs: $(MANPAGES) ## Generate documentation
# docs/remote-docs.sh requires a locally executable 'podman-remote' binary
-# in addition to the target-archetecture binary (if any).
-podman-remote-%-docs: podman-remote-$(call err_if_empty,NATIVE_GOOS)
+# in addition to the target-architecture binary (if different). That's
+# what the NATIVE_GOOS make does in the first line.
+podman-remote-%-docs: podman-remote
+ $(MAKE) podman-remote GOOS=$(NATIVE_GOOS)
$(eval GOOS := $*)
$(MAKE) docs $(MANPAGES)
rm -rf docs/build/remote
@@ -638,6 +621,10 @@ tests-expect-exit:
exit 1; \
fi
+.PHONY: pr-removes-fixed-skips
+pr-removes-fixed-skips:
+ contrib/cirrus/pr-removes-fixed-skips
+
###
### Release/Packaging targets
###
@@ -685,9 +672,9 @@ podman-remote-release-%.zip: test/version/version ## Build podman-remote for %=$
clean-binaries podman-remote-$(GOOS)-docs
if [[ "$(GOARCH)" != "$(NATIVE_GOARCH)" ]]; then \
$(MAKE) CGO_ENABLED=0 $(GOPLAT) BUILDTAGS="$(BUILDTAGS_CROSS)" \
- clean-binaries podman-remote-$(GOOS); \
+ clean-binaries podman-remote; \
else \
- $(MAKE) $(GOPLAT) podman-remote-$(GOOS); \
+ $(MAKE) $(GOPLAT) podman-remote; \
fi
cp -r ./docs/build/remote/$(GOOS) "$(TMPDIR)/$(SUBDIR)/docs/"
cp ./contrib/remote/containers.conf "$(TMPDIR)/$(SUBDIR)/"
@@ -700,7 +687,7 @@ podman-remote-release-%.zip: test/version/version ## Build podman-remote for %=$
.PHONY: podman.msi
podman.msi: test/version/version ## Build podman-remote, package for installation on Windows
$(MAKE) podman-v$(call err_if_empty,RELEASE_NUMBER).msi
-podman-v%.msi: test/version/version podman-remote-windows podman-remote-windows-docs podman-winpath win-sshproxy
+podman-v%.msi: test/version/version podman-remote podman-remote-windows-docs podman-winpath win-sshproxy
$(eval DOCFILE := docs/build/remote/windows)
find $(DOCFILE) -print | \
wixl-heat --var var.ManSourceDir --component-group ManFiles \
@@ -842,7 +829,7 @@ install.systemd:
endif
.PHONY: install.tools
-install.tools: .install.ginkgo .install.golangci-lint .install.bats ## Install needed tools
+install.tools: .install.ginkgo .install.golangci-lint ## Install needed tools
make -C test/tools
.PHONY: .install.ginkgo
@@ -859,10 +846,6 @@ install.tools: .install.ginkgo .install.golangci-lint .install.bats ## Install n
make -C test/tools build/go-md2man ; \
fi
-.PHONY: .install.bats
-.install.bats:
- VERSION=v1.1.0 ./hack/install_bats.sh
-
.PHONY: .install.pre-commit
.install.pre-commit:
if [ -z "$(PRE_COMMIT)" ]; then \