Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # SPDX-License-Identifier: GPL-2.0
  2. hostprogs-y := genksyms
  3. always := $(hostprogs-y)
  4. genksyms-objs := genksyms.o parse.tab.o lex.lex.o
  5. # FIXME: fix the ambiguous grammar in parse.y and delete this hack
  6. #
  7. # Suppress shift/reduce, reduce/reduce conflicts warnings
  8. # unless W=1 is specified.
  9. #
  10. # Just in case, run "$(YACC) --version" without suppressing stderr
  11. # so that 'bison: not found' will be displayed if it is missing.
  12. ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
  13. quiet_cmd_bison_no_warn = $(quiet_cmd_bison)
  14. cmd_bison_no_warn = $(YACC) --version >/dev/null; \
  15. $(cmd_bison) 2>/dev/null
  16. $(obj)/parse.tab.c: $(src)/parse.y FORCE
  17. $(call if_changed,bison_no_warn)
  18. quiet_cmd_bison_h_no_warn = $(quiet_cmd_bison_h)
  19. cmd_bison_h_no_warn = $(YACC) --version >/dev/null; \
  20. $(cmd_bison_h) 2>/dev/null
  21. $(obj)/parse.tab.h: $(src)/parse.y FORCE
  22. $(call if_changed,bison_h_no_warn)
  23. endif
  24. # -I needed for generated C source (shipped source)
  25. HOSTCFLAGS_parse.tab.o := -I$(src)
  26. HOSTCFLAGS_lex.lex.o := -I$(src)
  27. # dependencies on generated files need to be listed explicitly
  28. $(obj)/lex.lex.o: $(obj)/parse.tab.h