]> git.donarmstrong.com Git - lilypond.git/blob - debian/patches/fix_bison_parser_generation_rules
Update changelog
[lilypond.git] / debian / patches / fix_bison_parser_generation_rules
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.
5
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.
11
12 See http://www.mail-archive.com/bug-lilypond@gnu.org/msg37081.html
13
14 Fixes issue 3528: Keep bison-generated files in sync.
15 http://code.google.com/p/lilypond/issues/detail?id=3528
16 ---
17  stepmake/stepmake/c++-rules.make |  9 ++-------
18  stepmake/stepmake/c-rules.make   | 10 ++--------
19  2 files changed, 4 insertions(+), 15 deletions(-)
20
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 $@ $<
28  
29 -$(outdir)/%.cc: %.yy
30 -       $(BISON) -o $@  $<
31 -
32 -$(outdir)/%.hh: %.yy
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 $<
38  
39  $(outdir)/%.cc: %.ll
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
46  $(outdir)/%.lo: %.c
47         $(DO_LO_DEP) $(CC) -c $(ALL_CFLAGS) $(PIC_FLAGS) -o $@ $<
48  
49 -$(outdir)/%.c: %.y
50 -       $(BISON) $<
51 -       mv $(*F).tab.c $@
52 -
53 -$(outdir)/%.h: %.y
54 -       $(BISON) -d $<
55 -       mv $(*F).tab.h $@
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 $<
59  
60  $(outdir)/%.c: %.l
61         $(FLEX) -Cfe -p -p -o$@ $<
62 -- 
63 1.8.4.rc3