Skip to content

Commit a8dd9bc

Browse files
committed
Makefile: use GOOS/NATIVE_GOOS instead of uname -s
Saves a few fork/execs, and unify the code since other places are already using NATIVE_GOOS or GOOS. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 4f75d0b commit a8dd9bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ PYTHON ?= $(shell command -v python3 python|head -n1)
6666
PKG_MANAGER ?= $(shell command -v dnf yum|head -n1)
6767
# ~/.local/bin is not in PATH on all systems
6868
PRE_COMMIT = $(shell command -v bin/venv/bin/pre-commit ~/.local/bin/pre-commit pre-commit | head -n1)
69-
ifeq ($(shell uname -s),FreeBSD)
69+
ifeq ($(NATIVE_GOOS),freebsd)
7070
SED=gsed
7171
GREP=ggrep
7272
MAN_L= mandoc
@@ -231,7 +231,7 @@ default: all
231231
all: binaries docs
232232

233233
.PHONY: binaries
234-
ifeq ($(shell uname -s),FreeBSD)
234+
ifeq ($(GOOS),freebsd)
235235
binaries: podman podman-remote ## Build podman and podman-remote binaries
236236
else ifneq (, $(findstring $(GOOS),darwin windows))
237237
binaries: podman-remote ## Build podman-remote (client) only binaries
@@ -246,7 +246,7 @@ _HLP_TGTS_RX = '^[[:print:]]+:.*?\#\# .*$$'
246246
_HLP_TGTS_CMD = $(GREP) -E $(_HLP_TGTS_RX) $(MAKEFILE_LIST)
247247
_HLP_TGTS_LEN = $(shell $(call err_if_empty,_HLP_TGTS_CMD) | cut -d : -f 1 | wc -L 2>/dev/null || echo "PARSING_ERROR")
248248
# Separated condition for Darwin
249-
ifeq ($(shell uname -s)$(_HLP_TGTS_LEN),DarwinPARSING_ERROR)
249+
ifeq ($(NATIVE_GOOS)$(_HLP_TGTS_LEN),darwinPARSING_ERROR)
250250
ifneq (,$(wildcard /usr/local/bin/gwc))
251251
_HLP_TGTS_LEN = $(shell $(call err_if_empty,_HLP_TGTS_CMD) | cut -d : -f 1 | gwc -L)
252252
else
@@ -914,7 +914,7 @@ install.bin:
914914
ln -sf podman $(DESTDIR)$(BINDIR)/podmansh
915915
test -z "${SELINUXOPT}" || chcon --verbose --reference=$(DESTDIR)$(BINDIR)/podman bin/podman
916916
install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(LIBEXECPODMAN)
917-
ifneq ($(shell uname -s),FreeBSD)
917+
ifneq ($(NATIVE_GOOS),freebsd)
918918
install ${SELINUXOPT} -m 755 bin/rootlessport $(DESTDIR)$(LIBEXECPODMAN)/rootlessport
919919
test -z "${SELINUXOPT}" || chcon --verbose --reference=$(DESTDIR)$(LIBEXECPODMAN)/rootlessport bin/rootlessport
920920
install ${SELINUXOPT} -m 755 bin/quadlet $(DESTDIR)$(LIBEXECPODMAN)/quadlet

0 commit comments

Comments
 (0)