Avoid running bison and flex multiple times when doing parallel builds

issue#70
Sébastien Villemot 2019-08-14 11:21:47 +02:00
parent 30aaf93ca7
commit ecad2dfb10
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 15 additions and 5 deletions

View File

@ -68,14 +68,20 @@ dynare_m_CPPFLAGS = $(BOOST_CPPFLAGS) -I.
dynare_m_LDFLAGS = $(AM_LDFLAGS) $(BOOST_LDFLAGS)
dynare_m_LDADD = macro/libmacro.a $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB)
DynareFlex.cc FlexLexer.h: DynareFlex.ll
DynareFlex.cc: DynareFlex.ll
$(LEX) -o DynareFlex.cc DynareFlex.ll
FlexLexer.h:
cp $(LEXINC)/FlexLexer.h . || test -f ./FlexLexer.h
dynare_m-DynareFlex.$(OBJEXT): CXXFLAGS += -Wno-old-style-cast
DynareBison.cc DynareBison.hh location.hh stack.hh position.hh: DynareBison.yy
$(YACC) -W -o DynareBison.cc DynareBison.yy
# We do not use a multiple target rule for Bison, because otherwise it will be
# run several times in parallel builds
DynareBison.cc: DynareBison.yy
$(YACC) -W -o $@ $<
DynareBison.hh location.hh stack.hh position.hh: DynareBison.cc
all-local: $(PROGRAMS)

View File

@ -26,5 +26,9 @@ Tokenizer.cc: Tokenizer.ll
libmacro_a-Tokenizer.$(OBJEXT): CXXFLAGS += -Wno-old-style-cast
Parser.cc Parser.hh location.hh stack.hh position.hh: Parser.yy
$(YACC) -W -o Parser.cc Parser.yy
# We do not use a multiple target rule for Bison, because otherwise it will be
# run several times in parallel builds
Parser.cc: Parser.yy
$(YACC) -W -o $@ $<
Parser.hh location.hh stack.hh position.hh: Parser.cc