help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ignore specific file in VPATH/vpath


From: Paul Smith
Subject: Re: ignore specific file in VPATH/vpath
Date: Thu, 10 May 2018 07:07:54 -0400

On Wed, 2018-05-09 at 14:30 +0200, Jannick wrote:
> Separately, an additional note: make's YACC built-in recipe
> 
> %.c: %.y
> #  recipe to execute (built-in):
>         $(YACC.y) $< 
>          mv -f y.tab.c $@
> 
> appears to assume that YACC/bison's output file name defaults to y.tab.c.
> However, it is $*.tab.c for bison >= 3.0 (at least).

Can you tell us what your makefile is using for a "yacc" command?

The default in GNU make is:

  YACC = yacc

and this default, and the behavior of the rules for generating source
and object files using yacc, is required by the POSIX specification for
GNU make: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html

Are you overriding this value to set it to "bison" instead in your
makefile?  Or, does your system actually provide a "yacc" command?

The "yacc" command is defined by POSIX including its generated output
file names: http://pubs.opengroup.org/onlinepubs/009604599/utilities/yacc.html

Basically it's up to you to either (a) use a standard-conforming "yacc"
command, or (b) modify the YACC variable so that it contains a
standard-conforming yacc command, or (c) rewrite the rule to use a
different yacc command.

If your system provides a "yacc" command (option (a)) and it does not
conform to POSIX (generates the wrong output) then that's a bug in your
OS or distribution and you should report that to them.

If you want to follow option (b) above and replace "yacc" with "bison",
then instead of using:

  YACC = bison

you need to use:

  YACC = bison -y

which tells Bison to use traditional output file naming.

Or of course you can use option (c), as you've done, and rewrite the
rule to use whatever output you like.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]