tests/vpci: Use $(CC) instead of $(HOSTCC)

Depending on the build environment, HOSTCC can be different than CC. With
the recent `install` rule addition, this would put a binary of a wrong
format in the destdir (e.g. building tests on x86 host for Arm target).

Take the opportunity to adjust the `run` rule to only run the test if
HOSTCC is CC, else print a warning message.

Fixes: 96a587a057 ("tools/tests: Add install target for vPCI")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
This commit is contained in:
Michal Orzel authored and Roger Pau Monne committed 2025-06-09 12:12:43 +02:00
1 parent 6bd3aa6d56
commit 86a12671c5
1 file changed
+5 -1
+5 -1
View File
@@ -8,10 +8,14 @@ all: $(TARGET)
.PHONY: run .PHONY: run
run: $(TARGET) run: $(TARGET)
ifeq ($(CC),$(HOSTCC))
./$(TARGET) ./$(TARGET)
else
$(warning HOSTCC != CC, will not run test)
endif
$(TARGET): vpci.c vpci.h list.h main.c emul.h $(TARGET): vpci.c vpci.h list.h main.c emul.h
$(HOSTCC) $(CFLAGS_xeninclude) -g -o $@ vpci.c main.c $(CC) $(CFLAGS_xeninclude) -g -o $@ vpci.c main.c
.PHONY: clean .PHONY: clean
clean: clean:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.