18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_cihostprogs-always-y	+= genksyms
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_cigenksyms-objs	:= genksyms.o parse.tab.o lex.lex.o
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci# FIXME: fix the ambiguous grammar in parse.y and delete this hack
88c2ecf20Sopenharmony_ci#
98c2ecf20Sopenharmony_ci# Suppress shift/reduce, reduce/reduce conflicts warnings
108c2ecf20Sopenharmony_ci# unless W=1 is specified.
118c2ecf20Sopenharmony_ci#
128c2ecf20Sopenharmony_ci# Just in case, run "$(YACC) --version" without suppressing stderr
138c2ecf20Sopenharmony_ci# so that 'bison: not found' will be displayed if it is missing.
148c2ecf20Sopenharmony_ciifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciquiet_cmd_bison_no_warn = $(quiet_cmd_bison)
178c2ecf20Sopenharmony_ci      cmd_bison_no_warn = $(YACC) --version >/dev/null; \
188c2ecf20Sopenharmony_ci			  $(cmd_bison) 2>/dev/null
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci$(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE
218c2ecf20Sopenharmony_ci	$(call if_changed,bison_no_warn)
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ciendif
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci# -I needed for generated C source (shipped source)
268c2ecf20Sopenharmony_ciHOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)
278c2ecf20Sopenharmony_ciHOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci# dependencies on generated files need to be listed explicitly
308c2ecf20Sopenharmony_ci$(obj)/lex.lex.o: $(obj)/parse.tab.h
31