Subject: ATTN: New handling of yacc source files
To: None <current-users@NetBSD.ORG, tech-toolchain@NetBSD.ORG>
From: Todd Vierling <tv@NetBSD.ORG>
List: tech-toolchain
Date: 04/08/1998 20:34:47
In order to be more standards compliant and "clean," I have changed sys.mk
in NetBSD-current to avoid creating a `y.tab.h' file by default.  This has
included commits around the tree to fix all the hackery various programs
have used to work around this. 

There are now two ways to get the .y.c rule to build you a header file as
well as a C source file:

- If you include any of the <bsd.*.mk> files as the NetBSD source tree does,
  simply set YHEADER.  This directive tells <bsd.sys.mk> to generate a
  header file with the same basename as the yacc file (i.e. gram.y outputs
  gram.c and gram.h).  It also defindes a .y.h rule that will generate the
  file.  The <bsd.{kmod,lib,prog}.mk> files will add the header to the
  ${CLEANFILES} list automatically if the .y file is in ${SRCS}. 

- If you're only using <sys.mk> (i.e. the default make rules), you shouldn't
  be depending on the .y.c rule to create a y.tab.h file for you--that's not
  specified by any standard.  Instead, you can set YFLAGS=-d to create the
  y.tab.h file (not the same basename as the yacc file, it's actually called
  "y.tab.h"), or override the .y.c rule.  The previous behavior was to
  default YFLAGS to -d, which created the header file.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)