Skip to content

Commit 9697d84

Browse files
committed
KVM: selftests: Generate sysreg-defs.h and add to include path
Start generating sysreg-defs.h for arm64 builds in anticipation of updating sysreg.h to a version that depends on it. Reviewed-by: Mark Brown <[email protected]> Reviewed-by: Eric Auger <[email protected]> Tested-by: Eric Auger <[email protected]> Acked-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent e2bdd17 commit 9697d84

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

tools/testing/selftests/kvm/Makefile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ else
1717
ARCH_DIR := $(ARCH)
1818
endif
1919

20+
ifeq ($(ARCH),arm64)
21+
arm64_tools_dir := $(top_srcdir)/tools/arch/arm64/tools/
22+
GEN_HDRS := $(top_srcdir)/tools/arch/arm64/include/generated/
23+
CFLAGS += -I$(GEN_HDRS)
24+
25+
prepare:
26+
$(MAKE) -C $(arm64_tools_dir)
27+
else
28+
prepare:
29+
endif
30+
2031
LIBKVM += lib/assert.c
2132
LIBKVM += lib/elf.c
2233
LIBKVM += lib/guest_modes.c
@@ -256,13 +267,18 @@ $(TEST_GEN_OBJ): $(OUTPUT)/%.o: %.c
256267
$(SPLIT_TESTS_TARGETS): %: %.o $(SPLIT_TESTS_OBJS)
257268
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
258269

259-
EXTRA_CLEAN += $(LIBKVM_OBJS) $(TEST_DEP_FILES) $(TEST_GEN_OBJ) $(SPLIT_TESTS_OBJS) cscope.*
270+
EXTRA_CLEAN += $(GEN_HDRS) \
271+
$(LIBKVM_OBJS) \
272+
$(SPLIT_TESTS_OBJS) \
273+
$(TEST_DEP_FILES) \
274+
$(TEST_GEN_OBJ) \
275+
cscope.*
260276

261277
x := $(shell mkdir -p $(sort $(dir $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ))))
262-
$(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c
278+
$(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c prepare
263279
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
264280

265-
$(LIBKVM_S_OBJ): $(OUTPUT)/%.o: %.S
281+
$(LIBKVM_S_OBJ): $(OUTPUT)/%.o: %.S prepare
266282
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
267283

268284
# Compile the string overrides as freestanding to prevent the compiler from
@@ -274,6 +290,7 @@ $(LIBKVM_STRING_OBJ): $(OUTPUT)/%.o: %.c
274290
x := $(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS))))
275291
$(TEST_GEN_PROGS): $(LIBKVM_OBJS)
276292
$(TEST_GEN_PROGS_EXTENDED): $(LIBKVM_OBJS)
293+
$(TEST_GEN_OBJ): prepare
277294

278295
cscope: include_paths = $(LINUX_TOOL_INCLUDE) $(LINUX_HDR_PATH) include lib ..
279296
cscope:

0 commit comments

Comments
 (0)