gnustep-dev
[Top][All Lists]
Advanced

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

Re: Incompatible change in rules.make as of v1.149


From: Nicola Pero
Subject: Re: Incompatible change in rules.make as of v1.149
Date: Tue, 22 Apr 2003 16:46:03 +0100 (BST)

> > Interesting.
> >
> > :-)
> >
> > The rule you need is probably something like -
> >
> > %.c: %.y
> >     $(YACC) $(YACC_FLAGS) $<
> >     mv -f y.tab.c $@
> 
> Hi Nicola,
> 
> just found out that I forgot to ask a question, but anyways, your rule 
> directly leads to it. ;-)
> Why not use a rule such as:
> 
> %.c: %.y
>       $(BISON) $(BISON_FLAGS) -o $@ $<
> 
> The problem here is, I'm not sure which is better. I think that I heard 
> people say that bison usually produces better code than yacc, but I 
> might be wrong. If that would be the case however, then it might 
> possibly be best to decided which rule to use while configuring GNUstep 
> make - if bison is present, take my rule, if not, go with yacc. On the 
> other hand, this might be overkill.

YACC is more portable, which is why it seems more natural as a default
(it's the same default that make itself is using and which was used before
I disabled the built in rules).

If you are on a GNU system, 'yacc' is really just an alias for 'bison -y',
so I'd expect the generated code to be of the same quality no matter if
you use YACC or BISON.

If you want to use BISON because you need/want some special bison features
... then you are probably an enough advanced user that you can overwrite 
the default rule with your own. :-)

Just adding 

%.c: %.y
        $(BISON) $(BISON_FLAGS) -o $@ $<

to your GNUmakefile.postamble will override the gnustep-make %.c:  %.y
YACC-based rule with your own.  It's simple enough.

Configuring gnustep-make to use YACC or BISON doesn't seem a great idea
because some projects might prefer YACC (if targeting portability) while
other projects might prefer BISON (if using special bison features).  It
really depends on the project.





reply via email to

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