cvs commit: src/gnu/usr.bin/gdb/gdb
Simon 'corecode' Schubert
corecode at fs.ei.tum.de
Thu Nov 18 09:34:19 PST 2004
On 18.11.2004, at 18:00, YONETANI Tomokazu wrote:
The question is, whether we can change .y.c rule in sys.mk to make
it -jN
(as pointed out by Brad).
We can't if YFLAGS include -d. Because our yacc has a slightly
surprising
meaning of the -o option. It does set the name of the c-file and
ALSO
alters
the prefix for the headre file.
Ah.. yuck. What about this, then?
-# XXX not -j safe
+# XXX hopefully -j safe..
.y.c:
- ${YACC} ${YFLAGS} ${.IMPSRC}
- mv y.tab.c ${.TARGET}
+ ${YACC} ${YFLAGS} -b $$$$ ${.IMPSRC}
+ mv $$$$.tab.c ${.TARGET}
+.if !empty(${YFLAGS:M-d})
+ mv $$$$.tab.h y.tab.h
+.endif
This didn't actually work, but the below should(still need tweaking):
.y.c:
@echo "WARNING: using messy implicit rule..." 1>&2
.if !empty(YFLAGS:M-d)
{ pid=$$$$; ${YACC} ${YFLAGS} -b $$pid ${.IMPSRC} && \
mv $$pid.tab.c ${.TARGET} && \
mv $$pid.tab.h ${.TARGET:S/.c/.h/}; }
.else
${YACC} ${YFLAGS} ${.IMPSRC}
.endif
The first version always produced a y.tab.h if YFLAGS=-d. Your second
version produces a ${.TARGET:S/.c/.h/}, is this on purpose? I like the
latter much more. But then I'd rather change yacc to directly produce a
outfile.c instead of a outfile.tab.c.
This is really evil. Don't we want to just kick this questionable
"portability"? We already broke much more legacy things...
Do we need to add a magic word to compile 3rd party codes that depend
on this rule?
My 2â¬Â¢: No. If somebody wants to be "portable", he'd use %POSIX or
automake, which will (hopefully) be able to cope with that.
cheers
simon
--
/"\
\ /
\ ASCII Ribbon Campaign
/ \ Against HTML Mail and News
Attachment:
PGP.sig
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00005.pgp
Type: application/octet-stream
Size: 186 bytes
Desc: "Description: This is a digitally signed message part"
URL: <http://lists.dragonflybsd.org/pipermail/commits/attachments/20041118/04b62246/attachment-0022.obj>
More information about the Commits
mailing list