aboutgitcodebugslistschat
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-09-26 20:43:45 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-09-29 12:21:37 +0200
commit6d171cb357778b2a5accfe2ba8f4aa18ccd38647 (patch)
treeb9f6cd37ff67a752da4305b632fb1fb8f1a8663f /Makefile
parent2e7f9da6d1513c84ac9d1f039d73f1e803b3a2a1 (diff)
downloadpasst-6d171cb357778b2a5accfe2ba8f4aa18ccd38647.tar
passt-6d171cb357778b2a5accfe2ba8f4aa18ccd38647.tar.gz
passt-6d171cb357778b2a5accfe2ba8f4aa18ccd38647.tar.bz2
passt-6d171cb357778b2a5accfe2ba8f4aa18ccd38647.tar.lz
passt-6d171cb357778b2a5accfe2ba8f4aa18ccd38647.tar.xz
passt-6d171cb357778b2a5accfe2ba8f4aa18ccd38647.tar.zst
passt-6d171cb357778b2a5accfe2ba8f4aa18ccd38647.zip
Makefile: Simplify getting target triple for compiler
We do some manipulation of the output of cc -v to get the target triple for the platform, to locate headers for cppcheck. However, we can get this more easily with cc -dumpmachine - and in fact we do so elsewhere in the Makefile. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 22378e8..1a3dca9 100644
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,9 @@ ifeq ($(RLIMIT_STACK_VAL),unlimited)
RLIMIT_STACK_VAL := 1024
endif
+TARGET := $(shell $(CC) -dumpmachine)
# Get 'uname -m'-like architecture description for target
-TARGET_ARCH := $(shell $(CC) -dumpmachine | cut -f1 -d- | tr [A-Z] [a-z])
+TARGET_ARCH := $(shell echo $(TARGET) | cut -f1 -d- | tr [A-Z] [a-z])
TARGET_ARCH := $(shell echo $(TARGET_ARCH) | sed 's/powerpc/ppc/')
AUDIT_ARCH := $(shell echo $(TARGET_ARCH) | tr [a-z] [A-Z] | sed 's/^ARM.*/ARM/')
@@ -271,7 +272,6 @@ clang-tidy: $(SRCS) $(HEADERS)
SYSTEM_INCLUDES := /usr/include
ifeq ($(shell $(CC) -v 2>&1 | grep -c "gcc version"),1)
-TARGET := $(shell ${CC} -v 2>&1 | sed -n 's/Target: \(.*\)/\1/p')
VER := $(shell $(CC) -dumpversion)
SYSTEM_INCLUDES += /usr/lib/gcc/$(TARGET)/$(VER)/include
endif