History

kunit: Always descend into kunit directory during build

For kbuild to properly clean up these build artifacts in the subdirectory, even after CONFIG_KUNIT changed do disabled, the directory needs to be processed always. Pushing the special logic for hook.o into the kunit Makefile also makes the logic easier to understand.

Thomas Weißschuh committed 1 year ago

Commit 29128da1 parent 8f5ae302 files · +1 −5Browse files

Unified · Split

2 files
  1. lib/Makefile +0 −4
  2. lib/kunit/Makefile +1 −1
lib/Makefile+0−4
@@ -109,11 +109,7 @@ test_fpu-y := test_fpu_glue.o test_fpu_impl.o · 108 unmodified lines
109CFLAGS_test_fpu_impl.o += $(CC_FLAGS_FPU)109CFLAGS_test_fpu_impl.o += $(CC_FLAGS_FPU)
110CFLAGS_REMOVE_test_fpu_impl.o += $(CC_FLAGS_NO_FPU)110CFLAGS_REMOVE_test_fpu_impl.o += $(CC_FLAGS_NO_FPU)
111 111
112# Some KUnit files (hooks.o) need to be built-in even when KUnit is a module,
113# so we can't just use obj-$(CONFIG_KUNIT).
114ifdef CONFIG_KUNIT
115obj-y += kunit/112obj-y += kunit/
116endif
117 113
118ifeq ($(CONFIG_DEBUG_KOBJECT),y)114ifeq ($(CONFIG_DEBUG_KOBJECT),y)
119CFLAGS_kobject.o += -DDEBUG115CFLAGS_kobject.o += -DDEBUG
lib/kunit/Makefile+1−1
@@ -17,7 +17,7 @@ kunit-objs += debugfs.o · 16 unmodified lines
17endif17endif
18 18
19# KUnit 'hooks' are built-in even when KUnit is built as a module.19# KUnit 'hooks' are built-in even when KUnit is built as a module.
20obj-y += hooks.o20obj-$(if $(CONFIG_KUNIT),y) += hooks.o
21 21
22obj-$(CONFIG_KUNIT_TEST) += kunit-test.o22obj-$(CONFIG_KUNIT_TEST) += kunit-test.o
23obj-$(CONFIG_KUNIT_TEST) += platform-test.o23obj-$(CONFIG_KUNIT_TEST) += platform-test.o