blob: ce4f99935de59012883ab39ba2f2f8b85203083d [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 Yamadafaabed22020-08-01 21:27:18 +09003hostprogs-always-y += genksyms
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
Arnaud Lacombe880f4492011-05-23 00:05:28 -04005genksyms-objs := genksyms.o parse.tab.o lex.lex.o
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Masahiro Yamada833e6222018-03-23 22:04:32 +09007# FIXME: fix the ambiguous grammar in parse.y and delete this hack
8#
9# Suppress shift/reduce, reduce/reduce conflicts warnings
10# unless W=1 is specified.
11#
12# Just in case, run "$(YACC) --version" without suppressing stderr
13# so that 'bison: not found' will be displayed if it is missing.
Masahiro Yamadae27128d2019-09-01 01:25:55 +090014ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
Masahiro Yamada833e6222018-03-23 22:04:32 +090015
Mauro Rossi0da7e432018-04-24 20:08:18 +090016quiet_cmd_bison_no_warn = $(quiet_cmd_bison)
Masahiro Yamada833e6222018-03-23 22:04:32 +090017 cmd_bison_no_warn = $(YACC) --version >/dev/null; \
18 $(cmd_bison) 2>/dev/null
19
Masahiro Yamada6ba7dc62019-07-21 01:27:39 +090020$(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE
Masahiro Yamada833e6222018-03-23 22:04:32 +090021 $(call if_changed,bison_no_warn)
22
Masahiro Yamada833e6222018-03-23 22:04:32 +090023endif
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025# -I needed for generated C source (shipped source)
Masahiro Yamada9cc342f2019-05-13 15:22:16 +090026HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)
27HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
29# dependencies on generated files need to be listed explicitly
Linus Torvaldsbb3290d2017-08-19 10:17:02 -070030$(obj)/lex.lex.o: $(obj)/parse.tab.h