DragonFly BSD
DragonFly commits List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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

From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Thu, 18 Nov 2004 18:33:39 +0100

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
meaning of the -o option. It does set the name of the c-file and ALSO
the prefix for the headre file.
Ah.. yuck. What about this, then?

-# XXX not -j safe
+# XXX hopefully -j safe..
-	mv y.tab.c ${.TARGET}
+	${YACC} ${YFLAGS} -b $$$$ ${.IMPSRC}
+	mv $$$$.tab.c ${.TARGET}
+.if !empty(${YFLAGS:M-d})
+	mv $$$$.tab.h y.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 $$pid.tab.c ${.TARGET} && \
	mv $$pid.tab.h ${.TARGET:S/.c/.h/}; }
        ${YACC} ${YFLAGS} ${.IMPSRC}

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.


\ /
 \     ASCII Ribbon Campaign
/ \  Against HTML Mail and News

Attachment: PGP.sig
Description: This is a digitally signed message part

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