Use the native ARCH only in case it is not set, this will allow the
cross-compilation where ARCH is explicitly set.
Additionally, simplify the check for ARCH so that fcopy daemon is built
only for x86_64.
Fixes: 82b0945ce2c2 ("tools: hv: Add new fcopy application based on uio driver")
Reported-by: Adrian Vladu <[email protected]>
Closes:
https://lore.kernel.org/linux-hyperv/pr3pr09mb54119db2fd76977c62d8dd6ab0...@pr3pr09mb5411.eurprd09.prod.outlook.com/
Co-developed-by: Saurabh Sengar <[email protected]>
Signed-off-by: Saurabh Sengar <[email protected]>
Signed-off-by: Aditya Garg <[email protected]>
Reviewed-by: Roman Kisel <[email protected]>
---
Changes since v1:
- Dropped the info target printing CC, LD and ARCH
v1:
https://lore.kernel.org/all/[email protected]/
---
tools/hv/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/hv/Makefile b/tools/hv/Makefile
index 34ffcec264ab..e377caf89fb6 100644
--- a/tools/hv/Makefile
+++ b/tools/hv/Makefile
@@ -2,7 +2,7 @@
# Makefile for Hyper-V tools
include ../scripts/Makefile.include
-ARCH := $(shell uname -m 2>/dev/null)
+ARCH ?= $(shell uname -m 2>/dev/null)
sbindir ?= /usr/sbin
libexecdir ?= /usr/libexec
sharedstatedir ?= /var/lib
@@ -20,7 +20,7 @@ override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE
-I$(OUTPUT)include
override CFLAGS += -Wno-address-of-packed-member
ALL_TARGETS := hv_kvp_daemon hv_vss_daemon
-ifneq ($(ARCH), aarch64)
+ifeq ($(ARCH), x86_64)
ALL_TARGETS += hv_fcopy_uio_daemon
endif
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
--
2.43.0