mirror of
https://passt.top/passt
synced 2024-12-22 05:35:23 +00:00
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>
This commit is contained in:
parent
b6e79efa0b
commit
d9c0f8eefb
5
Makefile
5
Makefile
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user