]> granicus.if.org Git - yasm/commitdiff
Change genmodule to parse through the Makefile (or Makefile.am) looking for YASM_MODULES,
authorPeter Johnson <peter@tortall.net>
Thu, 5 Oct 2006 06:22:25 +0000 (06:22 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 5 Oct 2006 06:22:25 +0000 (06:22 -0000)
rather than simply taking a list of modules on the command line.  This allows significant
improvement of the behavior when used with Visual Studio, as the "old" way of doing this
with Visual Studio build files was to scan through the .c files; this brought up things
that were actually disabled in the build.

Also incorporate a patch by Charles Bailey to make the VC8 build less noisy, and allow use
of Win32 Bison if it's installed.  Instructions updated as well.

svn path=/trunk/yasm/; revision=1642

21 files changed:
Makefile.am
Mkfiles/Makefile.dj
Mkfiles/Makefile.flat
Mkfiles/vc/genmodule/run.bat
Mkfiles/vc8/bison.rules [new file with mode: 0644]
Mkfiles/vc8/config.h
Mkfiles/vc8/crt_secure_no_deprecate.vsprops [new file with mode: 0644]
Mkfiles/vc8/gap/gap.vcproj
Mkfiles/vc8/genmacro/genmacro.vcproj
Mkfiles/vc8/genmodule/genmodule.vcproj
Mkfiles/vc8/genmodule/run.bat
Mkfiles/vc8/genstring/genstring.vcproj
Mkfiles/vc8/genversion/genversion.vcproj
Mkfiles/vc8/libyasm/libyasm.vcproj
Mkfiles/vc8/modules/modules.vcproj
Mkfiles/vc8/re2c/re2c.vcproj
Mkfiles/vc8/readme.vc8.txt
Mkfiles/vc8/yasm.sln
Mkfiles/vc8/yasm.vcproj
libyasm/Makefile.inc
libyasm/genmodule.c

index a2d9322fa313b0db64a12ccfe2a5f3a2767d902f..0bc3572e6ee53370ea634113fb597d9bf7fb1419 100644 (file)
@@ -75,6 +75,8 @@ EXTRA_DIST += Mkfiles/vc/re2c/re2c.vcproj
 EXTRA_DIST += Mkfiles/vc/re2c/run.bat
 EXTRA_DIST += Mkfiles/vc/gap/gap.vcproj
 EXTRA_DIST += Mkfiles/vc/gap/run.bat
+EXTRA_DIST += Mkfiles/vc8/bison.rules
+EXTRA_DIST += Mkfiles/vc8/crt_secure_no_deprecate.vsprops
 EXTRA_DIST += Mkfiles/vc8/yasm.sln
 EXTRA_DIST += Mkfiles/vc8/yasm.vcproj
 EXTRA_DIST += Mkfiles/vc8/config.h
index 5006a1beb532a4a8cfdf816113270217ddfcf5cb..352cd6976959f7c244d439d91ce8c4eb00487bfb 100644 (file)
@@ -163,7 +163,7 @@ genmodule: libyasm/genmodule.c
        $(BUILDCC) -o $@ $<
 
 module.c: libyasm/module.in genmodule
-       ./genmodule libyasm/module.in $(YASM_MODULES)
+       ./genmodule libyasm/module.in Mkfiles/Makefile.dj
 
 x86parse.c: modules/arch/x86/x86parse.gap gap
        ./gap modules/arch/x86/x86parse.gap $@
index a0d32abf2b6c125775d3285891e376df7b35cccc..be3339c47ecb688e522834d33ce1514f1aef0fbf 100644 (file)
@@ -166,7 +166,7 @@ genmodule: libyasm/genmodule.c
        $(BUILDCC) -o $@ $<
 
 module.c: libyasm/module.in genmodule
-       ./genmodule libyasm/module.in $(YASM_MODULES)
+       ./genmodule libyasm/module.in Mkfiles/Makefile.flat
 
 x86parse.c: modules/arch/x86/x86parse.gap gap
        ./gap modules/arch/x86/x86parse.gap $@
index f1d4ea34c0fd74d8545b314d016de54149d2672c..e34a41694eea9503840ea96202e0deacdeeef8a5 100644 (file)
@@ -1,6 +1,3 @@
 @echo off\r
 cd ..\..\..\r
-echo "" >temp.txt\r
-for /R modules %%n in (*.c) do find "_LTX_" "%%n" | find "_module" | find "= {" >>temp.txt\r
-type temp.txt | %1 libyasm\module.in\r
-del temp.txt\r
+%1 libyasm\module.in Makefile.am\r
diff --git a/Mkfiles/vc8/bison.rules b/Mkfiles/vc8/bison.rules
new file mode 100644 (file)
index 0000000..f8ce0f4
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<VisualStudioToolFile\r
+       Name="Bison"\r
+       Version="8.00"\r
+       >\r
+       <Rules>\r
+               <CustomBuildRule\r
+                       Name="Bison"\r
+                       DisplayName="Compiler compiler - bison"\r
+                       CommandLine="bison [AllOptions] [AdditionalOptions] [inputs]"\r
+                       Outputs="[$OutputStem].c;[$OutputStem].h"\r
+                       FileExtensions="*.y"\r
+                       ExecutionDescription="Executing bison..."\r
+                       ShowOnlyRuleProperties="false"\r
+                       >\r
+                       <Properties>\r
+                               <BooleanProperty\r
+                                       Name="OutputDefs"\r
+                                       DisplayName="Genereate extra .h file with parser defines"\r
+                                       Switch="-d"\r
+                                       DefaultValue="true"\r
+                               />\r
+                               <StringProperty\r
+                                       Name="OutputStem"\r
+                                       DisplayName="Output Stem"\r
+                                       Switch="-o &quot;[value].c&quot;"\r
+                                       DefaultValue="$(InputDir)$(InputName)"\r
+                               />\r
+                       </Properties>\r
+               </CustomBuildRule>\r
+       </Rules>\r
+</VisualStudioToolFile>\r
index 9beb47726154554254247fa8f4e75a41308b8729..ef7860240e9ed918ecb92a305ab10e16c21ded7c 100644 (file)
@@ -4,8 +4,6 @@
 #define yasm__abspath(path)            yasm__abspath_win(path)\r
 #define yasm__combpath(from, to)       yasm__combpath_win(from, to)\r
 \r
-#define _CRT_SECURE_NO_DEPRECATE 1\r
-\r
 /* */\r
 /* #undef ENABLE_NLS */\r
 \r
diff --git a/Mkfiles/vc8/crt_secure_no_deprecate.vsprops b/Mkfiles/vc8/crt_secure_no_deprecate.vsprops
new file mode 100644 (file)
index 0000000..d61ba30
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioPropertySheet\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="crt_secure_no_deprecate"\r
+       >\r
+       <Tool\r
+               Name="VCCLCompilerTool"\r
+               PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"\r
+       />\r
+</VisualStudioPropertySheet>\r
index 19bb8719dec21bf5c5cc8de9adea249f03683180..9ba900357fb21b9a78c04ce8caa4ab56c4474763 100644 (file)
@@ -20,6 +20,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
index d7c8ba91904d6d9900aa6ff50d794e8df933646f..6c0b6118b83b9b9cbc5d9e3106b59c92c42963f0 100644 (file)
@@ -20,6 +20,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
index aa376e419aeb50e4882e48cdf7e5848ebde9e965..b55f712560a01dfc7398ebb1fcd1f95341d4e238 100644 (file)
@@ -4,6 +4,7 @@
        Version="8.00"\r
        Name="genmodule"\r
        ProjectGUID="{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}"\r
+       RootNamespace="genmodule"\r
        Keyword="Win32Proj"\r
        >\r
        <Platforms>\r
@@ -19,6 +20,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
index f1d4ea34c0fd74d8545b314d016de54149d2672c..e34a41694eea9503840ea96202e0deacdeeef8a5 100644 (file)
@@ -1,6 +1,3 @@
 @echo off\r
 cd ..\..\..\r
-echo "" >temp.txt\r
-for /R modules %%n in (*.c) do find "_LTX_" "%%n" | find "_module" | find "= {" >>temp.txt\r
-type temp.txt | %1 libyasm\module.in\r
-del temp.txt\r
+%1 libyasm\module.in Makefile.am\r
index 7722dfd22829c40ea52ff3b90bf886a77594f816..9910c8b486689a0299efb151d46809af4d14f672 100644 (file)
@@ -20,6 +20,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
index 5d73495bb8937d97548687b37831d5fc948ab424..c65952fa621ff80e619643d6f79f4e1650be328d 100644 (file)
@@ -20,6 +20,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
index efe9d9e3c6ab2dfd6cee5332636f7abf6db3058e..45d01489730c6907efe9b0868e12230044894bc7 100644 (file)
@@ -22,6 +22,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="4"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
@@ -95,7 +96,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="4"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops;..\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="4"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="4"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops;..\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
                                RelativePath="..\..\..\libyasm\assocdat.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\..\libyasm\bitvect.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\..\libyasm\bc-align.c"\r
                                >\r
                                RelativePath="..\..\..\libyasm\bc-reserve.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\libyasm\bitvect.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\libyasm\bytecode.c"\r
                                >\r
                                >\r
                        </File>\r
                </Filter>\r
+               <File\r
+                       RelativePath="..\..\..\libyasm\module.in"\r
+                       >\r
+               </File>\r
        </Files>\r
        <Globals>\r
        </Globals>\r
index 4351a4f61e2565bd9f274d6054f3459b30439e11..68b03f7c7dae628bc79b5a9a6f26ddef1c4e715b 100644 (file)
@@ -15,6 +15,9 @@
                />\r
        </Platforms>\r
        <ToolFiles>\r
+               <ToolFile\r
+                       RelativePath="..\bison.rules"\r
+               />\r
        </ToolFiles>\r
        <Configurations>\r
                <Configuration\r
@@ -22,6 +25,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="4"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
@@ -32,6 +36,9 @@
                        <Tool\r
                                Name="VCCustomBuildTool"\r
                        />\r
+                       <Tool\r
+                               Name="Bison"\r
+                       />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                        />\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="4"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops;..\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
                        <Tool\r
                                Name="VCCustomBuildTool"\r
                        />\r
+                       <Tool\r
+                               Name="Bison"\r
+                       />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                        />\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="4"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
                        <Tool\r
                                Name="VCCustomBuildTool"\r
                        />\r
+                       <Tool\r
+                               Name="Bison"\r
+                       />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                        />\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="4"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops;..\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
                        <Tool\r
                                Name="VCCustomBuildTool"\r
                        />\r
+                       <Tool\r
+                               Name="Bison"\r
+                       />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                        />\r
                                Name="dbgfmts"\r
                                >\r
                                <File\r
-                                       RelativePath="..\..\..\modules\dbgfmts\null\null-dbgfmt.c"\r
+                                       RelativePath="..\..\..\modules\dbgfmts\codeview\cv-dbgfmt.c"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\..\modules\dbgfmts\stabs\stabs-dbgfmt.c"\r
+                                       RelativePath="..\..\..\modules\dbgfmts\codeview\cv-dbgfmt.h"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\..\modules\dbgfmts\codeview\cv-dbgfmt.h"\r
+                                       RelativePath="..\..\..\modules\dbgfmts\codeview\cv-symline.c"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\..\modules\dbgfmts\codeview\cv-dbgfmt.c"\r
+                                       RelativePath="..\..\..\modules\dbgfmts\codeview\cv-type.c"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\..\modules\dbgfmts\codeview\cv-symline.c"\r
+                                       RelativePath="..\..\..\modules\dbgfmts\dwarf2\dwarf2-aranges.c"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\..\modules\dbgfmts\codeview\cv-type.c"\r
+                                       RelativePath="..\..\..\modules\dbgfmts\dwarf2\dwarf2-dbgfmt.c"\r
                                        >\r
                                </File>\r
                                <File\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\..\modules\dbgfmts\dwarf2\dwarf2-dbgfmt.c"\r
+                                       RelativePath="..\..\..\modules\dbgfmts\dwarf2\dwarf2-info.c"\r
                                        >\r
                                </File>\r
                                <File\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\..\modules\dbgfmts\dwarf2\dwarf2-info.c"\r
+                                       RelativePath="..\..\..\modules\dbgfmts\null\null-dbgfmt.c"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\..\modules\dbgfmts\dwarf2\dwarf2-aranges.c"\r
+                                       RelativePath="..\..\..\modules\dbgfmts\stabs\stabs-dbgfmt.c"\r
                                        >\r
                                </File>\r
                        </Filter>\r
                                        RelativePath="..\..\..\gas-bison.h"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\..\..\modules\parsers\gas\gas-bison.y"\r
+                                       >\r
+                                       <FileConfiguration\r
+                                               Name="Release|Win32"\r
+                                               ExcludedFromBuild="true"\r
+                                               >\r
+                                               <Tool\r
+                                                       Name="Bison"\r
+                                                       OutputStem="../../../gas-bison"\r
+                                               />\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Release|x64"\r
+                                               ExcludedFromBuild="true"\r
+                                               >\r
+                                               <Tool\r
+                                                       Name="Bison"\r
+                                               />\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Debug|Win32"\r
+                                               ExcludedFromBuild="true"\r
+                                               >\r
+                                               <Tool\r
+                                                       Name="Bison"\r
+                                                       OutputStem="../../../gas-bison"\r
+                                               />\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Debug|x64"\r
+                                               ExcludedFromBuild="true"\r
+                                               >\r
+                                               <Tool\r
+                                                       Name="Bison"\r
+                                               />\r
+                                       </FileConfiguration>\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\..\..\modules\parsers\gas\gas-defs.h"\r
                                        >\r
                                        RelativePath="..\..\..\nasm-bison.h"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\..\..\modules\parsers\nasm\nasm-bison.y"\r
+                                       >\r
+                                       <FileConfiguration\r
+                                               Name="Release|Win32"\r
+                                               ExcludedFromBuild="true"\r
+                                               >\r
+                                               <Tool\r
+                                                       Name="Bison"\r
+                                                       OutputStem="../../../nasm-bison"\r
+                                               />\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Release|x64"\r
+                                               ExcludedFromBuild="true"\r
+                                               >\r
+                                               <Tool\r
+                                                       Name="Bison"\r
+                                               />\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Debug|Win32"\r
+                                               ExcludedFromBuild="true"\r
+                                               >\r
+                                               <Tool\r
+                                                       Name="Bison"\r
+                                                       OutputStem="../../../nasm-bison"\r
+                                               />\r
+                                       </FileConfiguration>\r
+                                       <FileConfiguration\r
+                                               Name="Debug|x64"\r
+                                               ExcludedFromBuild="true"\r
+                                               >\r
+                                               <Tool\r
+                                                       Name="Bison"\r
+                                               />\r
+                                       </FileConfiguration>\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\..\..\modules\parsers\nasm\nasm-defs.h"\r
                                        >\r
index 4e2e9f875f50aeb350a81756c2c572072f29b190..4e689057a0f62a60614a9b555144c0b543bafe47 100644 (file)
@@ -13,6 +13,9 @@
                />\r
        </Platforms>\r
        <ToolFiles>\r
+               <ToolFile\r
+                       RelativePath="..\bison.rules"\r
+               />\r
        </ToolFiles>\r
        <Configurations>\r
                <Configuration\r
@@ -20,6 +23,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
@@ -28,6 +32,9 @@
                        <Tool\r
                                Name="VCCustomBuildTool"\r
                        />\r
+                       <Tool\r
+                               Name="Bison"\r
+                       />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                        />\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets="..\crt_secure_no_deprecate.vsprops"\r
                        CharacterSet="2"\r
                        >\r
                        <Tool\r
                        <Tool\r
                                Name="VCCustomBuildTool"\r
                        />\r
+                       <Tool\r
+                               Name="Bison"\r
+                       />\r
                        <Tool\r
                                Name="VCXMLDataGeneratorTool"\r
                        />\r
                                RelativePath="..\..\..\re2c-parser.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\tools\re2c\re2c-parser.y"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       ExcludedFromBuild="true"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="Bison"\r
+                                               OutputStem="../../../re2c-parser"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       ExcludedFromBuild="true"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="Bison"\r
+                                               OutputStem="../../../re2c-parser"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\tools\re2c\scanner.c"\r
                                >\r
index 05c2a39e1b8ef1031dac8a2bf3cdb929303d0ba8..0b817a927cf8734e7b6efa927da9017216277bee 100644 (file)
@@ -13,9 +13,9 @@ the Visual Studio 2005 64-bit tools, which are not installed by default.
 2. YASM Download\r
 ----------------\r
 \r
-The following files are not built on VC++ and are not contained in the\r
-YASM subversion repository (but they are included in the nightly YASM\r
-snapshots):\r
+The following files are not built by default on VC++ and are not contained\r
+in the YASM subversion repository (but they are included in the nightly\r
+YASM snapshots):\r
 \r
     gas-bison.c\r
     gas-bison.h\r
@@ -24,6 +24,19 @@ snapshots):
     re2c-parser.c\r
     re2c-parser.h\r
 \r
