Makefile: ignore configs/ prefix on configuration events
PATCH 1/1 Makefile: ignore configs/ prefix on configuration events
Allows accepting board configuration events that are prefixed with a configs/ path. This provides a convenience for users where it can be slightly easier/quicker to utilize shell completion to prepare a build. For example:
make configs/qemu_sparc64_sun4u_defconfig
Would be equivalent to:
make qemu_sparc64_sun4u_defconfig
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -1026,7 +1026,7 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile $(firstword \ $(foreach d, \ $(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)), \ - $(wildcard $(d)/configs/$@) \ + $(wildcard $(d)/configs/$(@:configs/%=%)) \ ) \ ), \ $(error "Can't find $@") \
Signature · 6 lines
2.49.0.windows.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello all!
Quoted 10 lines · James Knight
Allows accepting board configuration events that are prefixed with a
configs/path. This provides a convenience for users where it can be slightly easier/quicker to utilize shell completion to prepare a build. For example:make configs/qemu_sparc64_sun4u_defconfig
Would be equivalent to:
make
qemu_sparc64_sun4u_defconfig
I don't know how this is supposed to work but, in my experience, shell completion on buildroot's make targets is painfully slow, and does not work with defonfig targets.
With this patch applied:
make qem<TAB> → make qemu
make qemu_sp<TAB>arc64<TAB> # no completion
make conf<TAB> → make config␣ # where “␣” is a trailing space make configs/qe<TAB>mu_sp<TAB>arc64<TAB> # no completion
It would be very cool to have usable shell completion though.
Context: Ubuntu 24.04, buildroot git master
Regards,
Edgar Bonet.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 20 lines · Edgar Bonet via buildroot
Hello all!
Quoted 10 lines · James Knight
Allows accepting board configuration events that are prefixed with a
configs/path. This provides a convenience for users where it can be slightly easier/quicker to utilize shell completion to prepare a build. For example:make configs/qemu_sparc64_sun4u_defconfig
Would be equivalent to:
make
qemu_sparc64_sun4u_defconfigI don't know how this is supposed to work but, in my experience, shell completion on buildroot's make targets is painfully slow, and does not work with defonfig targets.
With this patch applied:
Quoted 7 lines
make qem<TAB> → make qemu
make qemu_sp<TAB>arc64<TAB> # no completionmake conf<TAB> → make config␣ # where “␣” is a trailing space make configs/qe<TAB>mu_sp<TAB>arc64<TAB> # no completion
It would be very cool to have usable shell completion though.
In bash, you can use Ctrl-backslash to only use filename completion, not
context-sensitive completion. But that only works if it's an actual filename, like in the example that James gives.
The context-sensitive completion with TAB already works without James' patch.
So basically, this patch is exactly a workaround for the problem you indicate
(if you know what ctrl-backslash does).
Regards,
Arnout
Quoted 10 lines
Context: Ubuntu 24.04, buildroot git master
Regards,
Edgar Bonet.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hello!
Quoted 3 lines · Arnout Vandecappelle
In bash, you can use Ctrl-backslash to only use filename completion, not context-sensitive completion. But that only works if it's an actual filename, like in the example that James gives.
Today I learned something. Thanks! Now, on my system the key bindings are different:
Ctrl-\ → send SIGQUIT (ignored by bash)
Alt-/ → filename completionRegards,
Edgar.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi James,
Quoted 10 lines · James Knight
Allows accepting board configuration events that are prefixed with a
configs/path. This provides a convenience for users where it can be slightly easier/quicker to utilize shell completion to prepare a build. For example:make configs/qemu_sparc64_sun4u_defconfig
Would be equivalent to:
make
qemu_sparc64_sun4u_defconfig
I agree with the principle (though I want to think a little more about the
implications in corner cases). However...
Quoted 11 lines
Signed-off-by James Knight <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +0
-0
Makefile defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile · line 1029
Quoted 5 lines
Makefile +1
-1@@ -1026,7 +1026,7 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile $(firstword \ $(foreach d, \ $(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)), \ - $(wildcard $(d)/configs/$@) \ + $(wildcard $(d)/configs/$(@:configs/%=%)) \
We don't use this kind of substitution, instead use patsubst.
And maybe it's simpler to use
$(wildcard $(d)/configs/$@ $(d)/$@)
It would mean that any defconfig at the top of a br2-external would also work, but perhaps there's nothing wrong with that...
Regards,
Arnout
Makefile defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile · line 1032
Quoted 3 lines
Makefile +0
-0) \ ), \ $(error "Can't find $@") \
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Arnout,
Quoted 1 line · Arnout Vandecappelle
We don't use this kind of substitution, instead use patsubst.
If using pathsubst is preferred (e.g. "$(wildcard $(d)/configs/$(call pathsubst,configs/,,$@))"), or using the other suggested variant:
Quoted 1 line
$(wildcard $(d)/configs/$@ $(d)/$@)
Let me know and I can set up a patch for it (if desired).
Quoted 1 line
... I want to think a little more about the implications in corner cases...
And no worries if such a modification is not desired.
_______________________________________________
buildroot mailing list [email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot