> On 4 Jul 2017, at 12:54, Michael W. Bombardieri <[email protected]> wrote:
> 
> Hi,
> 
> When building bc, yacc can directly write bc.c instead of renaming
> the file with mv. Does this look any better?

there's some debate at the moment about the least worst or best way of handling 
this kind of stuff.

it is definitely not correct to split the targets that yacc produces. making 
bc.c depend on y.tab.h without shell commands to generate it will make it 
impossible for make to get bc.c regenerated if bc.c has been deleted, but not 
y.tab.h.

cheers,
dlg

> 
> - Michael
> 
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/src/usr.bin/bc/Makefile,v
> retrieving revision 1.9
> diff -u -p -u -r1.9 Makefile
> --- Makefile  3 Jul 2017 00:17:52 -0000       1.9
> +++ Makefile  4 Jul 2017 02:50:46 -0000
> @@ -10,11 +10,10 @@ DPADD+=           ${LIBEDIT} ${LIBCURSES} ${LIBCR
> 
> .PATH:                ${.CURDIR}/../dc
> 
> -bc.c y.tab.h: bc.y
> -     ${YACC} -d ${.CURDIR}/bc.y
> -     mv y.tab.c bc.c
> +y.tab.h: bc.y
> +     ${YACC} -o ${.CURDIR}/bc.c ${.CURDIR}/bc.y
> 
> -scan.o: y.tab.h
> +bc.c scan.o: y.tab.h
> 
> beforeinstall:
>       install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/bc.library \
> 

Reply via email to