Fine tune Visual Studio's use of bison/flex.
authorJeff Cohen <jeffc@jolt-lang.org>
Thu, 27 Oct 2005 01:10:36 +0000 (01:10 +0000)
committerJeff Cohen <jeffc@jolt-lang.org>
Thu, 27 Oct 2005 01:10:36 +0000 (01:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24025 91177308-0d34-0410-b5e6-96231b3b80d8

win32/AsmParser/AsmParser.vcproj
win32/Configure/Configure.vcproj
win32/TableGen/TableGen.vcproj
win32/dobison.cmd
win32/doflex.cmd

index 48162fd22b1bfdc429077bb0f5566b35d43967ba..f596b5816f7963df79ef50542e54248487b09349 100644 (file)
                                        <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
index 9aca7bd6ab246e01e70f2a017493963ba273537c..0364b1b2ea7ffe77aea3f5c6b403ff8e0f891ed8 100644 (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>
index 1c0012a3cf0078fe4cb828adbc527dad82e8ca7b..0049aee5c9de3b244cb8f894867ee44c219cf4ad 100644 (file)
                                        <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
index c49ae2f3386a33bcdfdc1e172583c953633a017f..27364bb1b5c05ecccf87b423b42bbdcd39639f3e 100755 (executable)
@@ -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
index 5c0629d092b319c241641e55380c5a1df5f67b3f..b39d40b75393acf25678dc0f0321724d7e43fc3c 100755 (executable)
@@ -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