Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | |
Masahiro Yamada | faabed2 | 2020-08-01 21:27:18 +0900 | [diff] [blame] | 3 | hostprogs-always-y += genksyms |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
Arnaud Lacombe | 880f449 | 2011-05-23 00:05:28 -0400 | [diff] [blame] | 5 | genksyms-objs := genksyms.o parse.tab.o lex.lex.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | |
Masahiro Yamada | 833e622 | 2018-03-23 22:04:32 +0900 | [diff] [blame] | 7 | # 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 Yamada | e27128d | 2019-09-01 01:25:55 +0900 | [diff] [blame] | 14 | ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) |
Masahiro Yamada | 833e622 | 2018-03-23 22:04:32 +0900 | [diff] [blame] | 15 | |
Mauro Rossi | 0da7e43 | 2018-04-24 20:08:18 +0900 | [diff] [blame] | 16 | quiet_cmd_bison_no_warn = $(quiet_cmd_bison) |
Masahiro Yamada | 833e622 | 2018-03-23 22:04:32 +0900 | [diff] [blame] | 17 | cmd_bison_no_warn = $(YACC) --version >/dev/null; \ |
| 18 | $(cmd_bison) 2>/dev/null |
| 19 | |
Masahiro Yamada | 6ba7dc6 | 2019-07-21 01:27:39 +0900 | [diff] [blame] | 20 | $(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE |
Masahiro Yamada | 833e622 | 2018-03-23 22:04:32 +0900 | [diff] [blame] | 21 | $(call if_changed,bison_no_warn) |
| 22 | |
Masahiro Yamada | 833e622 | 2018-03-23 22:04:32 +0900 | [diff] [blame] | 23 | endif |
| 24 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | # -I needed for generated C source (shipped source) |
Masahiro Yamada | 9cc342f | 2019-05-13 15:22:16 +0900 | [diff] [blame] | 26 | HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src) |
| 27 | HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
| 29 | # dependencies on generated files need to be listed explicitly |
Linus Torvalds | bb3290d | 2017-08-19 10:17:02 -0700 | [diff] [blame] | 30 | $(obj)/lex.lex.o: $(obj)/parse.tab.h |