summaryrefslogtreecommitdiff
path: root/util/cbfstool/Makefile.inc
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2023-06-15 15:26:40 +0800
committerMartin L Roth <gaumless@gmail.com>2023-09-28 21:28:37 +0000
commit8cb45aadf776b830ed9de28a1bfe864b470f04ae (patch)
treebac753d37289ac2241d4a61767a458042aa84fa1 /util/cbfstool/Makefile.inc
parenta421ae99fb377eb3334ec60823b5523bf0325c95 (diff)
util/cbfstool: Revise lex/yacc (bison) generation
Revise the Makefile.inc rules for generating FMD parser files. - lex: If --header-file is supported then the lex (usually flex) should also support '-o' so we don't need to do redirection (-t). - yacc: Bison is already required by bincfg and sconfig so we can change the default parser compiler to Bison. That also allows us to use -o and --defines to override the output files. - both: Line directives are only helpful when debugging the scanner and the parser, so we should remove them to get better git diff results (-L for lex, -l for bison). Also regenerated the shipped files with latest version of flex (2.6.4) and bison (3.8.2). Change-Id: I15b58ff65dcd9f3f3a6095aa004091ff733ffec3 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/75851 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'util/cbfstool/Makefile.inc')
-rw-r--r--util/cbfstool/Makefile.inc8
1 files changed, 3 insertions, 5 deletions
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc
index 8428f8a328..e08674e2e5 100644
--- a/util/cbfstool/Makefile.inc
+++ b/util/cbfstool/Makefile.inc
@@ -267,20 +267,18 @@ $(objutil)/cbfstool/%: $(top)/util/cbfstool/%_shipped
ifeq ($(CONFIG_FMD_GENPARSER),y)
TOOLLEX := lex
-TOOLYACC := yacc
+TOOLYACC := bison
# the .c rule also creates .h
$(top)/util/cbfstool/fmd_scanner.h_shipped: $(top)/util/cbfstool/fmd_scanner.c_shipped
$(top)/util/cbfstool/fmd_scanner.c_shipped: $(top)/util/cbfstool/fmd_scanner.l
echo " LEX util/cbfstool/fmd_scanner.[ch]"
- $(TOOLLEX) -t --header-file=$(top)/util/cbfstool/fmd_scanner.h_shipped $< >$(top)/util/cbfstool/fmd_scanner.c_shipped
+ $(TOOLLEX) -L -o $@ --header-file=$(patsubst %.c_shipped,%.h_shipped,$@) $<
# the .c rule also creates .h
$(top)/util/cbfstool/fmd_parser.h_shipped: $(top)/util/cbfstool/fmd_parser.c_shipped
$(top)/util/cbfstool/fmd_parser.c_shipped: $(top)/util/cbfstool/fmd_parser.y
echo " YACC util/cbfstool/fmd_parser.[ch]"
- $(TOOLYACC) -d $<
- mv -f y.tab.c $(top)/util/cbfstool/fmd_parser.c_shipped
- mv -f y.tab.h $(top)/util/cbfstool/fmd_parser.h_shipped
+ $(TOOLYACC) -l -o $@ --defines=$(patsubst %.c_shipped,%.h_shipped,$@) $<
endif # CONFIG_FMD_GENPARSER