1 From 42cb7d446827dce32a42b5b243bda522518b3d46 Mon Sep 17 00:00:00 2001
2 From: Julien Rioux <julien.rioux@gmail.com>
3 Date: Mon, 2 Sep 2013 10:41:50 +0200
4 Subject: [PATCH] Keep bison-generated files in sync.
6 Use a single rule to build header and source files from
7 the syntax file, thus avoiding any possibility to have
8 `make' rebuild one but not the other, which might happen
9 if the syntax and target files have almost the same but
10 slightly differing timestamps.
12 See http://www.mail-archive.com/bug-lilypond@gnu.org/msg37081.html
14 Fixes issue 3528: Keep bison-generated files in sync.
15 http://code.google.com/p/lilypond/issues/detail?id=3528
17 stepmake/stepmake/c++-rules.make | 9 ++-------
18 stepmake/stepmake/c-rules.make | 10 ++--------
19 2 files changed, 4 insertions(+), 15 deletions(-)
21 diff --git a/stepmake/stepmake/c++-rules.make b/stepmake/stepmake/c++-rules.make
22 index a368f4f..8de00bc 100644
23 --- a/stepmake/stepmake/c++-rules.make
24 +++ b/stepmake/stepmake/c++-rules.make
25 @@ -12,13 +12,8 @@ $(outdir)/%.lo: %.cc
26 $(outdir)/%.lo: $(outdir)/%.cc
27 $(DO_LO_DEP) $(CXX) -c $(ALL_CXXFLAGS) $(PIC_FLAGS) -o $@ $<
33 - $(BISON) -o $(subst .hh,-tmp.cc,$@) -d $<
34 - rm $(subst .hh,-tmp.cc,$@)
35 - mv $(subst .hh,-tmp.hh,$@) $@
36 +$(outdir)/%.cc $(outdir)/%.hh: %.yy
37 + $(BISON) -d -o $(outdir)/$*.cc $<
40 $(FLEX) -Cfe -p -p -o$@ $<
41 diff --git a/stepmake/stepmake/c-rules.make b/stepmake/stepmake/c-rules.make
42 index 620275b..954e7a3 100644
43 --- a/stepmake/stepmake/c-rules.make
44 +++ b/stepmake/stepmake/c-rules.make
45 @@ -12,14 +12,8 @@ $(outdir)/%.lo: %.c
47 $(DO_LO_DEP) $(CC) -c $(ALL_CFLAGS) $(PIC_FLAGS) -o $@ $<
56 - rm -f $(*F).tab.c # if this happens in the wrong order it triggers recompile of the .cc file
57 +$(outdir)/%.c $(outdir)/%.h: %.y
58 + $(BISON) -d -o $(outdir)/$*.c $<
61 $(FLEX) -Cfe -p -p -o$@ $<