blob: d328de1e10eeca1ef0205a662b3f42feeafb1cf0 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
Masahiro Yamada5f2fb522020-02-02 01:49:24 +09003hostprogs := genksyms
4always-y := $(hostprogs)
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
Arnaud Lacombe880f4492011-05-23 00:05:28 -04006genksyms-objs := genksyms.o parse.tab.o lex.lex.o
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
Masahiro Yamada833e6222018-03-23 22:04:32 +09008# FIXME: fix the ambiguous grammar in parse.y and delete this hack
9#
10# Suppress shift/reduce, reduce/reduce conflicts warnings
11# unless W=1 is specified.
12#
13# Just in case, run "$(YACC) --version" without suppressing stderr
14# so that 'bison: not found' will be displayed if it is missing.
Masahiro Yamadae27128d2019-09-01 01:25:55 +090015ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
Masahiro Yamada833e6222018-03-23 22:04:32 +090016
Mauro Rossi0da7e432018-04-24 20:08:18 +090017quiet_cmd_bison_no_warn = $(quiet_cmd_bison)
Masahiro Yamada833e6222018-03-23 22:04:32 +090018 cmd_bison_no_warn = $(YACC) --version >/dev/null; \
19 $(cmd_bison) 2>/dev/null
20
Masahiro Yamada6ba7dc62019-07-21 01:27:39 +090021$(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE
Masahiro Yamada833e6222018-03-23 22:04:32 +090022 $(call if_changed,bison_no_warn)
23
Masahiro Yamada833e6222018-03-23 22:04:32 +090024endif
25
Linus Torvalds1da177e2005-04-16 15:20:36 -070026# -I needed for generated C source (shipped source)
Masahiro Yamada9cc342f2019-05-13 15:22:16 +090027HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)
28HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
30# dependencies on generated files need to be listed explicitly
Linus Torvaldsbb3290d2017-08-19 10:17:02 -070031$(obj)/lex.lex.o: $(obj)/parse.tab.h