summaryrefslogtreecommitdiff
path: root/stepmake
diff options
context:
space:
mode:
authorJulien Rioux <julien.rioux@gmail.com>2013-09-02 10:41:50 +0200
committerJulien Rioux <jrioux@physics.utoronto.ca>2013-09-11 04:42:19 -0400
commit42cb7d446827dce32a42b5b243bda522518b3d46 (patch)
tree3f470c5ddfdc8ba86609f345178e9cd662e2c2d5 /stepmake
parentef52d35115c1e05795b8364d064feeeb978c6c87 (diff)
Keep bison-generated files in sync.
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
Diffstat (limited to 'stepmake')
-rw-r--r--stepmake/stepmake/c++-rules.make9
-rw-r--r--stepmake/stepmake/c-rules.make10
2 files changed, 4 insertions, 15 deletions
diff --git a/stepmake/stepmake/c++-rules.make b/stepmake/stepmake/c++-rules.make
index a368f4f666..8de00bce07 100644
--- a/stepmake/stepmake/c++-rules.make
+++ b/stepmake/stepmake/c++-rules.make
@@ -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$@ $<
diff --git a/stepmake/stepmake/c-rules.make b/stepmake/stepmake/c-rules.make
index 620275baa1..954e7a33a0 100644
--- a/stepmake/stepmake/c-rules.make
+++ b/stepmake/stepmake/c-rules.make
@@ -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$@ $<