+However, if you want to build these files from source, follow these step:\r
+  1) Install bison.  This can be done in a number of ways, the easiest is\r
+     probably to download and run the Win32 Bison Setup program from\r
+     http://gnuwin32.sourceforge.net/packages/bison.htm\r
+  2) In Visual Studio, go to Tools|Options,\r
+     Projects and Solutions|VC++ Directories, and add the directory where\r
+     you installed Bison to the list of directories.\r
+  3) For each of the .y files in the build, right click, select Properties,\r
+     and change the "Excluded From Build" setting to No.  These files are:\r
+     re2c/Source Files/re2c-parser.y\r
+     modules/Source Files/gas-bison.y\r
+     modules/Source Files/nasm-bison.y\r
+\r
 If you wish to build from the latest files in the subversion repository,\r
 you will need to add these files from the latest snapshot to the repository\r
 files. They should be placed in the YASM root directory.\r
index 3d14dcd409e9e76e188b90014991cd2812b31427..6717facf9e579dfc87c68a52b43d53595de6b464 100644 (file)
@@ -15,9 +15,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yasm", "yasm.vcproj", "{34EB1BEB-C2D6-4A52-82B7-7ACD714A30D5}"\r
        ProjectSection(ProjectDependencies) = postProject\r
+               {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459}\r
                {29FE7874-1256-4AD6-B889-68E399DC9608} = {29FE7874-1256-4AD6-B889-68E399DC9608}\r
                {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6} = {D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}\r
