From f78a09b60c4ce24e2455615722dd6ed8e2ba85e2 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 3 Apr 2015 20:01:38 +0200 Subject: kconfig: Add wildcard support for "source" Kconfig's include directive "source" does not support wildcards (e.g. source src/mainboard/*/Kconfig) which makes automatic inclusion of all boards a tedious task and prevents us from implementing "drop in" boards. In our Makefile.inc files we already include mainboard directories per wildcard, so let's add the infrastructure to do the same with Kconfig. Change-Id: I1988ff6ce3e167e86bb5cb65fc04a13748599dad Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/9294 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- util/kconfig/zconf.l | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'util/kconfig/zconf.l') diff --git a/util/kconfig/zconf.l b/util/kconfig/zconf.l index 6c62d93b4f..b19e4de43c 100644 --- a/util/kconfig/zconf.l +++ b/util/kconfig/zconf.l @@ -13,6 +13,7 @@ #include #include #include +#include #include "lkc.h" @@ -336,6 +337,21 @@ void zconf_nextfile(const char *name) current_file = file; } +void zconf_nextfiles(const char *wildcard) +{ + wordexp_t p; + char **w; + int i; + + wordexp(wildcard, &p, 0); + w = p.we_wordv; + + for (i = p.we_wordc - 1; i >= 0; i--) + zconf_nextfile(w[i]); + + wordfree(&p); +} + static void zconf_endfile(void) { struct buffer *parent; -- cgit v1.2.3