Skip to content

Commit 5c43fd7

Browse files
wtarreaupaulmckrcu
authored andcommitted
selftests/nolibc: add a "defconfig" target
While most archs will work fine with "make defconfig", not all will do, and it's not always easy to remember the most suitable choice to use for a specific architecture. This adds a "defconfig" target to the Makefile so that one may easily run "make -C ... defconfig" and make sure to clean and rebuild a fresh config. This is *not* used by default because we want to preserve the user's config by default. Signed-off-by: Willy Tarreau <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent d248cab commit 5c43fd7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/testing/selftests/nolibc/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ IMAGE_riscv = arch/riscv/boot/Image
2222
IMAGE = $(IMAGE_$(ARCH))
2323
IMAGE_NAME = $(notdir $(IMAGE))
2424

25+
# default kernel configurations that appear to be usable
26+
DEFCONFIG_i386 = defconfig
27+
DEFCONFIG_x86 = defconfig
28+
DEFCONFIG_arm64 = defconfig
29+
DEFCONFIG_arm = multi_v7_defconfig
30+
DEFCONFIG_mips = malta_defconfig
31+
DEFCONFIG_riscv = defconfig
32+
DEFCONFIG = $(DEFCONFIG_$(ARCH))
33+
2534
# OUTPUT is only set when run from the main makefile, otherwise
2635
# it defaults to this nolibc directory.
2736
OUTPUT ?= $(CURDIR)/
@@ -46,6 +55,9 @@ initramfs: nolibc-test
4655
$(call QUIET_INSTALL, initramfs/init)
4756
$(Q)cp nolibc-test initramfs/init
4857

58+
defconfig:
59+
$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
60+
4961
kernel: initramfs
5062
$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) CONFIG_INITRAMFS_SOURCE=$(CURDIR)/initramfs
5163

0 commit comments

Comments
 (0)