#    This file is part of MKF.
#
#    MKF is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    MKF is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with MKF; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#    Copyright (c) 2004 Alexandre Becoulet <alexandre.becoulet@epita.fr>

_if_var_eq		cmd_flex
 var_define		cmd_flex	flex
_end_if

_if_in_path		{PVAR,cmd_flex}

 msg_info		GNU flex ({PVAR,cmd_flex}) found
 var_define		use_flex	flex

 _if_var_eq		mkf_pretty_print	yes
  command_add		l	c	echo "   FLEX             {SRC,.*\.l} -> {OUT}"
 _end_if
 command_add		l	c	{JVAR,cmd_flex} -o {OUT} --header-file={OUT}.h {JVAR,opt_flex} {SRC,.*\.l}

 _if_var_eq		mkf_pretty_print	yes
  command_add		ll	cc	echo "   FLEX             {SRC,.*\.ll} -> {OUT}"
 _end_if
 command_add		ll	cc	{JVAR,cmd_flex} -o {OUT} --header-file={OUT}.hh {JVAR,opt_flex} {SRC,.*\.ll}

_else
  msg_error		can't find flex tool
_end_if

