xref: /openbmc/linux/scripts/genksyms/Makefile (revision 8be98d2f2a0a262f8bf8a0bc1fdf522b3c7aab17)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
21da177e4SLinus Torvalds
3faabed29SMasahiro Yamadahostprogs-always-y	+= genksyms
41da177e4SLinus Torvalds
5880f4499SArnaud Lacombegenksyms-objs	:= genksyms.o parse.tab.o lex.lex.o
61da177e4SLinus Torvalds
7833e6224SMasahiro Yamada# FIXME: fix the ambiguous grammar in parse.y and delete this hack
8833e6224SMasahiro Yamada#
9833e6224SMasahiro Yamada# Suppress shift/reduce, reduce/reduce conflicts warnings
10833e6224SMasahiro Yamada# unless W=1 is specified.
11833e6224SMasahiro Yamada#
12833e6224SMasahiro Yamada# Just in case, run "$(YACC) --version" without suppressing stderr
13833e6224SMasahiro Yamada# so that 'bison: not found' will be displayed if it is missing.
14e27128dbSMasahiro Yamadaifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
15833e6224SMasahiro Yamada
160da7e432SMauro Rossiquiet_cmd_bison_no_warn = $(quiet_cmd_bison)
17833e6224SMasahiro Yamada      cmd_bison_no_warn = $(YACC) --version >/dev/null; \
18833e6224SMasahiro Yamada			  $(cmd_bison) 2>/dev/null
19833e6224SMasahiro Yamada
206ba7dc66SMasahiro Yamada$(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE
21833e6224SMasahiro Yamada	$(call if_changed,bison_no_warn)
22833e6224SMasahiro Yamada
23833e6224SMasahiro Yamadaendif
24833e6224SMasahiro Yamada
25*382243f3SMasahiro Yamada# -I needed for generated C source to include headers in source tree
269cc342f6SMasahiro YamadaHOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)
279cc342f6SMasahiro YamadaHOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)
281da177e4SLinus Torvalds
291da177e4SLinus Torvalds# dependencies on generated files need to be listed explicitly
30bb3290d9SLinus Torvalds$(obj)/lex.lex.o: $(obj)/parse.tab.h
31