2017-11-01 15:07:57 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2020-08-01 21:27:18 +09:00
|
|
|
hostprogs-always-y += genksyms
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-05-23 00:05:28 -04:00
|
|
|
genksyms-objs := genksyms.o parse.tab.o lex.lex.o
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2018-03-23 22:04:32 +09:00
|
|
|
# FIXME: fix the ambiguous grammar in parse.y and delete this hack
|
|
|
|
|
#
|
|
|
|
|
# Suppress shift/reduce, reduce/reduce conflicts warnings
|
|
|
|
|
# unless W=1 is specified.
|
|
|
|
|
#
|
|
|
|
|
# Just in case, run "$(YACC) --version" without suppressing stderr
|
|
|
|
|
# so that 'bison: not found' will be displayed if it is missing.
|
2019-09-01 01:25:55 +09:00
|
|
|
ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
|
2018-03-23 22:04:32 +09:00
|
|
|
|
2018-04-24 20:08:18 +09:00
|
|
|
quiet_cmd_bison_no_warn = $(quiet_cmd_bison)
|
2018-03-23 22:04:32 +09:00
|
|
|
cmd_bison_no_warn = $(YACC) --version >/dev/null; \
|
|
|
|
|
$(cmd_bison) 2>/dev/null
|
|
|
|
|
|
2019-07-21 01:27:39 +09:00
|
|
|
$(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE
|
2018-03-23 22:04:32 +09:00
|
|
|
$(call if_changed,bison_no_warn)
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
2021-04-24 21:08:29 +09:00
|
|
|
# -I needed for generated C source to include headers in source tree
|
2019-05-13 15:22:16 +09:00
|
|
|
HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)
|
|
|
|
|
HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
# dependencies on generated files need to be listed explicitly
|
2017-08-19 10:17:02 -07:00
|
|
|
$(obj)/lex.lex.o: $(obj)/parse.tab.h
|