cvs commit: src/gnu/usr.bin/gdb/gdb

Simon 'corecode' Schubert corecode at
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 to make
it -jN
(as pointed out by Brad).
We can't if YFLAGS include -d. Because our yacc has a slightly
meaning of the -o option. It does set the name of the c-file and 
the prefix for the headre file.
Ah.. yuck. What about this, then?

-# XXX not -j safe
+# XXX hopefully -j safe..
-	mv ${.TARGET}
+	${YACC} ${YFLAGS} -b $$$$ ${.IMPSRC}
+	mv $$$$.tab.c ${.TARGET}
+.if !empty(${YFLAGS:M-d})
+	mv $$$$.tab.h
This didn't actually work, but the below should(still need tweaking):
	@echo "WARNING: using messy implicit rule..." 1>&2
.if !empty(YFLAGS:M-d)
	{ pid=$$$$; ${YACC} ${YFLAGS} -b $$pid ${.IMPSRC} && \
	mv $$ ${.TARGET} && \
	mv $$ ${.TARGET:S/.c/.h/}; }
        ${YACC} ${YFLAGS} ${.IMPSRC}
The first version always produced a 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

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.

\ /
 \     ASCII Ribbon Campaign
/ \  Against HTML Mail and News
-------------- 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: <>

More information about the Commits mailing list