aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-03-15 10:08:47 +0100
committerStefano Brivio <sbrivio@redhat.com>2023-03-17 08:26:07 +0100
commit87a655045bf2631a10c44a3d41090bd289f34525 (patch)
treef91fd31bdf16b08e384fad1c5de1f9b1b42e3831
parent7727804658bbdf06f27d916bf7d5382d714de337 (diff)
downloadpasst-87a655045bf2631a10c44a3d41090bd289f34525.tar
passt-87a655045bf2631a10c44a3d41090bd289f34525.tar.gz
passt-87a655045bf2631a10c44a3d41090bd289f34525.tar.bz2
passt-87a655045bf2631a10c44a3d41090bd289f34525.tar.lz
passt-87a655045bf2631a10c44a3d41090bd289f34525.tar.xz
passt-87a655045bf2631a10c44a3d41090bd289f34525.tar.zst
passt-87a655045bf2631a10c44a3d41090bd289f34525.zip
Makefile: Enable external override for TARGET
A cross-architecture build might pass a target-specific CC on 'make', and not on 'make install', and this is what happens in Debian cross-qa tests. Given that we select binaries to be installed depending on the target architecture, this means we would build AVX2 binaries in any case on a x86_64 build machine. By overriding TARGET in package build rules, we can tell the Makefile about the target architecture, also for the 'install' (Makefile) target. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 6f8bd81..0dd1057 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ ifeq ($(RLIMIT_STACK_VAL),unlimited)
RLIMIT_STACK_VAL := 1024
endif
-TARGET := $(shell $(CC) -dumpmachine)
+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/')