blob: e1e3487b5aea86509da6707b3d80f2e4e39f1ce2 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001@echo off
2rem dobison.cmd prefix mode target source
3rem prefix - passed to bison as -p<prefix>
4rem mode - either debug or release
5rem target - generated parser file name without extension
6rem source - input to bison
Chuck Rose III57c33da2007-11-21 00:37:56 +00007rem headercopydir - directory to receive a copy of the header
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008
9if "%2"=="debug" (set flags=-tvdo) else (set flags=-vdo)
10
11rem Test for presence of bison.
12bison --help >NUL
13if errorlevel 1 goto nobison
14
15rem Run bison.
Chuck Rose III57c33da2007-11-21 00:37:56 +000016echo bison -p%1 %flags%%3.cpp %4
17echo move %3.hpp %3.h
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018bison -p%1 %flags%%3.cpp %4 && move %3.hpp %3.h
Chuck Rose III57c33da2007-11-21 00:37:56 +000019echo copy %3.h %5
20copy %3.h %5
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021exit
22
23:nobison
24echo Bison not found. Using pre-generated files.
25copy %~pn4.cpp.cvs %3.cpp
26copy %~pn4.h.cvs %3.h
27exit