Fix reversed logic spotted by Owen Anderson.
[llvm.git] / win32 / dobison.cmd
blob03d56ab4058bb31adab21b8baa47e84f891d11b5
1 @echo off
2 rem dobison.cmd prefix mode target source
3 rem prefix - passed to bison as -p<prefix>
4 rem mode - either debug or release
5 rem target - generated parser file name without extension
6 rem source - input to bison
7 rem headercopydir - directory to receive a copy of the header
9 if "%2"=="debug" (set flags=-tvdo) else (set flags=-vdo)
11 rem Test for presence of bison.
12 bison --help >NUL
13 if errorlevel 1 goto nobison
15 rem Run bison.
16 echo bison -p%1 %flags%%3.cpp %4
17 echo move %3.hpp %3.h
18 bison -p%1 %flags%%3.cpp %4 && move %3.hpp %3.h
19 echo copy %3.h %5
20 copy %3.h %5
21 exit
23 :nobison
24 echo Bison not found. Using pre-generated files.
25 copy %~pn4.cpp.cvs .\%3.cpp
26 copy %~pn4.cpp.cvs %5\%3.cpp
27 copy %~pn4.h.cvs .\%3.h
28 copy %~pn4.h.cvs %5\%3.h
29 exit