Fine tune Visual Studio's use of bison/flex.

llvm-svn: 24025
This commit is contained in:
Jeff Cohen 2005-10-27 01:10:36 +00:00
parent 9809d0acec
commit 81b5623dd2
5 changed files with 31 additions and 34 deletions

View File

@ -133,18 +133,16 @@
<Tool
Name="VCCustomBuildTool"
Description="Bisoning $(InputFileName)"
CommandLine="..\dobison.cmd llvmAsm debug $(InputName) $(InputPath)
"
Outputs="$(InputName).cpp;$(InputName).h"/>
CommandLine="..\dobison.cmd llvmAsm debug $(InputName) $(InputPath)"
Outputs="$(InputName).cpp;$(InputName).h;$(InputName).output"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Bisoning $(InputFileName)"
CommandLine="..\dobison.cmd llvmAsm release $(InputName) $(InputPath)
"
Outputs="$(InputName).cpp;$(InputName).h"/>
CommandLine="..\dobison.cmd llvmAsm release $(InputName) $(InputPath)"
Outputs="$(InputName).cpp;$(InputName).h;$(InputName).output"/>
</FileConfiguration>
</File>
<File

View File

@ -102,7 +102,7 @@ echo #define LLVM_ON_WIN32 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h"
<Tool
Name="VCCustomBuildTool"
Description="Generating $(SolutionDir)llvm\Support\DataTypes.h"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\Support\DataTypes.h"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\Support\DataTypes.h"
Outputs="$(ProjectDir)..\llvm\Support\DataTypes.h"/>
</FileConfiguration>
</File>
@ -113,7 +113,7 @@ echo #define LLVM_ON_WIN32 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h"
<Tool
Name="VCCustomBuildTool"
Description="Generating $(SolutionDir)llvm\ADT\hash_map"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\ADT\hash_map"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\ADT\hash_map"
Outputs="$(ProjectDir)..\llvm\ADT\hash_map"/>
</FileConfiguration>
</File>
@ -124,7 +124,7 @@ echo #define LLVM_ON_WIN32 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h"
<Tool
Name="VCCustomBuildTool"
Description="Generating $(SolutionDir)llvm\ADT\hash_set"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\ADT\hash_set"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\ADT\hash_set"
Outputs="$(ProjectDir)..\llvm\ADT\hash_set"/>
</FileConfiguration>
</File>
@ -135,7 +135,7 @@ echo #define LLVM_ON_WIN32 1 &gt;&gt;$(ProjectDir)..\llvm\Config\config.h"
<Tool
Name="VCCustomBuildTool"
Description="Generating $(SolutionDir)llvm\ADT\iterator"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\ADT\iterator"
CommandLine="copy $(InputPath) $(ProjectDir)..\llvm\ADT\iterator"
Outputs="$(ProjectDir)..\llvm\ADT\iterator"/>
</FileConfiguration>
</File>

View File

@ -161,18 +161,16 @@
<Tool
Name="VCCustomBuildTool"
Description="Bisoning $(InputFileName)"
CommandLine="..\dobison.cmd File debug $(InputName) $(InputPath)
"
Outputs="$(InputName).cpp;$(InputName).h"/>
CommandLine="..\dobison.cmd File debug $(InputName) $(InputPath)"
Outputs="$(InputName).cpp;$(InputName).h;$(InputName).output"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Bisoning $(InputFileName)"
CommandLine="..\dobison.cmd File release $(InputName) $(InputPath)
"
Outputs="$(InputName).cpp;$(InputName).h"/>
CommandLine="..\dobison.cmd File release $(InputName) $(InputPath)"
Outputs="$(InputName).cpp;$(InputName).h;$(InputName).output"/>
</FileConfiguration>
</File>
<File

View File

@ -7,16 +7,16 @@ rem source - input to bison
if "%2"=="debug" (set flags=-tvdo) else (set flags=-vdo)
rem Try and run bison. If it is present, great.
bison -p%1 %flags%%3.cpp %4
if errorlevel 1 goto error
move %3.hpp %3.h
goto done
rem Test for presence of bison.
bison --help >NUL
if errorlevel 1 goto nobison
:error
echo Bison could not run. Using pre-generated files.
rem Run bison.
bison -p%1 %flags%%3.cpp %4 && move %3.hpp %3.h
exit
:nobison
echo Bison not found. Using pre-generated files.
copy %~pn4.cpp %3.cpp
copy %~pn4.h %3.h
:done
exit 0
exit

View File

@ -6,14 +6,15 @@ rem source - input to bison
if "%1"=="debug" (set flags=-t) else (set flags=-t)
rem Try and run flex. If it is present, great.
rem Test for presence of flex.
flex --help >NUL
if errorlevel 1 goto noflex
rem Run flex.
flex %flags% >%2.cpp %3
if errorlevel 1 goto error
goto done
exit
:error
echo Flex could not run. Using pre-generated files.
:noflex
echo Flex not found. Using pre-generated files.
copy %~pn3.cpp %2.cpp
:done
exit 0
exit