]> git.donarmstrong.com Git - lilypond.git/commitdiff
Keep bison-generated files in sync.
authorJulien Rioux <julien.rioux@gmail.com>
Mon, 2 Sep 2013 08:41:50 +0000 (10:41 +0200)
committerJulien Rioux <jrioux@physics.utoronto.ca>
Wed, 11 Sep 2013 08:42:19 +0000 (04:42 -0400)
Use a single rule to build header and source files from
the syntax file, thus avoiding any possibility to have
`make' rebuild one but not the other, which might happen
if the syntax and target files have almost the same but
slightly differing timestamps.

See http://www.mail-archive.com/bug-lilypond@gnu.org/msg37081.html

Fixes issue 3528: Keep bison-generated files in sync.
http://code.google.com/p/lilypond/issues/detail?id=3528

stepmake/stepmake/c++-rules.make
stepmake/stepmake/c-rules.make

index a368f4f6669b6e2d223604bce7507c824c4e8f79..8de00bce07a8c80c06d4362b47a101f60d7db6e8 100644 (file)
@@ -12,13 +12,8 @@ $(outdir)/%.lo: %.cc
 $(outdir)/%.lo: $(outdir)/%.cc
        $(DO_LO_DEP) $(CXX) -c $(ALL_CXXFLAGS) $(PIC_FLAGS) -o $@ $<
 
-$(outdir)/%.cc: %.yy
-       $(BISON) -o $@  $<
-
-$(outdir)/%.hh: %.yy
-       $(BISON) -o $(subst .hh,-tmp.cc,$@) -d  $<
-       rm $(subst .hh,-tmp.cc,$@)
-       mv $(subst .hh,-tmp.hh,$@) $@
+$(outdir)/%.cc $(outdir)/%.hh: %.yy
+       $(BISON) -d -o $(outdir)/$*.cc $<
 
 $(outdir)/%.cc: %.ll
        $(FLEX) -Cfe -p -p -o$@ $<
index 620275baa177e67313535571393c21d85e90e205..954e7a33a0c306bea99fc77c041e2bd994895bb2 100644 (file)
@@ -12,14 +12,8 @@ $(outdir)/%.lo: %.c
 $(outdir)/%.lo: %.c
        $(DO_LO_DEP) $(CC) -c $(ALL_CFLAGS) $(PIC_FLAGS) -o $@ $<
 
-$(outdir)/%.c: %.y
-       $(BISON) $<
-       mv $(*F).tab.c $@
-
-$(outdir)/%.h: %.y
-       $(BISON) -d $<
-       mv $(*F).tab.h $@
-       rm -f $(*F).tab.c # if this happens in the wrong order it triggers recompile of the .cc file
+$(outdir)/%.c $(outdir)/%.h: %.y
+       $(BISON) -d -o $(outdir)/$*.c $<
 
 $(outdir)/%.c: %.l
        $(FLEX) -Cfe -p -p -o$@ $<