podman
/
Makefile
1054 строки · 40.2 Кб
1###
2### Makefile Navigation
3###
4#
5# This file is organized based on approximate end-to-end workflow:
6#
7# 1. Variables and common definitions are located at the top
8# to make finding them quicker.
9# 2. Main entry-point targets, like "default", "all", and "help"
10# 3. Targets for code formatting and validation
11# 4. Primary build targets, like podman and podman-remote
12# 5. Secondary build targets, shell completions, static and multi-arch.
13# 6. Targets that format and build documentation
14# 7. Testing targets
15# 8. Release and package-building targets
16# 9. Targets that install tools, utilities, binaries and packages
17# 10. Uninstall / Cleanup targets
18#
19###
20### Variables & Definitions
21###
22
23# Default shell `/bin/sh` has different meanings depending on the platform.
24SHELL := $(shell command -v bash;)25GO ?= go26GO_LDFLAGS:= $(shell if $(GO) version|grep -q gccgo ; then echo "-gccgoflags"; else echo "-ldflags"; fi)27GOCMD = CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO)28COVERAGE_PATH ?= .coverage29DESTDIR ?=30EPOCH_TEST_COMMIT ?= $(shell git merge-base $${DEST_BRANCH:-main} HEAD)31HEAD ?= HEAD32PROJECT := github.com/containers/podman33GIT_BASE_BRANCH ?= origin/main34LIBPOD_INSTANCE := libpod_dev35PREFIX ?= /usr/local36RELEASE_PREFIX = /usr37BINDIR ?= ${PREFIX}/bin38LIBEXECDIR ?= ${PREFIX}/libexec39LIBEXECPODMAN ?= ${LIBEXECDIR}/podman40MANDIR ?= ${PREFIX}/share/man41SHAREDIR_CONTAINERS ?= ${PREFIX}/share/containers42ETCDIR ?= /etc43LIBDIR ?= ${PREFIX}/lib44TMPFILESDIR ?= ${LIBDIR}/tmpfiles.d45USERTMPFILESDIR ?= ${PREFIX}/share/user-tmpfiles.d46MODULESLOADDIR ?= ${LIBDIR}/modules-load.d47SYSTEMDDIR ?= ${LIBDIR}/systemd/system48USERSYSTEMDDIR ?= ${LIBDIR}/systemd/user49SYSTEMDGENERATORSDIR ?= ${LIBDIR}/systemd/system-generators50USERSYSTEMDGENERATORSDIR ?= ${LIBDIR}/systemd/user-generators51REMOTETAGS ?= remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp52BUILDTAGS ?= \53$(shell hack/apparmor_tag.sh) \54$(shell hack/btrfs_installed_tag.sh) \55$(shell hack/btrfs_tag.sh) \56$(shell hack/systemd_tag.sh) \57$(shell hack/libsubid_tag.sh) \58exclude_graphdriver_devicemapper \
59seccomp
60# allow downstreams to easily add build tags while keeping our defaults
61BUILDTAGS += ${EXTRA_BUILDTAGS}62# N/B: This value is managed by Renovate, manual changes are
63# possible, as long as they don't disturb the formatting
64# (i.e. DO NOT ADD A 'v' prefix!)
65GOLANGCI_LINT_VERSION := 1.57.266PYTHON ?= $(shell command -v python3 python|head -n1)67PKG_MANAGER ?= $(shell command -v dnf yum|head -n1)68# ~/.local/bin is not in PATH on all systems
69PRE_COMMIT = $(shell command -v bin/venv/bin/pre-commit ~/.local/bin/pre-commit pre-commit | head -n1)70ifeq ($(shell uname -s),FreeBSD)71SED=gsed72GREP=ggrep73MAN_L= mandoc74# FreeBSD needs CNI until netavark is supported
75BUILDTAGS += cni76else
77SED=sed78GREP=grep79MAN_L= man -l80endif
81
82# This isn't what we actually build; it's a superset, used for target
83# dependencies. Basically: all *.go and *.c files, except *_test.go,
84# and except anything in a dot subdirectory. If any of these files is
85# newer than our target (bin/podman{,-remote}), a rebuild is
86# triggered.
87SOURCES = $(shell find . -path './.*' -prune -o \( \( -name '*.go' -o -name '*.c' \) -a ! -name '*_test.go' \) -print)88
89BUILDTAGS_CROSS ?= containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_graphdriver_overlay90CONTAINER_RUNTIME := $(shell command -v podman 2> /dev/null || echo docker)91OCI_RUNTIME ?= ""92
93# The 'sort' below is crucial: without it, 'make docs' behaves differently
94# on the first run than on subsequent ones, because the generated .md
95MANPAGES_SOURCE_DIR = docs/source/markdown96MANPAGES_MD_IN ?= $(wildcard $(MANPAGES_SOURCE_DIR)/*.md.in)97MANPAGES_MD_GENERATED ?= $(MANPAGES_MD_IN:%.md.in=%.md)98MANPAGES_MD ?= $(sort $(wildcard $(MANPAGES_SOURCE_DIR)/*.md) $(MANPAGES_MD_GENERATED))99MANPAGES ?= $(MANPAGES_MD:%.md=%)100MANPAGES_DEST ?= $(subst markdown,man, $(subst source,build,$(MANPAGES)))101
102BASHINSTALLDIR=${PREFIX}/share/bash-completion/completions103ZSHINSTALLDIR=${PREFIX}/share/zsh/site-functions104FISHINSTALLDIR=${PREFIX}/share/fish/vendor_completions.d105
106SELINUXOPT ?= $(shell test -x /usr/sbin/selinuxenabled && selinuxenabled && echo -Z)107
108
109COMMIT_NO ?= $(shell git rev-parse HEAD 2> /dev/null || true)110GIT_COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),$(call err_if_empty,COMMIT_NO)-dirty,$(COMMIT_NO))111DATE_FMT = %s112ifdef SOURCE_DATE_EPOCH113BUILD_INFO ?= $(shell date -u -d "@$(call err_if_empty,SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)")114else
115BUILD_INFO ?= $(shell date "+$(DATE_FMT)")116endif
117LIBPOD := ${PROJECT}/v5/libpod118GOFLAGS ?= -trimpath119LDFLAGS_PODMAN ?= \120$(if $(GIT_COMMIT),-X $(LIBPOD)/define.gitCommit=$(GIT_COMMIT),) \121$(if $(BUILD_INFO),-X $(LIBPOD)/define.buildInfo=$(BUILD_INFO),) \122-X $(LIBPOD)/config._installPrefix=$(PREFIX) \123-X $(LIBPOD)/config._etcDir=$(ETCDIR) \124-X $(PROJECT)/v5/pkg/systemd/quadlet._binDir=$(BINDIR) \125-X github.com/containers/common/pkg/config.additionalHelperBinariesDir=$(HELPER_BINARIES_DIR)\126$(EXTRA_LDFLAGS)127LDFLAGS_PODMAN_STATIC ?= \128$(LDFLAGS_PODMAN) \129-extldflags=-static130#Update to LIBSECCOMP_COMMIT should reflect in Dockerfile too.
131LIBSECCOMP_COMMIT := v2.3.3132# Rarely if ever should integration tests take more than 50min,
133# caller may override in special circumstances if needed.
134GINKGOTIMEOUT ?= -timeout=90m135# By default, run test/e2e
136GINKGOWHAT ?= test/e2e/.137GINKGO_PARALLEL=y138GINKGO ?= ./test/tools/build/ginkgo139# ginkgo json output is only useful in CI, not on developer runs
140GINKGO_JSON ?= $(if $(CI),--json-report ginkgo-e2e.json,)141
142# Allow control over some Ginkgo parameters
143GINKGO_FLAKE_ATTEMPTS ?= 3144GINKGO_NO_COLOR ?= y145
146# Conditional required to produce empty-output if binary not built yet.
147RELEASE_VERSION = $(shell if test -x test/version/version; then test/version/version; fi)148RELEASE_NUMBER = $(shell echo "$(call err_if_empty,RELEASE_VERSION)" | sed -e 's/^v\(.*\)/\1/')149
150# If non-empty, logs all output from server during remote system testing
151PODMAN_SERVER_LOG ?=152
153# Ensure GOBIN is not set so the default (`go env GOPATH`/bin) is used.
154override undefine GOBIN155# This must never include the 'hack' directory
156export PATH := $(shell $(GO) env GOPATH)/bin:$(PATH)157
158GOMD2MAN ?= ./test/tools/build/go-md2man159
160# There are many possibly unexpected places where podman is used. For example
161# by OpenWRT for routers and other similar small "edge" devices. Testing builds
162# for otherwise non-mainstream architectures ensures we catch platform-specific
163# toolchain shenanigans early, for example:
164# https://github.com/containers/podman/issues/8782
165CROSS_BUILD_TARGETS := \166bin/podman.cross.linux.amd64 \
167bin/podman.cross.linux.ppc64le \
168bin/podman.cross.linux.arm \
169bin/podman.cross.linux.arm64 \
170bin/podman.cross.linux.386 \
171bin/podman.cross.linux.s390x \
172bin/podman.cross.linux.loong64 \
173bin/podman.cross.linux.mips \
174bin/podman.cross.linux.mipsle \
175bin/podman.cross.linux.mips64 \
176bin/podman.cross.linux.mips64le \
177bin/podman.cross.linux.riscv64 \
178bin/podman.cross.freebsd.amd64 \
179bin/podman.cross.freebsd.arm64
180
181# Dereference variable $(1), return value if non-empty, otherwise raise an error.
182err_if_empty = $(if $(strip $($(1))),$(strip $($(1))),$(error Required variable $(1) value is undefined, whitespace, or empty))183
184# Podman does not work w/o CGO_ENABLED, except in some very specific cases.
185# Windows and Mac (both podman-remote client only) require CGO_ENABLED=0.
186CGO_ENABLED ?= 1187# Default to the native OS type and architecture unless otherwise specified
188NATIVE_GOOS := $(shell env -u GOOS $(GO) env GOOS)189GOOS ?= $(call err_if_empty,NATIVE_GOOS)190# Default to the native architecture type
191NATIVE_GOARCH := $(shell env -u GOARCH $(GO) env GOARCH)192GOARCH ?= $(NATIVE_GOARCH)193ifeq ($(call err_if_empty,GOOS),windows)194BINSFX := .exe195SRCBINDIR := bin/windows196CGO_ENABLED := 0197else ifeq ($(GOOS),darwin)198BINSFX :=199SRCBINDIR := bin/darwin200CGO_ENABLED := 0201else ifeq ($(GOOS),freebsd)202BINSFX := -remote203SRCBINDIR := bin204RELEASE_PREFIX = /usr/local205else
206BINSFX := -remote207SRCBINDIR := bin208endif
209# Necessary for nested-$(MAKE) calls and docs/remote-docs.sh
210export GOOS GOARCH CGO_ENABLED BINSFX SRCBINDIR211
212# Need to use CGO for mDNS resolution, but cross builds need CGO disabled
213# See https://github.com/golang/go/issues/12524 for details
214DARWIN_GCO := 0215ifeq ($(call err_if_empty,NATIVE_GOOS),darwin)216ifdef HOMEBREW_PREFIX217DARWIN_GCO := 1218endif
219endif
220
221# gvisor-tap-vsock version for gvproxy.exe and win-sshproxy.exe downloads
222# the upstream project ships pre-built binaries since version 0.7.1
223GV_VERSION=v0.7.3224
225###
226### Primary entry-point targets
227###
228
229.PHONY: default230default: all231
232.PHONY: all233all: binaries docs234
235.PHONY: binaries236ifeq ($(shell uname -s),FreeBSD)237binaries: podman podman-remote ## Build podman and podman-remote binaries238else ifneq (, $(findstring $(GOOS),darwin windows))239binaries: podman-remote ## Build podman-remote (client) only binaries240else
241binaries: podman podman-remote podmansh rootlessport quadlet ## Build podman, podman-remote and rootlessport binaries quadlet242endif
243
244# Extract text following double-# for targets, as their description for
245# the `help` target. Otherwise these simple-substitutions are resolved
246# at reference-time (due to `=` and not `=:`).
247_HLP_TGTS_RX = '^[[:print:]]+:.*?\#\# .*$$'248_HLP_TGTS_CMD = $(GREP) -E $(_HLP_TGTS_RX) $(MAKEFILE_LIST)249_HLP_TGTS_LEN = $(shell $(call err_if_empty,_HLP_TGTS_CMD) | cut -d : -f 1 | wc -L 2>/dev/null || echo "PARSING_ERROR")250# Separated condition for Darwin
251ifeq ($(shell uname -s)$(_HLP_TGTS_LEN),DarwinPARSING_ERROR)252ifneq (,$(wildcard /usr/local/bin/gwc))253_HLP_TGTS_LEN = $(shell $(call err_if_empty,_HLP_TGTS_CMD) | cut -d : -f 1 | gwc -L)254else
255$(warning On Darwin (MacOS) installed coreutils is necessary)256$(warning Use 'brew install coreutils' command to install coreutils on your system)257endif
258endif
259_HLPFMT = "%-$(call err_if_empty,_HLP_TGTS_LEN)s %s\n"260.PHONY: help261help: ## (Default) Print listing of key targets with their descriptions262@printf $(_HLPFMT) "Target:" "Description:"263@printf $(_HLPFMT) "--------------" "--------------------"264@$(_HLP_TGTS_CMD) | sort | \265awk 'BEGIN {FS = ":(.*)?## "}; \266{printf $(_HLPFMT), $$1, $$2}'
267
268###
269### Linting/Formatting/Code Validation targets
270###
271
272.PHONY: .gitvalidation273.gitvalidation: .install.gitvalidation274@echo "Validating vs commit '$(call err_if_empty,EPOCH_TEST_COMMIT)'"275GIT_CHECK_EXCLUDE="./vendor:./test/tools/vendor:docs/make.bat:test/buildah-bud/buildah-tests.diff:test/e2e/quadlet/remap-keep-id2.container" ./test/tools/build/git-validation -run short-subject -range $(EPOCH_TEST_COMMIT)..$(HEAD)276
277.PHONY: lint278lint: golangci-lint279@echo "Linting vs commit '$(call err_if_empty,EPOCH_TEST_COMMIT)'"280ifeq ($(PRE_COMMIT),)281@echo "FATAL: pre-commit was not found, make .install.pre-commit to installing it." >&2282@exit 2283endif
284$(PRE_COMMIT) run -a285
286.PHONY: golangci-lint287golangci-lint: .install.golangci-lint288hack/golangci-lint.sh run
289
290.PHONY: test/checkseccomp/checkseccomp291test/checkseccomp/checkseccomp: $(wildcard test/checkseccomp/*.go)292$(GOCMD) build $(BUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -tags "$(BUILDTAGS)" -o $@ ./test/checkseccomp293
294.PHONY: test/testvol/testvol295test/testvol/testvol: $(wildcard test/testvol/*.go)296$(GOCMD) build -o $@ ./test/testvol297
298.PHONY: volume-plugin-test-img299volume-plugin-test-img:300./bin/podman build --network none -t quay.io/libpod/volume-plugin-test-img:$$(date +%Y%m%d) -f ./test/testvol/Containerfile .301
302.PHONY: test/goecho/goecho303test/goecho/goecho: $(wildcard test/goecho/*.go)304$(GOCMD) build $(BUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -o $@ ./test/goecho305
306# The ./test/version/version binary is executed in other make steps
307# so we have to make sure the version binary is built for NATIVE_GOARCH.
308test/version/version: version/version.go309GOARCH=$(NATIVE_GOARCH) $(GO) build -o $@ ./test/version/310
311.PHONY: codespell312codespell:313codespell -S bin,vendor,.git,go.sum,.cirrus.yml,"*.fish,RELEASE_NOTES.md,*.xz,*.gz,*.ps1,*.tar,swagger.yaml,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go" -L secon,passt,bu,hastable,te,clos,ans,pullrequest,uint,iff,od,seeked,splitted,marge,erro,hist,ether,specif -w314
315.PHONY: validate316validate: lint .gitvalidation validate.completions man-page-check swagger-check tests-expect-exit pr-removes-fixed-skips317
318.PHONY: validatepr319validatepr:320$(PODMANCMD) run --rm --env HOME=/root \321-v $(CURDIR):/var/tmp/go/src/github.com/containers/podman \322--security-opt label=disable \323quay.io/libpod/fedora_podman:latest \324make .validatepr
325
326.PHONY: .validatepr327.validatepr:328env BUILDTAGS="$(BUILDTAGS)" REMOTETAGS="$(REMOTETAGS)" contrib/validatepr/validatepr.sh329
330.PHONY: build-all-new-commits331build-all-new-commits:332# Validate that all the commits build on top of $(GIT_BASE_BRANCH)333git rebase $(call err_if_empty,GIT_BASE_BRANCH) -x "$(MAKE)"334
335.PHONY: vendor336vendor:337$(GO) mod tidy338$(GO) mod vendor339$(GO) mod verify340
341
342# We define *-in-container targets for the following make targets. This allow the targets to be run in a container.
343# Note that the PODMANCMD can also be overridden to allow a different container CLI to be used on systems where podman is not already available.
344IN_CONTAINER_TARGETS = vendor validate345PODMANCMD ?= podman346IN_CONTAINER = $(patsubst %,%-in-container,$(IN_CONTAINER_TARGETS))347
348.PHONY: $(IN_CONTAINER)349$(IN_CONTAINER): %-in-container:350$(PODMANCMD) run --rm --env HOME=/root \351-v $(CURDIR):/src -w /src \352--security-opt label=disable \353docker.io/library/golang:1.20 \354make $(*)355
356
357###
358### Primary binary-build targets
359###
360
361# Make sure to warn in case we're building without the systemd buildtag.
362bin/podman: $(SOURCES) go.mod go.sum363ifeq (,$(findstring systemd,$(BUILDTAGS)))364@echo "Podman is being compiled without the systemd build tag. \365Install libsystemd on Ubuntu or systemd-devel on rpm based \
366distro for journald support."
367endif
368$(GOCMD) build \369$(BUILDFLAGS) \370$(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \371-tags "$(BUILDTAGS)" \372-o $@ ./cmd/podman373test -z "${SELINUXOPT}" || chcon -t container_runtime_exec_t $@374
375# Disambiguate Linux vs Darwin/Windows platform binaries under distinct "bin" dirs
376$(SRCBINDIR):377mkdir -p $(SRCBINDIR)378
379# '|' is to ignore SRCBINDIR mtime; see: info make 'Types of Prerequisites'
380$(SRCBINDIR)/podman$(BINSFX): $(SOURCES) go.mod go.sum | $(SRCBINDIR)381$(GOCMD) build \382$(BUILDFLAGS) \383$(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \384-tags "${REMOTETAGS}" \385-o $@ ./cmd/podman386
387$(SRCBINDIR)/podman-remote-static-linux_%: GOARCH = $(patsubst $(SRCBINDIR)/podman-remote-static-linux_%,%,$@)388$(SRCBINDIR)/podman-remote-static $(SRCBINDIR)/podman-remote-static-linux_amd64 $(SRCBINDIR)/podman-remote-static-linux_arm64: $(SRCBINDIR) $(SOURCES) go.mod go.sum389CGO_ENABLED=0 \390GOOS=linux \391$(GO) build \392$(BUILDFLAGS) \393$(GO_LDFLAGS) '$(LDFLAGS_PODMAN_STATIC)' \394-tags "${REMOTETAGS}" \395-o $@ ./cmd/podman396
397.PHONY: podman398podman: bin/podman399
400# This will map to the right thing on Linux, Windows, and Mac.
401.PHONY: podman-remote402podman-remote: $(SRCBINDIR)/podman$(BINSFX)403
404$(SRCBINDIR)/quadlet: $(SOURCES) go.mod go.sum405$(GOCMD) build \406$(BUILDFLAGS) \407$(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \408-tags "${BUILDTAGS}" \409-o $@ ./cmd/quadlet410
411.PHONY: quadlet412quadlet: bin/quadlet413
414.PHONY: podman-remote-static podman-remote-static-linux_amd64 podman-remote-static-linux_arm64415podman-remote-static: $(SRCBINDIR)/podman-remote-static416podman-remote-static-linux_amd64: $(SRCBINDIR)/podman-remote-static-linux_amd64417podman-remote-static-linux_arm64: $(SRCBINDIR)/podman-remote-static-linux_arm64418
419.PHONY: podman-winpath420podman-winpath: $(SOURCES) go.mod go.sum421CGO_ENABLED=0 \422GOOS=windows \423$(GO) build \424$(BUILDFLAGS) \425-ldflags -H=windowsgui \426-o bin/windows/winpath.exe \
427./cmd/winpath
428
429.PHONY: podman-mac-helper430podman-mac-helper: ## Build podman-mac-helper for macOS431CGO_ENABLED=0 \432GOOS=darwin \433GOARCH=$(GOARCH) \434$(GO) build \435$(BUILDFLAGS) \436-o bin/darwin/podman-mac-helper \
437./cmd/podman-mac-helper
438
439bin/rootlessport: $(SOURCES) go.mod go.sum440CGO_ENABLED=$(CGO_ENABLED) \441$(GO) build \442$(BUILDFLAGS) \443-o $@ ./cmd/rootlessport444
445.PHONY: rootlessport446rootlessport: bin/rootlessport447
448# podmansh calls `podman exec` into the `podmansh` container when used as
449# os.Args[0] and is intended to be set as a login shell for users.
450# Run: `man 1 podmansh` for details.
451podmansh: bin/podman452if [ ! -f bin/podmansh ]; then ln -s podman bin/podmansh; fi453
454###
455### Secondary binary-build targets
456###
457
458.PHONY: generate-bindings459generate-bindings:460ifneq ($(GOOS),darwin)461$(GOCMD) generate ./pkg/bindings/... ;462endif
463
464# DO NOT USE: use local-cross instead
465bin/podman.cross.%:466TARGET="$*"; \467GOOS="$${TARGET%%.*}"; \468GOARCH="$${TARGET##*.}"; \469CGO_ENABLED=0 \470$(GO) build \471$(BUILDFLAGS) \472$(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \473-tags '$(BUILDTAGS_CROSS)' \474-o "$@" ./cmd/podman475
476.PHONY: local-cross477local-cross: $(CROSS_BUILD_TARGETS) ## Cross compile podman binary for multiple architectures478
479.PHONY: cross480cross: local-cross481
482.PHONY: completions483completions: podman podman-remote484# key = shell, value = completion filename485declare -A outfiles=([bash]=%s [zsh]=_%s [fish]=%s.fish [powershell]=%s.ps1);\486for shell in $${!outfiles[*]}; do \487for remote in "" "-remote"; do \488podman="podman$$remote"; \489outfile=$$(printf "completions/$$shell/$${outfiles[$$shell]}" $$podman); \490./bin/$$podman completion $$shell >| $$outfile; \491done;\492done
493
494###
495### Documentation targets
496###
497
498pkg/api/swagger.yaml: .install.swagger499make -C pkg/api
500
501$(MANPAGES_MD_GENERATED): %.md: %.md.in $(MANPAGES_SOURCE_DIR)/options/*.md502hack/markdown-preprocess
503
504$(MANPAGES): OUTFILE=$(subst source/markdown,build/man,$@)505$(MANPAGES): %: %.md .install.md2man docdir506
507# This does a bunch of filtering needed for man pages:
508# 1. Strip markdown link targets like '[podman(1)](podman.1.md)'
509# to just '[podman(1)]', because man pages have no link mechanism;
510# 2. Then remove the brackets: '[podman(1)]' -> 'podman(1)';
511# 3. Then do the same for all other markdown links,
512# like '[cgroups(7)](https://.....)' -> just 'cgroups(7)';
513# 4. Remove HTML-ish stuff like '<sup>..</sup>' and '<a>..</a>'
514# 5. Replace "\" (backslash) at EOL with two spaces (no idea why)
515# Then two sanity checks:
516# 1. test for "included file options/blahblah"; this indicates a failure
517# in the markdown-preprocess tool; and
518# 2. run 'man -l' against the generated man page, and check for tables
519# with an empty right-hand column followed by an empty left-hand
520# column on the next line. (Technically, on the next-next line,
521# because the next line must be table borders). This is a horrible
522# unmaintainable rats-nest of duplication, obscure grep options, and
523# ASCII art. I (esm) believe the cost of releasing corrupt man pages
524# is higher than the cost of carrying this kludge.
525#
526@$(SED) -e 's/\((podman[^)]*\.md\(#.*\)\?)\)//g' \527-e 's/\[\(podman[^]]*\)\]/\1/g' \528-e 's/\[\([^]]*\)](http[^)]\+)/\1/g' \529-e 's;<\(/\)\?\(a\|a\s\+[^>]*\|sup\)>;;g' \530-e 's/\\$$/ /g' $< |\531$(GOMD2MAN) -out $(OUTFILE)532@if grep 'included file options/' $(OUTFILE); then \533echo "FATAL: man pages must not contain ^^^^ in $(OUTFILE)"; exit 1; \534fi
535@if $(MAN_L) $(OUTFILE)| $(GREP) -Pazoq '│\s+│\n\s+├─+┼─+┤\n\s+│\s+│'; then \536echo "FATAL: $< has a too-long table column; use 'man -l $(OUTFILE)' and look for empty table cells."; exit 1; \537fi
538
539.PHONY: docdir540docdir:541mkdir -p docs/build/man
542
543.PHONY: docs544docs: $(MANPAGES) ## Generate documentation545@ln -sf $(CURDIR)/docs/source/markdown/links/* docs/build/man/546
547# docs/remote-docs.sh requires a locally executable 'podman-remote' binary
548# in addition to the target-architecture binary (if different). That's
549# what the NATIVE_GOOS make does in the first line.
550podman-remote-%-docs: podman-remote551$(MAKE) clean-binaries552$(MAKE) podman-remote GOOS=$(NATIVE_GOOS) GOARCH=$(NATIVE_GOARCH)553$(eval GOOS := $*)554$(MAKE) docs $(MANPAGES)555rm -rf docs/build/remote
556mkdir -p docs/build/remote
557ln -sf $(CURDIR)/docs/source/markdown/links docs/build/man/558docs/remote-docs.sh \
559$(GOOS) \560docs/build/remote/$* \561$(if $(findstring windows,$*),docs/source/markdown,docs/build/man)562
563.PHONY: man-page-check564man-page-check: bin/podman docs565hack/man-page-checker
566hack/xref-helpmsgs-manpages
567hack/man-page-table-check
568hack/xref-quadlet-docs
569
570.PHONY: swagger-check571swagger-check:572hack/swagger-check
573
574.PHONY: swagger575swagger: pkg/api/swagger.yaml576
577.PHONY: docker-docs578docker-docs: docs579(cd docs; ./dckrman.sh ./build/man/*.1)580
581# Workaround vim syntax highlighting bug: "
582
583###
584### Utility and Testing targets
585###
586
587.PHONY: validate.completions588validate.completions: SHELL:=/usr/bin/env bash # Set shell to bash for this target589validate.completions:590# Check if the files can be loaded by the shell591. completions/bash/podman
592if [ -x /bin/zsh ]; then /bin/zsh completions/zsh/_podman; fi593if [ -x /bin/fish ]; then /bin/fish completions/fish/podman.fish; fi594
595# Note: Assumes test/python/requirements.txt is installed & available
596.PHONY: run-docker-py-tests597run-docker-py-tests:598touch test/__init__.py
599env CONTAINERS_CONF=$(CURDIR)/test/apiv2/containers.conf pytest --disable-warnings test/python/docker/600rm -f test/__init__.py
601
602.PHONY: localunit603localunit: test/goecho/goecho test/version/version604rm -rf ${COVERAGE_PATH} && mkdir -p ${COVERAGE_PATH}605UNIT=1 $(GINKGO) \606-r \
607$(TESTFLAGS) \608--skip-package test/e2e,pkg/bindings,hack,pkg/machine/e2e \
609--cover \
610--covermode atomic \
611--coverprofile coverprofile \
612--output-dir ${COVERAGE_PATH} \613--tags "$(BUILDTAGS)" \614--succinct
615$(GO) tool cover -html=${COVERAGE_PATH}/coverprofile -o ${COVERAGE_PATH}/coverage.html616$(GO) tool cover -func=${COVERAGE_PATH}/coverprofile > ${COVERAGE_PATH}/functions617cat ${COVERAGE_PATH}/functions | sed -n 's/\(total:\).*\([0-9][0-9].[0-9]\)/\1 \2/p'618
619.PHONY: test620test: localunit localintegration remoteintegration localsystem remotesystem ## Run unit, integration, and system tests.621
622.PHONY: ginkgo-run623ginkgo-run: .install.ginkgo624$(GINKGO) version625$(GINKGO) -vv $(TESTFLAGS) --tags "$(TAGS) remote" $(GINKGOTIMEOUT) --flake-attempts $(GINKGO_FLAKE_ATTEMPTS) \626--trace $(if $(findstring y,$(GINKGO_NO_COLOR)),--no-color,) \627$(GINKGO_JSON) $(if $(findstring y,$(GINKGO_PARALLEL)),-p,) $(if $(FOCUS),--focus "$(FOCUS)",) \628$(if $(FOCUS_FILE),--focus-file "$(FOCUS_FILE)",) $(GINKGOWHAT) $(HACK)629
630.PHONY: ginkgo631ginkgo:632$(MAKE) ginkgo-run TAGS="$(BUILDTAGS)" HACK=hack/.633
634.PHONY: ginkgo-remote635ginkgo-remote:636$(MAKE) ginkgo-run TAGS="$(REMOTETAGS) remote_testing" HACK=637
638.PHONY: testbindings639testbindings: .install.ginkgo640$(GINKGO) -v $(TESTFLAGS) --tags "$(TAGS) remote" $(GINKGOTIMEOUT) --trace --no-color --timeout 30m -v -r ./pkg/bindings/test641
642.PHONY: localintegration643localintegration: test-binaries ginkgo644
645.PHONY: remoteintegration646remoteintegration: test-binaries ginkgo-remote647
648.PHONY: localmachine649localmachine:650# gitCommit needed by logformatter, to link to sources651@echo /define.gitCommit=$(GIT_COMMIT)652$(MAKE) ginkgo-run GINKGO_PARALLEL=n TAGS="$(REMOTETAGS)" GINKGO_FLAKE_ATTEMPTS=0 FOCUS_FILE=$(FOCUS_FILE) GINKGOWHAT=pkg/machine/e2e/. HACK=653
654.PHONY: localsystem655localsystem:656# Wipe existing config, database, and cache: start with clean slate.657$(RM) -rf ${HOME}/.local/share/containers ${HOME}/.config/containers658if timeout -v 1 true; then PODMAN=$(CURDIR)/bin/podman QUADLET=$(CURDIR)/bin/quadlet bats test/system/; else echo "Skipping $@: 'timeout -v' unavailable'"; fi659
660.PHONY: remotesystem661remotesystem:662# Wipe existing config, database, and cache: start with clean slate.663$(RM) -rf ${HOME}/.local/share/containers ${HOME}/.config/containers664# Start podman server using tmp socket; loop-wait for it;665# test podman-remote; kill server, clean up tmp socket file.666# podman server spews copious unhelpful output; ignore it.667rc=0;\668if timeout -v 1 true; then \669SOCK_FILE=$(shell mktemp --dry-run --tmpdir podman_tmp_XXXX);\670export PODMAN_SOCKET=unix://$$SOCK_FILE; \671./bin/podman system service --timeout=0 $$PODMAN_SOCKET > $(if $(PODMAN_SERVER_LOG),$(PODMAN_SERVER_LOG),/dev/null) 2>&1 & \672retry=5;\673while [ $$retry -ge 0 ]; do\674echo Waiting for server...;\675sleep 1;\676./bin/podman-remote --url $$PODMAN_SOCKET info >/dev/null 2>&1 && break;\677retry=$$(expr $$retry - 1);\678done;\679if [ $$retry -lt 0 ]; then\680echo "Error: ./bin/podman system service did not come up on $$SOCK_FILE" >&2;\681exit 1;\682fi;\683env PODMAN="$(CURDIR)/bin/podman-remote --url $$PODMAN_SOCKET" bats test/system/ ;\684rc=$$?;\685kill %1;\686rm -f $$SOCK_FILE;\687else \688echo "Skipping $@: 'timeout -v' unavailable'";\689fi;\690exit $$rc691
692.PHONY: localapiv2-bash693localapiv2-bash:694env PODMAN=./bin/podman stdbuf -o0 -e0 ./test/apiv2/test-apiv2695
696.PHONY: localapiv2-python697localapiv2-python:698env CONTAINERS_CONF=$(CURDIR)/test/apiv2/containers.conf PODMAN=./bin/podman \699pytest --verbose --disable-warnings ./test/apiv2/python
700touch test/__init__.py
701env CONTAINERS_CONF=$(CURDIR)/test/apiv2/containers.conf PODMAN=./bin/podman \702pytest --verbose --disable-warnings ./test/python/docker
703rm -f test/__init__.py
704
705# Order is important running python tests first causes the bash tests
706# to fail, see 12-imagesMore. FIXME order of tests should not matter
707.PHONY: localapiv2708localapiv2: localapiv2-bash localapiv2-python709
710.PHONY: remoteapiv2711remoteapiv2:712true
713
714.PHONY: system.test-binary715system.test-binary: .install.ginkgo716$(GO) test -c ./test/system717
718.PHONY: test-binaries719test-binaries: test/checkseccomp/checkseccomp test/goecho/goecho install.catatonit test/version/version720@echo "Canonical source version: $(call err_if_empty,RELEASE_VERSION)"721
722.PHONY: tests-included723tests-included:724contrib/cirrus/pr-should-include-tests725
726.PHONY: tests-expect-exit727tests-expect-exit:728@if grep -E --line-number 'Expect.*ExitCode' test/e2e/*.go | grep -E -v ', ".*"\)'; then \729echo "^^^ Unhelpful use of Expect(ExitCode())"; \730echo " Please use '.Should(Exit(...))' pattern instead."; \731echo " If that's not possible, please add an annotation (description) to your assertion:"; \732echo " Expect(...).To(..., \"Friendly explanation of this check\")"; \733exit 1; \734fi
735
736.PHONY: pr-removes-fixed-skips737pr-removes-fixed-skips:738contrib/cirrus/pr-removes-fixed-skips
739
740###
741### Release/Packaging targets
742###
743
744.PHONY: podman-release745podman-release: podman-release-$(GOARCH).tar.gz # Build all Linux binaries for $GOARCH, docs., and installation tree, into a tarball.746
747# The following two targets are nuanced and complex:
748# Cross-building the podman-remote documentation requires a functional
749# native architecture executable. However `make` only deals with
750# files/timestamps, it doesn't understand if an existing binary will
751# function on the system or not. This makes building cross-platform
752# releases incredibly accident-prone and fragile. The only practical
753# way to deal with this, is via multiple conditional (nested) `make`
754# calls along with careful manipulation of `$GOOS` and `$GOARCH`.
755
756podman-release-%.tar.gz: test/version/version757$(eval tmpsubdir := $(shell mktemp -d podman_tmp_XXXX))758$(eval releasedir := podman-v$(call err_if_empty,RELEASE_NUMBER))759$(eval _dstargs := "DESTDIR=$(tmpsubdir)/$(releasedir)" "PREFIX=$(RELEASE_PREFIX)")760$(eval GOARCH := $*)761mkdir -p "$(call err_if_empty,tmpsubdir)/$(releasedir)"762$(MAKE) GOOS=$(GOOS) GOARCH=$(NATIVE_GOARCH) \763clean-binaries docs podman-remote-$(GOOS)-docs764if [[ "$(GOARCH)" != "$(NATIVE_GOARCH)" ]]; then \765$(MAKE) CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) \766BUILDTAGS="$(BUILDTAGS_CROSS)" clean-binaries binaries; \767else \768$(MAKE) GOOS=$(GOOS) GOARCH=$(GOARCH) binaries; \769fi
770$(MAKE) $(_dstargs) install.bin install.remote install.man install.systemd771tar -czvf $@ --xattrs -C "$(tmpsubdir)" "./$(releasedir)"772if [[ "$(GOARCH)" != "$(NATIVE_GOARCH)" ]]; then $(MAKE) clean-binaries; fi773-rm -rf "$(tmpsubdir)"774
775podman-remote-release-%.zip: test/version/version ## Build podman-remote for %=$GOOS_$GOARCH, and docs. into an installation zip.776$(eval tmpsubdir := $(shell mktemp -d podman_tmp_XXXX))777$(eval releasedir := podman-$(call err_if_empty,RELEASE_NUMBER))778$(eval _dstargs := "DESTDIR=$(tmpsubdir)/$(releasedir)" "PREFIX=$(RELEASE_PREFIX)")779$(eval GOOS := $(firstword $(subst _, ,$*)))780$(eval GOARCH := $(lastword $(subst _, ,$*)))781$(eval _GOPLAT := GOOS=$(call err_if_empty,GOOS) GOARCH=$(call err_if_empty,GOARCH))782mkdir -p "$(call err_if_empty,tmpsubdir)/$(releasedir)"783$(MAKE) GOOS=$(GOOS) GOARCH=$(GOARCH) \784clean-binaries podman-remote-$(GOOS)-docs785if [[ "$(GOARCH)" != "$(NATIVE_GOARCH)" ]]; then \786$(MAKE) CGO_ENABLED=0 $(GOPLAT) BUILDTAGS="$(BUILDTAGS_CROSS)" \787clean-binaries podman-remote; \788else \789$(MAKE) $(GOPLAT) podman-remote; \790fi
791if [[ "$(GOOS)" == "windows" ]]; then \792$(MAKE) $(GOPLAT) TMPDIR="" win-gvproxy; \793fi
794if [[ "$(GOOS)" == "darwin" ]]; then \795$(MAKE) $(GOPLAT) podman-mac-helper;\796fi
797cp -r ./docs/build/remote/$(GOOS) "$(tmpsubdir)/$(releasedir)/docs/"798cp ./contrib/remote/containers.conf "$(tmpsubdir)/$(releasedir)/"799$(MAKE) $(GOPLAT) $(_dstargs) SELINUXOPT="" install.remote800cd "$(tmpsubdir)" && \801zip --recurse-paths "$(CURDIR)/$@" "./$(releasedir)"802if [[ "$(GOARCH)" != "$(NATIVE_GOARCH)" ]]; then $(MAKE) clean-binaries; fi803-rm -rf "$(tmpsubdir)"804
805# Checks out and builds win-sshproxy helper. See comment on GV_GITURL declaration
806.PHONY: win-gvproxy807win-gvproxy: test/version/version808mkdir -p bin/windows/
809curl -sSL -o bin/windows/gvproxy.exe --retry 5 https://github.com/containers/gvisor-tap-vsock/releases/download/$(GV_VERSION)/gvproxy-windowsgui.exe810curl -sSL -o bin/windows/win-sshproxy.exe --retry 5 https://github.com/containers/gvisor-tap-vsock/releases/download/$(GV_VERSION)/win-sshproxy.exe811
812.PHONY: rpm813rpm: ## Build rpm packages814$(MAKE) -C rpm815
816###
817### Installation targets
818###
819
820# Remember that rpms install exec to /usr/bin/podman while a `make install`
821# installs them to /usr/local/bin/podman which is likely before. Always use
822# a full path to test installed podman or you risk to call another executable.
823.PHONY: rpm-install824rpm-install: package ## Install rpm packages825$(call err_if_empty,PKG_MANAGER) -y install rpm/RPMS/*/*.rpm826/usr/bin/podman version
827/usr/bin/podman info # will catch a broken conmon828
829.PHONY: install830install: install.bin install.remote install.man install.systemd ## Install binaries to system locations831
832.PHONY: install.catatonit833install.catatonit:834./hack/install_catatonit.sh
835
836.PHONY: install.remote837install.remote:838install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(BINDIR)839install ${SELINUXOPT} -m 755 $(SRCBINDIR)/podman$(BINSFX) \840$(DESTDIR)$(BINDIR)/podman$(BINSFX)841test "${GOOS}" != "windows" || \842install -m 755 $(SRCBINDIR)/win-sshproxy.exe $(DESTDIR)$(BINDIR)843test "${GOOS}" != "windows" || \844install -m 755 $(SRCBINDIR)/gvproxy.exe $(DESTDIR)$(BINDIR)845test "${GOOS}" != "darwin" || \846install -m 755 $(SRCBINDIR)/podman-mac-helper $(DESTDIR)$(BINDIR)847test -z "${SELINUXOPT}" || \848chcon --verbose --reference=$(DESTDIR)$(BINDIR)/podman-remote \849bin/podman-remote
850
851.PHONY: install.bin852install.bin:853install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(BINDIR)854install ${SELINUXOPT} -m 755 bin/podman $(DESTDIR)$(BINDIR)/podman855ln -sf podman $(DESTDIR)$(BINDIR)/podmansh856test -z "${SELINUXOPT}" || chcon --verbose --reference=$(DESTDIR)$(BINDIR)/podman bin/podman857install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(LIBEXECPODMAN)858ifneq ($(shell uname -s),FreeBSD)859install ${SELINUXOPT} -m 755 bin/rootlessport $(DESTDIR)$(LIBEXECPODMAN)/rootlessport860test -z "${SELINUXOPT}" || chcon --verbose --reference=$(DESTDIR)$(LIBEXECPODMAN)/rootlessport bin/rootlessport861install ${SELINUXOPT} -m 755 bin/quadlet $(DESTDIR)$(LIBEXECPODMAN)/quadlet862install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(SYSTEMDGENERATORSDIR)863ln -sfr $(DESTDIR)$(LIBEXECPODMAN)/quadlet $(DESTDIR)$(SYSTEMDGENERATORSDIR)/podman-system-generator864install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(USERSYSTEMDGENERATORSDIR)865ln -sfr $(DESTDIR)$(LIBEXECPODMAN)/quadlet $(DESTDIR)$(USERSYSTEMDGENERATORSDIR)/podman-user-generator866install ${SELINUXOPT} -m 755 -d $(DESTDIR)${TMPFILESDIR}867install ${SELINUXOPT} -m 644 contrib/tmpfile/podman.conf $(DESTDIR)${TMPFILESDIR}/podman.conf868endif
869
870.PHONY: install.modules-load871install.modules-load: # This should only be used by distros which might use iptables-legacy, this is not needed on RHEL872install ${SELINUXOPT} -m 755 -d $(DESTDIR)${MODULESLOADDIR}873install ${SELINUXOPT} -m 644 contrib/modules-load.d/podman-iptables.conf $(DESTDIR)${MODULESLOADDIR}/podman-iptables.conf874
875.PHONY: install.man876install.man:877install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(MANDIR)/man1878install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(MANDIR)/man5879install ${SELINUXOPT} -m 644 $(filter %.1,$(MANPAGES_DEST)) $(DESTDIR)$(MANDIR)/man1880install ${SELINUXOPT} -m 644 docs/source/markdown/links/*1 $(DESTDIR)$(MANDIR)/man1881install ${SELINUXOPT} -m 644 $(filter %.5,$(MANPAGES_DEST)) $(DESTDIR)$(MANDIR)/man5882install ${SELINUXOPT} -m 644 docs/source/markdown/links/*5 $(DESTDIR)$(MANDIR)/man5883
884.PHONY: install.completions885install.completions:886install ${SELINUXOPT} -d -m 755 $(DESTDIR)${BASHINSTALLDIR}887install ${SELINUXOPT} -m 644 completions/bash/podman $(DESTDIR)${BASHINSTALLDIR}888install ${SELINUXOPT} -m 644 completions/bash/podman-remote $(DESTDIR)${BASHINSTALLDIR}889install ${SELINUXOPT} -d -m 755 $(DESTDIR)${ZSHINSTALLDIR}890install ${SELINUXOPT} -m 644 completions/zsh/_podman $(DESTDIR)${ZSHINSTALLDIR}891install ${SELINUXOPT} -m 644 completions/zsh/_podman-remote $(DESTDIR)${ZSHINSTALLDIR}892install ${SELINUXOPT} -d -m 755 $(DESTDIR)${FISHINSTALLDIR}893install ${SELINUXOPT} -m 644 completions/fish/podman.fish $(DESTDIR)${FISHINSTALLDIR}894install ${SELINUXOPT} -m 644 completions/fish/podman-remote.fish $(DESTDIR)${FISHINSTALLDIR}895# There is no common location for powershell files so do not install them. Users have to source the file from their powershell profile.896
897.PHONY: install.docker898install.docker:899install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(BINDIR)900$(eval INTERPOLATED_DOCKER_SCRIPT := $(shell mktemp))901env BINDIR=${BINDIR} ETCDIR=${ETCDIR} envsubst < docker/docker.in > ${INTERPOLATED_DOCKER_SCRIPT}902install ${SELINUXOPT} -m 755 ${INTERPOLATED_DOCKER_SCRIPT} $(DESTDIR)$(BINDIR)/docker903rm ${INTERPOLATED_DOCKER_SCRIPT}904install ${SELINUXOPT} -m 755 -d $(DESTDIR)${SYSTEMDDIR} $(DESTDIR)${USERSYSTEMDDIR} $(DESTDIR)${TMPFILESDIR} $(DESTDIR)${USERTMPFILESDIR}905install ${SELINUXOPT} -d -m 755 $(DESTDIR)${ETCDIR}/profile.d906install ${SELINUXOPT} -m 644 docker/podman-docker.sh $(DESTDIR)${ETCDIR}/profile.d/podman-docker.sh907install ${SELINUXOPT} -m 644 docker/podman-docker.csh $(DESTDIR)${ETCDIR}/profile.d/podman-docker.csh908install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-docker.conf -t $(DESTDIR)${TMPFILESDIR}909install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-docker.conf -t $(DESTDIR)${USERTMPFILESDIR}910
911.PHONY: install.docker-docs912install.docker-docs:913install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(MANDIR)/man1914install ${SELINUXOPT} -m 644 docs/build/man/docker*.1 -t $(DESTDIR)$(MANDIR)/man1915install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(MANDIR)/man5916install ${SELINUXOPT} -m 644 docs/build/man/docker*.5 -t $(DESTDIR)$(MANDIR)/man5917
918.PHONY: install.docker-full919install.docker-full: install.docker install.docker-docs920
921.PHONY: install.systemd922ifneq (,$(findstring systemd,$(BUILDTAGS)))923PODMAN_UNIT_FILES = contrib/systemd/auto-update/podman-auto-update.service \924contrib/systemd/system/podman.service \
925contrib/systemd/system/podman-restart.service \
926contrib/systemd/system/podman-kube@.service \927contrib/systemd/system/podman-clean-transient.service
928
929%.service: %.service.in930sed -e 's;@@PODMAN@@;$(BINDIR)/podman;g' $< >$@.tmp.$$ \931&& mv -f $@.tmp.$$ $@932
933install.systemd: $(PODMAN_UNIT_FILES)934install ${SELINUXOPT} -m 755 -d $(DESTDIR)${SYSTEMDDIR} $(DESTDIR)${USERSYSTEMDDIR}935# User services936install ${SELINUXOPT} -m 644 contrib/systemd/auto-update/podman-auto-update.service $(DESTDIR)${USERSYSTEMDDIR}/podman-auto-update.service937install ${SELINUXOPT} -m 644 contrib/systemd/auto-update/podman-auto-update.timer $(DESTDIR)${USERSYSTEMDDIR}/podman-auto-update.timer938install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.socket $(DESTDIR)${USERSYSTEMDDIR}/podman.socket939install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.service $(DESTDIR)${USERSYSTEMDDIR}/podman.service940install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-restart.service $(DESTDIR)${USERSYSTEMDDIR}/podman-restart.service941install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-kube@.service $(DESTDIR)${USERSYSTEMDDIR}/podman-kube@.service942# System services943install ${SELINUXOPT} -m 644 contrib/systemd/auto-update/podman-auto-update.service $(DESTDIR)${SYSTEMDDIR}/podman-auto-update.service944install ${SELINUXOPT} -m 644 contrib/systemd/auto-update/podman-auto-update.timer $(DESTDIR)${SYSTEMDDIR}/podman-auto-update.timer945install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.socket $(DESTDIR)${SYSTEMDDIR}/podman.socket946install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.service $(DESTDIR)${SYSTEMDDIR}/podman.service947install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-restart.service $(DESTDIR)${SYSTEMDDIR}/podman-restart.service948install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-kube@.service $(DESTDIR)${SYSTEMDDIR}/podman-kube@.service949install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-clean-transient.service $(DESTDIR)${SYSTEMDDIR}/podman-clean-transient.service950rm -f $(PODMAN_UNIT_FILES)951else
952install.systemd:953endif
954
955.PHONY: install.tools956install.tools: .install.golangci-lint ## Install needed tools957$(MAKE) -C test/tools958
959.PHONY: .install.goimports960.install.goimports:961$(MAKE) -C test/tools build/goimports962
963.PHONY: .install.ginkgo964.install.ginkgo:965$(MAKE) -C test/tools build/ginkgo966
967.PHONY: .install.gitvalidation968.install.gitvalidation:969$(MAKE) -C test/tools build/git-validation970
971.PHONY: .install.golangci-lint972.install.golangci-lint:973VERSION=$(GOLANGCI_LINT_VERSION) ./hack/install_golangci.sh974
975.PHONY: .install.swagger976.install.swagger:977$(MAKE) -C test/tools build/swagger978
979.PHONY: .install.md2man980.install.md2man:981if [ ! -x "$(GOMD2MAN)" ]; then \982$(MAKE) -C test/tools build/go-md2man GOOS=$(NATIVE_GOOS) GOARCH=$(NATIVE_GOARCH); \983fi
984
985.PHONY: .install.pre-commit986.install.pre-commit:987if [ -z "$(PRE_COMMIT)" ]; then \988$(PYTHON) -m pip install --user pre-commit; \989fi
990
991.PHONY: release-artifacts992release-artifacts: clean-binaries993mkdir -p release/
994$(MAKE) podman-remote-release-darwin_amd64.zip995mv podman-remote-release-darwin_amd64.zip release/
996$(MAKE) podman-remote-release-darwin_arm64.zip997mv podman-remote-release-darwin_arm64.zip release/
998$(MAKE) podman-remote-release-windows_amd64.zip999mv podman-remote-release-windows_amd64.zip release/
1000$(MAKE) podman-remote-static-linux_amd641001tar -cvzf podman-remote-static-linux_amd64.tar.gz bin/podman-remote-static-linux_amd64
1002$(MAKE) podman-remote-static-linux_arm641003tar -cvzf podman-remote-static-linux_arm64.tar.gz bin/podman-remote-static-linux_arm64
1004mv podman-remote-static-linux*.tar.gz release/
1005cd release/; sha256sum *.zip *.tar.gz > shasums1006
1007.PHONY: uninstall1008uninstall:1009for i in $(filter %.1,$(MANPAGES_DEST)); do \1010rm -f $(DESTDIR)$(MANDIR)/man1/$$(basename $${i}); \1011done; \1012for i in $(filter %.5,$(MANPAGES_DEST)); do \1013rm -f $(DESTDIR)$(MANDIR)/man5/$$(basename $${i}); \1014done
1015# Remove podman and remote bin1016rm -f $(DESTDIR)$(BINDIR)/podman1017rm -f $(DESTDIR)$(BINDIR)/podman-remote1018# Remove related config files1019rm -f $(DESTDIR)${ETCDIR}/cni/net.d/87-podman-bridge.conflist1020rm -f $(DESTDIR)${TMPFILESDIR}/podman.conf1021rm -f $(DESTDIR)${SYSTEMDDIR}/io.podman.socket1022rm -f $(DESTDIR)${USERSYSTEMDDIR}/io.podman.socket1023rm -f $(DESTDIR)${SYSTEMDDIR}/io.podman.service1024rm -f $(DESTDIR)${SYSTEMDDIR}/podman.service1025rm -f $(DESTDIR)${SYSTEMDDIR}/podman.socket1026rm -f $(DESTDIR)${USERSYSTEMDDIR}/podman.socket1027rm -f $(DESTDIR)${USERSYSTEMDDIR}/podman.service1028
1029.PHONY: clean-binaries1030clean-binaries: ## Remove platform/architecture specific binary files1031rm -rf \
1032bin
1033
1034.PHONY: clean1035clean: clean-binaries ## Clean all make artifacts1036rm -rf \
1037_output \
1038$(wildcard podman-*.msi) \1039$(wildcard podman-remote*.zip) \1040$(wildcard podman_tmp_*) \1041$(wildcard podman*.tar.gz) \1042build \
1043test/checkseccomp/checkseccomp \
1044test/goecho/goecho \
1045test/version/version \
1046test/__init__.py \
1047test/testdata/redis-image \
1048libpod/container_ffjson.go \
1049libpod/pod_ffjson.go \
1050libpod/container_easyjson.go \
1051libpod/pod_easyjson.go \
1052docs/build \
1053.venv
1054make -C docs clean
1055