From owner-freebsd-current Thu Jun 11 03:56:49 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA17246 for freebsd-current-outgoing; Thu, 11 Jun 1998 03:56:49 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA17241 for ; Thu, 11 Jun 1998 03:56:45 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id UAA03420; Thu, 11 Jun 1998 20:56:42 +1000 Date: Thu, 11 Jun 1998 20:56:42 +1000 From: Bruce Evans Message-Id: <199806111056.UAA03420@godzilla.zeta.org.au> To: bde@zeta.org.au, ianh@tortuga.com.au Subject: Re: src Makefile fix Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> It would be better to make lex not depend on yacc -o (as it used to). >> >Perhaps a conditional dependence on "yacc -o". I'd like to be able to >build -current of 2.2.5, or whatever release I have installed on my main >machine. The included patch will require users of older systems to modify >/etc/make.conf, while letting the the newer system continue as now. > >The problem is that it is ugly, and as time goes on, will become a barnacle >that needs to be removed. This makes the extra build step look non-ugly :-). >ndex: bsd.dep.mk >=================================================================== >RCS file: /home/freebsd/cvs/src/share/mk/bsd.dep.mk,v >retrieving revision 1.25 >diff -c -r1.25 bsd.dep.mk >*** bsd.dep.mk 1998/06/05 18:38:54 1.25 >--- bsd.dep.mk 1998/06/11 09:16:34 >*************** >*** 55,70 **** > SRCS:= ${SRCS} y.tab.h > CLEANFILES:= ${CLEANFILES} y.tab.c y.tab.h > .elif ${YFLAGS:M-d} != "" > .for _YH in ${_YC:S/.c/.h/} > .ORDER: ${_YC} ${_YH} > ${_YC} ${_YH}: ${_YSRC} >! ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} > SRCS:= ${SRCS} ${_YH} > CLEANFILES:= ${CLEANFILES} ${_YH} > .endfor > .else > ${_YC}: ${_YSRC} >! ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} > .endif > .endfor > .endfor >--- 55,78 ---- > SRCS:= ${SRCS} y.tab.h > CLEANFILES:= ${CLEANFILES} y.tab.c y.tab.h > .elif ${YFLAGS:M-d} != "" >+ YACCOPY ?= no >+ .if ${YACCOPY} == no >+ _YO_OPT = -o ${_YC} >+ _YO_MV = >+ .else >+ _YO_OPT = >+ _YO_MV = mv y.tab.c ${_YC} >+ .endif > .for _YH in ${_YC:S/.c/.h/} > .ORDER: ${_YC} ${_YH} > ${_YC} ${_YH}: ${_YSRC} >! ${YACC} ${YFLAGS} ${_YO_OPT} ${.ALLSRC}; ${_YO_MV} > SRCS:= ${SRCS} ${_YH} > CLEANFILES:= ${CLEANFILES} ${_YH} > .endfor > .else > ${_YC}: ${_YSRC} >! ${YACC} ${YFLAGS} ${_YO_OPT} ${.ALLSRC}; ${_YO_MV} > .endif > .endfor > .endfor > I don't see how this actually works - it doesn't rename y.tab.h. This slightly broken version can be achieved using existing compatibility cruft (y.tab.h in SRCS) instead of YACCOPY. -o is not used when the applcation wants y.tab.h instead of foo.h created from foo.y since foo.h might (and in practice, does) conflict with a source file. lex/Makefile can explot this and rename (actually, copy) y.tab.h itself: diff -c2 Makefile~ Makefile *** Makefile~ Tue May 5 05:10:20 1998 --- Makefile Thu Jun 11 20:36:09 1998 *************** *** 15,20 **** LINKS+= ${BINDIR}/lex ${BINDIR}/flex++ ! SRCS= scan.c ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \ ! skel.c sym.c tblcmp.c yylex.c LFLAGS+= -is CFLAGS+= -I. -I${.CURDIR} --- 15,20 ---- LINKS+= ${BINDIR}/lex ${BINDIR}/flex++ ! SRCS= scan.c ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.h \ ! parse.y skel.c sym.c tblcmp.c y.tab.h yylex.c LFLAGS+= -is CFLAGS+= -I. -I${.CURDIR} *************** *** 24,28 **** MLINKS+= lex.1 lex++.1 ! CLEANFILES= scan.c .if !defined(NOLIB) --- 24,31 ---- MLINKS+= lex.1 lex++.1 ! CLEANFILES= parse.h scan.c ! ! parse.h: y.tab.h ! cp ${.ALLSRC} ${.TARGET} .if !defined(NOLIB) Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message