diff options
author | Laurent Vivier <lvivier@redhat.com> | 2024-11-27 17:16:45 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-11-28 14:03:16 +0100 |
commit | d9c0f8eefb0015a5a06c7259666c877fff6fbe92 (patch) | |
tree | 21d101b35b7200fc1a8f65f5bbbccb555998c52f | |
parent | b6e79efa0b0c8ab6327f5184f81c5b3ab8af4ff8 (diff) | |
download | passt-d9c0f8eefb0015a5a06c7259666c877fff6fbe92.tar passt-d9c0f8eefb0015a5a06c7259666c877fff6fbe92.tar.gz passt-d9c0f8eefb0015a5a06c7259666c877fff6fbe92.tar.bz2 passt-d9c0f8eefb0015a5a06c7259666c877fff6fbe92.tar.lz passt-d9c0f8eefb0015a5a06c7259666c877fff6fbe92.tar.xz passt-d9c0f8eefb0015a5a06c7259666c877fff6fbe92.tar.zst passt-d9c0f8eefb0015a5a06c7259666c877fff6fbe92.zip |
Makefile: Use make internal string functions
TARGET_ARCH is computed from '$(CC) -dumpmachine' using external
bash commands like echo, cut, tr and sed. This can be done using
make internal string functions.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | Makefile | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -17,8 +17,9 @@ DUAL_STACK_SOCKETS := 1 TARGET ?= $(shell $(CC) -dumpmachine) # Get 'uname -m'-like architecture description for target -TARGET_ARCH := $(shell echo $(TARGET) | cut -f1 -d- | tr [A-Z] [a-z]) -TARGET_ARCH := $(shell echo $(TARGET_ARCH) | sed 's/powerpc/ppc/') +TARGET_ARCH := $(firstword $(subst -, ,$(TARGET))) +TARGET_ARCH := $(patsubst [:upper:],[:lower:],$(TARGET_ARCH)) +TARGET_ARCH := $(subst powerpc,ppc,$(TARGET_ARCH)) # On some systems enabling optimization also enables source fortification, # automagically. Do not override it. |