bug-bash
[Top][All Lists]
Advanced

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

[patch] fix parallel build issues with parse.y


From: Mike Frysinger
Subject: [patch] fix parallel build issues with parse.y
Date: Fri, 7 Oct 2011 15:53:03 -0400
User-agent: KMail/1.13.7 (Linux/3.1.0-rc4; KDE/4.6.5; x86_64; ; )

the current yacc rules allow multiple runs to generate the same files.  usually
this doesn't come up as the generated files are shipped in the tarball, but
when you modify parse.y (applying a patch or developing or whatever), you can
hit this problem.

simple way of showing this:
        make -j y.tab.{c,h}
a correct system would not show the yacc parser running twice :)

simple patch is to have the .h file depend on the .c file, and have the .h file
itself issue a dummy rule (to avoid make thinking things changed).
-mike

--- a/Makefile.in
+++ b/Makefile.in
@@ -579,16 +579,17 @@
 
 # old rules
 GRAM_H = parser-built
-y.tab.o: y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h
+y.tab.o: y.tab.h y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h
 ${GRAM_H}:     y.tab.h
        @-if test -f y.tab.h ; then \
                cmp -s $@ y.tab.h 2>/dev/null || cp -p y.tab.h $@; \
        fi
-y.tab.c y.tab.h: parse.y
+y.tab.c: parse.y
 #      -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi
        $(YACC) -d $(srcdir)/parse.y
        touch parser-built
 #      -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; else cp -p 
y.tab.h ${GRAM_H}; fi
+y.tab.h: y.tab.c ; @true
 
 # experimental new rules - work with GNU make but not BSD (or OSF) make
 #y.tab.o: y.tab.c y.tab.h



reply via email to

[Prev in Thread] Current Thread [Next in Thread]