From a8dd9bc1edea685270311e9f7a2617fb35d7d1a4 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 3 Apr 2025 09:43:48 -0700 Subject: [PATCH] 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 --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3a172a28fd..d3f2100322 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ PYTHON ?= $(shell command -v python3 python|head -n1) PKG_MANAGER ?= $(shell command -v dnf yum|head -n1) # ~/.local/bin is not in PATH on all systems PRE_COMMIT = $(shell command -v bin/venv/bin/pre-commit ~/.local/bin/pre-commit pre-commit | head -n1) -ifeq ($(shell uname -s),FreeBSD) +ifeq ($(NATIVE_GOOS),freebsd) SED=gsed GREP=ggrep MAN_L= mandoc @@ -231,7 +231,7 @@ default: all all: binaries docs .PHONY: binaries -ifeq ($(shell uname -s),FreeBSD) +ifeq ($(GOOS),freebsd) binaries: podman podman-remote ## Build podman and podman-remote binaries else ifneq (, $(findstring $(GOOS),darwin windows)) binaries: podman-remote ## Build podman-remote (client) only binaries @@ -246,7 +246,7 @@ _HLP_TGTS_RX = '^[[:print:]]+:.*?\#\# .*$$' _HLP_TGTS_CMD = $(GREP) -E $(_HLP_TGTS_RX) $(MAKEFILE_LIST) _HLP_TGTS_LEN = $(shell $(call err_if_empty,_HLP_TGTS_CMD) | cut -d : -f 1 | wc -L 2>/dev/null || echo "PARSING_ERROR") # Separated condition for Darwin -ifeq ($(shell uname -s)$(_HLP_TGTS_LEN),DarwinPARSING_ERROR) +ifeq ($(NATIVE_GOOS)$(_HLP_TGTS_LEN),darwinPARSING_ERROR) ifneq (,$(wildcard /usr/local/bin/gwc)) _HLP_TGTS_LEN = $(shell $(call err_if_empty,_HLP_TGTS_CMD) | cut -d : -f 1 | gwc -L) else @@ -914,7 +914,7 @@ install.bin: ln -sf podman $(DESTDIR)$(BINDIR)/podmansh test -z "${SELINUXOPT}" || chcon --verbose --reference=$(DESTDIR)$(BINDIR)/podman bin/podman install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(LIBEXECPODMAN) -ifneq ($(shell uname -s),FreeBSD) +ifneq ($(NATIVE_GOOS),freebsd) install ${SELINUXOPT} -m 755 bin/rootlessport $(DESTDIR)$(LIBEXECPODMAN)/rootlessport test -z "${SELINUXOPT}" || chcon --verbose --reference=$(DESTDIR)$(LIBEXECPODMAN)/rootlessport bin/rootlessport install ${SELINUXOPT} -m 755 bin/quadlet $(DESTDIR)$(LIBEXECPODMAN)/quadlet