-               {021CEB0A-F721-4F59-B349-9CEEAF244459} = {021CEB0A-F721-4F59-B349-9CEEAF244459}\r
        EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmacro", "genmacro\genmacro.vcproj", "{225700A5-07B8-434E-AD61-555278BF6733}"\r
@@ -37,6 +37,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genstring", "genstring\gens
 EndProject\r
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{825AC694-358C-4D8D-92DE-33A2691978CE}"\r
        ProjectSection(SolutionItems) = preProject\r
+               crt_secure_no_deprecate.vsprops = crt_secure_no_deprecate.vsprops\r
                readme.vc8.txt = readme.vc8.txt\r
        EndProjectSection\r
 EndProject\r
index be94afed51624b1a02bb32dc7bfdf49aa7ce5eb9..ef4eab3ac12968ee20d4f1162523b771e5c7b371 100644 (file)
@@ -22,6 +22,7 @@
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets=".\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops;.\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
+                       InheritedPropertySheets=".\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops;.\crt_secure_no_deprecate.vsprops"\r
                        UseOfMFC="0"\r
                        ATLMinimizesCRunTimeLibraryUsage="false"\r
                        CharacterSet="2"\r
index 8d0384bbd5737e5dfed533d9c148c7986da6934f..fb75715743af94aa61a324d9ee26a144a8429952 100644 (file)
@@ -32,7 +32,7 @@ libyasm_a_SOURCES += libyasm/xstrdup.c
 libyasm_a_SOURCES += module.c
 
 module.c: $(top_srcdir)/libyasm/module.in genmodule$(EXEEXT) Makefile
