On 23.02.2026 11:14, Edwin Török wrote:
> Introduce a new tools/tests/Rules.mk that must be included *last* in a
> Makefile, after TARGETS is defined.

Requiring inclusion after TARGETS is defined is certainly okay. Requiring it to
be included absolutely last is imo going too far. There surely are going to be
cases where something wants overriding or adding to.

> --- /dev/null
> +++ b/tools/tests/Rules.mk
> @@ -0,0 +1,48 @@
> +# Usage: include this last in your Makefile.
> +#
> +# For example:
> +#
> +# XEN_ROOT = $(CURDIR)/../../..
> +# include $(XEN_ROOT)/tools/Rules.mk
> +#
> +# TARGETS := ...
> +# ...
> +# include $(XEN_ROOT)/tools/tests/Rules.mk
> +
> +ifndef XEN_ROOT
> +$(error XEN_ROOT is not defined)
> +endif
> +
> +.PHONY: all
> +all: $(TARGETS)
> +.DEFAULT_GOAL: all

Make 3.80, which ./README still says we support, doesn't look to know this.

Jan

Reply via email to