Permalink
Browse files

Adding compilation options for flex/lex and bison/yacc

Adding the options LAEX_FLAGS and YACC_FLAGS to the COMPILE_FLAGS for flex/lex bison/yacc to create more flexibility during compilation.
Example:
when one wants to compile e.g. fortranscanner.l with the flex debug flag -d one can perform the following steps:
- touch fortranscanner.l in te src directory
- run make LEX_FLAGS=-d
    or
  set environment variable LEX_FLAGS to -d
  run make

to undo this touch again forttranscanner -l and run make (don't forget to unset the environment variable LEX_FLAGS)

Analogous for bison/yacc wit the YACC_FLAGS
  • Loading branch information...
albert-github committed Dec 8, 2015
1 parent 12b28cf commit beb2ff6c39fefbd6aaeecd5de9827d1b1947740b
Showing with 21 additions and 21 deletions.
  1. +1 −1 addon/doxywizard/CMakeLists.txt
  2. +20 −20 src/CMakeLists.txt
@@ -76,7 +76,7 @@ OUTPUT ${GENERATED_SRC_WIZARD}/configdoc.cpp
)
set_source_files_properties(${GENERATED_SRC_WIZARD}/configdoc.cpp PROPERTIES GENERATED 1)
FLEX_TARGET(config_doxyw config_doxyw.l ${GENERATED_SRC_WIZARD}/config_doxyw.cpp COMPILE_FLAGS "-Pconfig_doxywYY")
FLEX_TARGET(config_doxyw config_doxyw.l ${GENERATED_SRC_WIZARD}/config_doxyw.cpp COMPILE_FLAGS "$(LEX_FLAGS) -Pconfig_doxywYY")
qt_wrap_cpp(doxywizard_MOC
doxywizard.h
@@ -85,26 +85,26 @@ add_custom_command(
set_source_files_properties(${GENERATED_SRC}/layout_default.xml.h PROPERTIES GENERATED 1)
# Targets for flex/bison generated files
FLEX_TARGET(scanner scanner.l ${GENERATED_SRC}/scanner.cpp COMPILE_FLAGS "-PscannerYY")
FLEX_TARGET(code code.l ${GENERATED_SRC}/code.cpp COMPILE_FLAGS "-PcodeYY")
FLEX_TARGET(pyscanner pyscanner.l ${GENERATED_SRC}/pyscanner.cpp COMPILE_FLAGS "-PpyscannerYY")
FLEX_TARGET(pycode pycode.l ${GENERATED_SRC}/pycode.cpp COMPILE_FLAGS "-PpycodeYY")
FLEX_TARGET(fortranscanner fortranscanner.l ${GENERATED_SRC}/fortranscanner.cpp COMPILE_FLAGS "-PfortranscannerYY -i")
FLEX_TARGET(fortrancode fortrancode.l ${GENERATED_SRC}/fortrancode.cpp COMPILE_FLAGS "-PfortrancodeYY -i")
FLEX_TARGET(vhdlcode vhdlcode.l ${GENERATED_SRC}/vhdlcode.cpp COMPILE_FLAGS "-PvhdlcodeYY -i")
FLEX_TARGET(tclscanner tclscanner.l ${GENERATED_SRC}/tclscanner.cpp COMPILE_FLAGS "-PtclscannerYY -i")
FLEX_TARGET(pre pre.l ${GENERATED_SRC}/pre.cpp COMPILE_FLAGS "-PpreYY")
FLEX_TARGET(declinfo declinfo.l ${GENERATED_SRC}/declinfo.cpp COMPILE_FLAGS "-PdeclinfoYY")
FLEX_TARGET(defargs defargs.l ${GENERATED_SRC}/defargs.cpp COMPILE_FLAGS "-PdefargsYY")
FLEX_TARGET(doctokenizer doctokenizer.l ${GENERATED_SRC}/doctokenizer.cpp COMPILE_FLAGS "-PdoctokenizerYY")
FLEX_TARGET(commentcnv commentcnv.l ${GENERATED_SRC}/commentcnv.cpp COMPILE_FLAGS "-PcommentcnvYY")
FLEX_TARGET(commentscan commentscan.l ${GENERATED_SRC}/commentscan.cpp COMPILE_FLAGS "-PcommentscanYY")
FLEX_TARGET(constexp constexp.l ${GENERATED_SRC}/constexp.cpp COMPILE_FLAGS "-PconstexpYY")
FLEX_TARGET(xmlcode xmlcode.l ${GENERATED_SRC}/xmlcode.cpp COMPILE_FLAGS "-PxmlcodeYY")
FLEX_TARGET(config config.l ${GENERATED_SRC}/config.cpp COMPILE_FLAGS "-PconfigYY")
BISON_TARGET(vhdlparser vhdlparser.y ${GENERATED_SRC}/vhdlparser.cpp COMPILE_FLAGS "-l -p vhdlscannerYY")
BISON_TARGET(constexp constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "-l -p constexpYY")
FLEX_TARGET(scanner scanner.l ${GENERATED_SRC}/scanner.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PscannerYY")
FLEX_TARGET(code code.l ${GENERATED_SRC}/code.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PcodeYY")
FLEX_TARGET(pyscanner pyscanner.l ${GENERATED_SRC}/pyscanner.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PpyscannerYY")
FLEX_TARGET(pycode pycode.l ${GENERATED_SRC}/pycode.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PpycodeYY")
FLEX_TARGET(fortranscanner fortranscanner.l ${GENERATED_SRC}/fortranscanner.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PfortranscannerYY -i")
FLEX_TARGET(fortrancode fortrancode.l ${GENERATED_SRC}/fortrancode.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PfortrancodeYY -i")
FLEX_TARGET(vhdlcode vhdlcode.l ${GENERATED_SRC}/vhdlcode.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PvhdlcodeYY -i")
FLEX_TARGET(tclscanner tclscanner.l ${GENERATED_SRC}/tclscanner.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PtclscannerYY -i")
FLEX_TARGET(pre pre.l ${GENERATED_SRC}/pre.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PpreYY")
FLEX_TARGET(declinfo declinfo.l ${GENERATED_SRC}/declinfo.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PdeclinfoYY")
FLEX_TARGET(defargs defargs.l ${GENERATED_SRC}/defargs.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PdefargsYY")
FLEX_TARGET(doctokenizer doctokenizer.l ${GENERATED_SRC}/doctokenizer.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PdoctokenizerYY")
FLEX_TARGET(commentcnv commentcnv.l ${GENERATED_SRC}/commentcnv.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PcommentcnvYY")
FLEX_TARGET(commentscan commentscan.l ${GENERATED_SRC}/commentscan.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PcommentscanYY")
FLEX_TARGET(constexp constexp.l ${GENERATED_SRC}/constexp.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PconstexpYY")
FLEX_TARGET(xmlcode xmlcode.l ${GENERATED_SRC}/xmlcode.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PxmlcodeYY")
FLEX_TARGET(config config.l ${GENERATED_SRC}/config.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PconfigYY")
BISON_TARGET(vhdlparser vhdlparser.y ${GENERATED_SRC}/vhdlparser.cpp COMPILE_FLAGS "$(YACC_FLAGS) -l -p vhdlscannerYY")
BISON_TARGET(constexp constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "$(YACC_FLAGS) -l -p constexpYY")
add_library(doxycfg STATIC
${GENERATED_SRC}/lang_cfg.h

0 comments on commit beb2ff6

Please sign in to comment.