Files
Jan Beulich 7326c17254 x86/cpu-policy: move CPU policy library code
... to a dedicated subdir of x86's private lib/ sub-tree.

For the CPU policy harnesses and libxenguest use $(lib-y) as set by the
new Makefile.common, whereas for the emulator harnesses stick to building
just cpuid.o for the time being.

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-02-25 12:31:08 +01:00

56 lines
1.2 KiB
Makefile

XEN_ROOT = $(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
TARGETS :=
# 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
else
$(warning Test harness not built, use newer compiler than "$(CC)" (version $(shell $(CC) -dumpversion)))
endif
.PHONY: all
all: $(TARGETS)
.PHONY: run
run: $(TARGETS)
./$<
.PHONY: clean
clean:
$(RM) -- *.o $(TARGETS) $(DEPS_RM)
.PHONY: distclean
distclean: clean
$(RM) -- *~
.PHONY: install
install: all
$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)/tests
$(if $(TARGETS),$(INSTALL_PROG) $(TARGETS) $(DESTDIR)$(LIBEXEC)/tests)
.PHONY: uninstall
uninstall:
$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC)/tests/,$(TARGETS))
CFLAGS += -D__XEN_TOOLS__
CFLAGS += $(CFLAGS_xeninclude)
CFLAGS += $(APPEND_CFLAGS)
LDFLAGS += $(APPEND_LDFLAGS)
vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
lib-y :=
include $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy/Makefile.common
%.o: Makefile
test-cpu-policy: test-cpu-policy.o $(lib-y)
$(CC) $^ -o $@ $(LDFLAGS)
-include $(DEPS_INCLUDE)