On 23.02.2026 11:14, Edwin Török wrote:
> Also makes CFLAGS consistent across all tests, e.g. test_vpci would now
> fail to build with an unused variable error if it hadn't been fixed in a
> previous commit.

I can't quite derive why that would happen.

> --- a/tools/tests/Rules.mk
> +++ b/tools/tests/Rules.mk
> @@ -45,4 +45,13 @@ install: all
>  uninstall:
>       $(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC)/tests/,$(TARGETS))
>  
> +CFLAGS += -D__XEN_TOOLS__
> +CFLAGS += $(CFLAGS_xeninclude)
> +
> +%.o: Makefile
> +
> +$(TARGET): $(TARGET).o
> +     $(CC) $^ -o $@ $(LDFLAGS) $(APPEND_LDFLAGS)

In the earlier patch you require TARGETS to be surfaced. Why would we limit
things to a single target here then? Imo we want to settle on every subdir
having a single target, or the abstraction allowing for multiple.

>  -include $(DEPS_INCLUDE)
> +

Nit: Stray change?

> --- a/tools/tests/cpu-policy/Makefile
> +++ b/tools/tests/cpu-policy/Makefile
> @@ -3,26 +3,19 @@ include $(XEN_ROOT)/tools/Rules.mk
>  
>  TARGETS :=
>  
> +TARGET := test-cpu-policy
> +
>  # For brevity, these tests make extensive use of designated initialisers in
>  # anonymous unions, but GCCs older than 4.6 can't cope.  Ignore the test in
>  # this case.
>  ifneq ($(gcc)$(call cc-ver,$(CC),lt,0x040600),yy)
> -TARGETS += test-cpu-policy
> +TARGETS += $(TARGET)
>  else
>  $(warning Test harness not built, use newer compiler than "$(CC)" (version 
> $(shell $(CC) -dumpversion)))
>  endif
>  
> -CFLAGS += -D__XEN_TOOLS__
> -CFLAGS += $(CFLAGS_xeninclude)
> -CFLAGS += $(APPEND_CFLAGS)
> -
> -LDFLAGS += $(APPEND_LDFLAGS)

You use $(APPEND_LDFLAGS) in the new rule (without adding to LDFLAGS), but where
did $(APPEND_CFLAGS) go?

> --- /dev/null
> +++ b/tools/tests/vpci/.gitignore
> @@ -0,0 +1 @@
> +test_vpci.c
> diff --git a/tools/tests/vpci/Makefile b/tools/tests/vpci/Makefile
> index 597303e31d..41ff867cdd 100644
> --- a/tools/tests/vpci/Makefile
> +++ b/tools/tests/vpci/Makefile
> @@ -4,10 +4,14 @@ include $(XEN_ROOT)/tools/Rules.mk
>  TARGET := test_vpci
>  TARGETS := $(TARGET)
>  
> -$(TARGET): vpci.c vpci.h list.h main.c emul.h
> -     $(CC) $(CFLAGS_xeninclude) -g -o $@ vpci.c main.c
> +$(TARGET).c: main.c
> +     ln -sf $< $@

Can we perhaps try to avoid further symlinking, unless absolutely necessary?
Here it looks to be easy to rename main.c into test_vpci.c (yet better would
be test-vcpi.c).

Jan

Reply via email to