diff options
-rw-r--r-- | scripts/kconfig_parser/Makefile | 23 | ||||
-rw-r--r-- | scripts/kconfig_parser/cnfexpr.h | 2 | ||||
-rw-r--r-- | scripts/kconfig_parser/parser.c | 4 | ||||
-rw-r--r-- | scripts/shared/kconfig/confdata.c (renamed from scripts/kconfig_parser/kconfig/confdata.c) | 1 | ||||
-rw-r--r-- | scripts/shared/kconfig/expr.c (renamed from scripts/kconfig_parser/kconfig/expr.c) | 0 | ||||
-rw-r--r-- | scripts/shared/kconfig/expr.h (renamed from scripts/kconfig_parser/kconfig/expr.h) | 0 | ||||
-rw-r--r-- | scripts/shared/kconfig/files.mk | 22 | ||||
-rw-r--r-- | scripts/shared/kconfig/list.h (renamed from scripts/kconfig_parser/kconfig/list.h) | 6 | ||||
-rw-r--r-- | scripts/shared/kconfig/lkc.h (renamed from scripts/kconfig_parser/kconfig/lkc.h) | 0 | ||||
-rw-r--r-- | scripts/shared/kconfig/lkc_proto.h (renamed from scripts/kconfig_parser/kconfig/lkc_proto.h) | 0 | ||||
-rw-r--r-- | scripts/shared/kconfig/menu.c (renamed from scripts/kconfig_parser/kconfig/menu.c) | 4 | ||||
-rw-r--r-- | scripts/shared/kconfig/symbol.c (renamed from scripts/kconfig_parser/kconfig/symbol.c) | 0 | ||||
-rw-r--r-- | scripts/shared/kconfig/util.c (renamed from scripts/kconfig_parser/kconfig/util.c) | 0 | ||||
-rw-r--r-- | scripts/shared/kconfig/zconf.gperf (renamed from scripts/kconfig_parser/kconfig/zconf.gperf) | 0 | ||||
-rw-r--r-- | scripts/shared/kconfig/zconf.l (renamed from scripts/kconfig_parser/kconfig/zconf.l) | 0 | ||||
-rw-r--r-- | scripts/shared/kconfig/zconf.y (renamed from scripts/kconfig_parser/kconfig/zconf.y) | 0 |
16 files changed, 40 insertions, 22 deletions
diff --git a/scripts/kconfig_parser/Makefile b/scripts/kconfig_parser/Makefile index 68fbb93..f582673 100644 --- a/scripts/kconfig_parser/Makefile +++ b/scripts/kconfig_parser/Makefile @@ -1,24 +1,19 @@ +.PHONY: all clean .SUFFIXES: +all: parser + +KCONFIG_PREFIX = ../shared/kconfig +include $(KCONFIG_PREFIX)/files.mk + SRC = parser.c \ cnfexpr.c \ symlist.c \ output.c -SRC += kconfig/zconf.tab.c CFLAGS = -O0 -w -ggdb -parser: $(SRC) kconfig/zconf.lex.c kconfig/zconf.hash.c - gcc $(CFLAGS) -o $@ $(SRC) - -%.hash.c: %.gperf - gperf -t --output-file $@ -a -C -E -g -k '1,3,$$' -p -t $< - -%.lex.c: %.l - flex -o $@ -L -P zconf $< - -%.tab.c: %.y kconfig/zconf.lex.c kconfig/zconf.hash.c - bison -o $@ $< -p zconf -t -l +parser: $(SRC) $(KCONFIG_SRC) + gcc $(CFLAGS) -o $@ $^ -I$(KCONFIG_PREFIX) -clean: - $(RM) kconfig/zconf.tab.c kconfig/zconf.lex.c kconfig/zconf.hash.c +clean:: $(RM) parser diff --git a/scripts/kconfig_parser/cnfexpr.h b/scripts/kconfig_parser/cnfexpr.h index 0473368..1d0edd4 100644 --- a/scripts/kconfig_parser/cnfexpr.h +++ b/scripts/kconfig_parser/cnfexpr.h @@ -5,7 +5,7 @@ #include <stdbool.h> #include <stdio.h> #include "symlist.h" -#include "kconfig/lkc.h" +#include "lkc.h" enum cnfexpr_type { CT_EXPR, CT_FALSE, CT_TRUE diff --git a/scripts/kconfig_parser/parser.c b/scripts/kconfig_parser/parser.c index a0425db..933c26c 100644 --- a/scripts/kconfig_parser/parser.c +++ b/scripts/kconfig_parser/parser.c @@ -11,7 +11,7 @@ #include <locale.h> #include <stdbool.h> #include <argp.h> -#include "kconfig/lkc.h" +#include "lkc.h" #include "symlist.h" #include "output.h" #include "macros.h" @@ -50,7 +50,7 @@ int main(int argc, char **argv) { textdomain(PACKAGE); conf_parse(argv[1]); - sym_clear_all_valid(); + //sym_clear_all_valid(); gsymlist = symlist_create(); diff --git a/scripts/kconfig_parser/kconfig/confdata.c b/scripts/shared/kconfig/confdata.c index f88d90f..28df18d 100644 --- a/scripts/kconfig_parser/kconfig/confdata.c +++ b/scripts/shared/kconfig/confdata.c @@ -59,6 +59,7 @@ static void conf_message(const char *fmt, ...) va_start(ap, fmt); if (conf_message_callback) conf_message_callback(fmt, ap); + va_end(ap); } const char *conf_get_configname(void) diff --git a/scripts/kconfig_parser/kconfig/expr.c b/scripts/shared/kconfig/expr.c index d662652..d662652 100644 --- a/scripts/kconfig_parser/kconfig/expr.c +++ b/scripts/shared/kconfig/expr.c diff --git a/scripts/kconfig_parser/kconfig/expr.h b/scripts/shared/kconfig/expr.h index 412ea8a..412ea8a 100644 --- a/scripts/kconfig_parser/kconfig/expr.h +++ b/scripts/shared/kconfig/expr.h diff --git a/scripts/shared/kconfig/files.mk b/scripts/shared/kconfig/files.mk new file mode 100644 index 0000000..36a3eec --- /dev/null +++ b/scripts/shared/kconfig/files.mk @@ -0,0 +1,22 @@ +.PHONY: clean + +ifndef KCONFIG_PREFIX + $(error "Please specify variable KCONFIG_SRC in your makefile before importing kconfig files.mk") +endif + +KCONFIG_SRC = $(KCONFIG_PREFIX)/zconf.tab.c + +%.hash.c: %.gperf + gperf -t --output-file $@ -a -C -E -g -k '1,3,$$' -p -t $< + +%.lex.c: %.l + flex -o $@ -L -P zconf $< + +%.tab.c: %.y %.lex.c %.hash.c + bison -o $@ $< -p zconf -t -l + + +clean:: + $(RM) $(KCONFIG_PREFIX)/zconf.tab.c + $(RM) $(KCONFIG_PREFIX)/zconf.lex.c + $(RM) $(KCONFIG_PREFIX)/zconf.hash.c diff --git a/scripts/kconfig_parser/kconfig/list.h b/scripts/shared/kconfig/list.h index 685d80e..2cf23f0 100644 --- a/scripts/kconfig_parser/kconfig/list.h +++ b/scripts/shared/kconfig/list.h @@ -34,7 +34,7 @@ struct list_head { * list_entry - get the struct for this entry * @ptr: the &struct list_head pointer. * @type: the type of the struct this is embedded in. - * @member: the name of the list_struct within the struct. + * @member: the name of the list_head within the struct. */ #define list_entry(ptr, type, member) \ container_of(ptr, type, member) @@ -43,7 +43,7 @@ struct list_head { * list_for_each_entry - iterate over list of given type * @pos: the type * to use as a loop cursor. * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @member: the name of the list_head within the struct. */ #define list_for_each_entry(pos, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member); \ @@ -55,7 +55,7 @@ struct list_head { * @pos: the type * to use as a loop cursor. * @n: another type * to use as temporary storage * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @member: the name of the list_head within the struct. */ #define list_for_each_entry_safe(pos, n, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member), \ diff --git a/scripts/kconfig_parser/kconfig/lkc.h b/scripts/shared/kconfig/lkc.h index d5daa7a..d5daa7a 100644 --- a/scripts/kconfig_parser/kconfig/lkc.h +++ b/scripts/shared/kconfig/lkc.h diff --git a/scripts/kconfig_parser/kconfig/lkc_proto.h b/scripts/shared/kconfig/lkc_proto.h index ecdb965..ecdb965 100644 --- a/scripts/kconfig_parser/kconfig/lkc_proto.h +++ b/scripts/shared/kconfig/lkc_proto.h diff --git a/scripts/kconfig_parser/kconfig/menu.c b/scripts/shared/kconfig/menu.c index a26cc5d..72c9dba 100644 --- a/scripts/kconfig_parser/kconfig/menu.c +++ b/scripts/shared/kconfig/menu.c @@ -548,7 +548,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop, { int i, j; struct menu *submenu[8], *menu, *location = NULL; - struct jump_key *jump; + struct jump_key *jump = NULL; str_printf(r, _("Prompt: %s\n"), _(prop->text)); menu = prop->menu->parent; @@ -586,7 +586,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop, str_printf(r, _(" Location:\n")); for (j = 4; --i >= 0; j += 2) { menu = submenu[i]; - if (head && location && menu == location) + if (jump && menu == location) jump->offset = strlen(r->s); str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); diff --git a/scripts/kconfig_parser/kconfig/symbol.c b/scripts/shared/kconfig/symbol.c index 7caabdb..7caabdb 100644 --- a/scripts/kconfig_parser/kconfig/symbol.c +++ b/scripts/shared/kconfig/symbol.c diff --git a/scripts/kconfig_parser/kconfig/util.c b/scripts/shared/kconfig/util.c index 94f9c83..94f9c83 100644 --- a/scripts/kconfig_parser/kconfig/util.c +++ b/scripts/shared/kconfig/util.c diff --git a/scripts/kconfig_parser/kconfig/zconf.gperf b/scripts/shared/kconfig/zconf.gperf index b6ac02d..b6ac02d 100644 --- a/scripts/kconfig_parser/kconfig/zconf.gperf +++ b/scripts/shared/kconfig/zconf.gperf diff --git a/scripts/kconfig_parser/kconfig/zconf.l b/scripts/shared/kconfig/zconf.l index 6c62d93..6c62d93 100644 --- a/scripts/kconfig_parser/kconfig/zconf.l +++ b/scripts/shared/kconfig/zconf.l diff --git a/scripts/kconfig_parser/kconfig/zconf.y b/scripts/shared/kconfig/zconf.y index 0f683cf..0f683cf 100644 --- a/scripts/kconfig_parser/kconfig/zconf.y +++ b/scripts/shared/kconfig/zconf.y |