-       $(top_builddir)/genmodule$(EXEEXT) $(top_srcdir)/libyasm/module.in $(YASM_MODULES)
+       $(top_builddir)/genmodule$(EXEEXT) $(top_srcdir)/libyasm/module.in Makefile
 
 BUILT_SOURCES += module.c
 CLEANFILES += module.c
index 03fa6128e4b0a6f24cff3a9c2be21852c9926a05..f34fa1c7a8cadb6e097c785597bbf64074148fb3 100644 (file)
@@ -1,6 +1,6 @@
 /* $Id$
  *
- * Generate module.c from module.in and list of modules.
+ * Generate module.c from module.in and Makefile.am or Makefile.
  *
  *  Copyright (C) 2004  Peter Johnson
  *
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
+
+#include "compat-queue.h"
 
 #define OUTPUT "module.c"
+#define MAXNAME 128
 #define MAXLINE        1024
 #define MAXMODULES 128
+#define MAXINCLUDES 256
+
+typedef struct include {
+    STAILQ_ENTRY(include) link;
+    char *filename;
+} include;
 
 int
 main(int argc, char *argv[])
@@ -39,47 +49,121 @@ main(int argc, char *argv[])
     FILE *in, *out;
     char *str;
     int i;
-    int len;
+    size_t len;
     char *strp;
     char *modules[MAXMODULES];
     int num_modules = 0;
+    STAILQ_HEAD(includehead, include) includes =
+       STAILQ_HEAD_INITIALIZER(includes);
+    include *inc;
+    int isam = 0;
+    int linecont = 0;
 
-    if (argc < 2) {
-       fprintf(stderr, "Usage: %s <file> [module_name ...]\n", argv[0]);
+    if (argc != 3) {
+       fprintf(stderr, "Usage: %s <module.in> <Makefile[.am]>\n", argv[0]);
        return EXIT_FAILURE;
     }
 
     str = malloc(MAXLINE);
 
-#ifdef FILTERMODE
-    while (fgets(str, MAXLINE, stdin)) {
-       if (strlen(str) < 6)
-           continue;
-       modules[num_modules] = malloc(strlen(str+5)+1); /* excessive */
-       strp = str+5;   /* skip past the "yasm_" */
-       i = 0;
-       /* copy the module type */
-       while (*strp != '_')
-           modules[num_modules][i++] = *strp++;
-       modules[num_modules][i++] = *strp++; /* copy the following _ */
-       /* find the next _ */
-       while (*strp++ != '_')
-           {}
-       /* copy it up until the next _ */
-       do {
-           modules[num_modules][i++] = *strp++;
-       } while (*strp != '_');
-       /* terminate string */
-       modules[num_modules][i] = '\0';
-       num_modules++;
-    }
-#else
-    num_modules = argc-2;
-    for (i=2; i<argc; i++) {
-       modules[i-2] = malloc(strlen(argv[i])+1);
-       strcpy(modules[i-2], argv[i]);
+    /* Starting with initial input Makefile, look for include <file> or
+     * YASM_MODULES += <module>.  Note this currently doesn't handle
+     * a relative starting path.
+     */
+    len = strlen(argv[2]);
+    inc = malloc(sizeof(include));
+    inc->filename = malloc(len+1);
+    strcpy(inc->filename, argv[2]);
+    STAILQ_INSERT_TAIL(&includes, inc, link);
+
+    isam = argv[2][len-2] == 'a' && argv[2][len-1] == 'm';
+
+    while (!STAILQ_EMPTY(&includes)) {
+       inc = STAILQ_FIRST(&includes);
+       STAILQ_REMOVE_HEAD(&includes, link);
+       in = fopen(inc->filename, "rt");
+       if (!in) {
+           fprintf(stderr, "Could not open `%s'.\n", inc->filename);
+           return EXIT_FAILURE;
+       }
+       free(inc->filename);
+       free(inc);
+
+       while (fgets(str, MAXLINE, in)) {
+           /* Strip off any trailing whitespace */
+           len = strlen(str);
+           strp = &str[len-1];
+           while (isspace(*strp)) {
+               *strp-- = '\0';
+               len--;
+           }
+
+           strp = str;
+
+           /* Skip whitespace */
+           while (isspace(*strp))
+               strp++;
+
+           /* Skip comments */
+           if (*strp == '#')
+               continue;
+
+           /* If line continuation, skip to continue copy */
+           if (linecont)
+               goto keepgoing;
+
+           /* Check for include if original input is .am file */
+           if (isam && strncmp(strp, "include", 7) == 0 && isspace(strp[7])) {
+               strp += 7;
+               while (isspace(*strp))
+                   strp++;
+               /* Build new include and add to end of list */
+               inc = malloc(sizeof(include));
+               inc->filename = malloc(strlen(strp)+1);
+               strcpy(inc->filename, strp);
+               STAILQ_INSERT_TAIL(&includes, inc, link);
+               continue;
+           }
+
+           /* Check for YASM_MODULES = or += */
+           if (strncmp(strp, "YASM_MODULES", 12) != 0)
+               continue;
+           strp += 12;
+           while (isspace(*strp))
+               strp++;
+           if (strncmp(strp, "+=", 2) != 0 && *strp != '=')
+               continue;
+           if (*strp == '+')
+               strp++;
+           strp++;
+           while (isspace(*strp))
+               strp++;
+
+keepgoing:
+           /* Check for continuation */
+           if (str[len-1] == '\\') {
+               str[len-1] = '\0';
+               while (isspace(*strp))
+                   *strp-- = '\0';
+               linecont = 1;
+           } else
+               linecont = 0;
+
+           while (*strp != '\0') {
+               /* Copy module name */
+               modules[num_modules] = malloc(MAXNAME);
+               len = 0;
+               while (*strp != '\0' && !isspace(*strp))
+                   modules[num_modules][len++] = *strp++;
+               modules[num_modules][len] = '\0';
+               num_modules++;
+
+               while (isspace(*strp))
+                   strp++;
+           }
+       }
+       fclose(in);
     }
-#endif
 
     out = fopen(OUTPUT, "wt");