openfoam/wmake/rules/General/bison
Mark Olesen 3a816006dc COMP: support m4 include directories for wrap-lemon
Set the m4 -I include accordingly to have the folllowing:
  - the directory of the parser.
  - include/ in the top-level source tree of the current target
    (eg, src/finiteVolume/include-m4/ when compiling libfiniteVolume)
  - include/ from OpenFOAM

Additional -dry-run option for makeParser, wrap-lemon for expanding m4
only.

Extend m4 wrapping support to include bison as well.
2019-12-06 16:15:07 +01:00

27 lines
995 B
Plaintext

SUFFIXES += .Y .y .yy .yy-m4
ytoo = $E $(call QUIET_MESSAGE,bison,$(<F)) \
$(WM_SCHEDULER) bison -v -d -y $< $(AND) \
mv y.tab.c $(@D)/$(<F).c $(AND) \
mv y.tab.h $(@D)/$(<F).h $(AND) \
$(cc) $(cFLAGS) -c $(@D)/$(<F).c -o $@
Ytoo = $E $(call QUIET_MESSAGE,bison,$(<F)) \
$(WM_SCHEDULER) bison -v -d -y $< $(AND) \
mv y.tab.c $(@D)/$(<F).C $(AND) \
mv y.tab.h $(@D)/$(<F).H $(AND) \
$(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
yytoo = $E $(call QUIET_MESSAGE,bison,$(<F)) \
$(WM_SCHEDULER) $(WM_SCRIPTS)/wrap-bison \
-output=$(@D)/$(*F).tab.cc -v -d $< $(AND) \
$(CC) $(c++FLAGS) -c $(@D)/$(*F).tab.cc -o $@
# Retains intermediate m4-filtered files (-no-tmp to suppress)
yy-m4too = $E $(call QUIET_MESSAGE,bison-m4,$(<F)) \
$(WM_SCHEDULER) $(WM_SCRIPTS)/wrap-bison \
-output=$(@D)/$(*F).tab.cc -v -d $< $(AND) \
$(CC) $(c++FLAGS) -c $(@D)/$(*F).tab.cc -o $@
#------------------------------------------------------------------------------