Skip to content

Commit 5dffbe8

Browse files
segherSam Ravnborg
authored andcommitted
kbuild: show defconfig subdirs in make help
PowerPC will start moving board defconfigs into subarch-specific subdirs soon. "make help" currently does not look in subdirs to find the defconfigs to show. This is partially a good thing, since there are way too many defconfigs for one list. This patch makes the main "make help" display something like help-40x - Show 40x-specific targets help-44x - Show 44x-specific targets help-boards - Show all of the above and wires up stuff so those new help-* commands actually work. [sam: fixed it up to display x86 defconfigs too] Cc: Josh Boyer <[email protected]> Signed-off-by: Segher Boessenkool <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
1 parent 79d6e53 commit 5dffbe8

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,8 +1174,10 @@ rpm: include/config/kernel.release FORCE
11741174
# Brief documentation of the typical targets used
11751175
# ---------------------------------------------------------------------------
11761176

1177-
boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig)
1177+
boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*_defconfig)
11781178
boards := $(notdir $(boards))
1179+
board-dirs := $(dir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*/*_defconfig))
1180+
board-dirs := $(sort $(notdir $(board-dirs:/=)))
11791181

11801182
help:
11811183
@echo 'Cleaning targets:'
@@ -1229,6 +1231,11 @@ help:
12291231
$(foreach b, $(boards), \
12301232
printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \
12311233
echo '')
1234+
@$(if $(board-dirs), \
1235+
$(foreach b, $(board-dirs), \
1236+
printf " %-16s - Show %s-specific targets\\n" help-$(b) $(b);) \
1237+
printf " %-16s - Show all of the above\\n" help-boards; \
1238+
echo '')
12321239

12331240
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
12341241
@echo ' make V=2 [targets] 2 => give reason for rebuild of target'
@@ -1240,6 +1247,20 @@ help:
12401247
@echo 'For further info see the ./README file'
12411248

12421249

1250+
help-board-dirs := $(addprefix help-,$(board-dirs))
1251+
1252+
help-boards: $(help-board-dirs)
1253+
1254+
boards-per-dir = $(notdir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/$*/*_defconfig))
1255+
1256+
$(help-board-dirs): help-%:
1257+
@echo 'Architecture specific targets ($(SRCARCH) $*):'
1258+
@$(if $(boards-per-dir), \
1259+
$(foreach b, $(boards-per-dir), \
1260+
printf " %-24s - Build for %s\\n" $*/$(b) $(subst _defconfig,,$(b));) \
1261+
echo '')
1262+
1263+
12431264
# Documentation targets
12441265
# ---------------------------------------------------------------------------
12451266
%docs: scripts_basic FORCE

0 commit comments

Comments
 (0)