]> granicus.if.org Git - yasm/commitdiff
Fix up VC, flat, DJ build files to match build changes made in [1183].
authorPeter Johnson <peter@tortall.net>
Tue, 7 Dec 2004 08:05:51 +0000 (08:05 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 7 Dec 2004 08:05:51 +0000 (08:05 -0000)
svn path=/trunk/yasm/; revision=1187

Mkfiles/Makefile.dj
Mkfiles/Makefile.flat
Mkfiles/vc/genmodule/genmodule.vcproj [new file with mode: 0644]
Mkfiles/vc/genmodule/run.bat [new file with mode: 0644]
Mkfiles/vc/libyasm/libyasm.vcproj
Mkfiles/vc/yasm.sln
Mkfiles/vc/yasm.vcproj
libyasm/genmodule.c

index 9520b8288dd3b3eaa97ba8329383cdb48b7347ea..66c56a134a7295c4db8553d17f30998fb2e6f156 100644 (file)
@@ -9,7 +9,7 @@
 # How to compile:
 #  make -fMkfiles/Makefile.dj
 
-CFLAGS=-DHAVE_CONFIG_H -DWIN32 -IMkfiles/dj -O2 -I. -Ifrontends/yasm
+CFLAGS=-DHAVE_CONFIG_H -IMkfiles/dj -O2 -I. -Ifrontends/yasm
 CC=gcc
 
 all: yasm
@@ -34,7 +34,8 @@ LIBYASM_OBJS= \
  libyasm/symrec.o \
  libyasm/valparam.o \
  libyasm/xmalloc.o \
- libyasm/xstrdup.o
+ libyasm/xstrdup.o \
+ module.o
 
 MODULES_ARCH_X86_OBJS= \
  modules/arch/x86/x86arch.o \
@@ -52,7 +53,8 @@ MODULES_ARCH_OBJS= \
  $(MODULES_ARCH_LC3B_OBJS)
 
 MODULES_DBGFMTS_OBJS= \
- modules/dbgfmts/null/null-dbgfmt.o
+ modules/dbgfmts/null/null-dbgfmt.o \
+ modules/dbgfmts/stabs/stabs-dbgfmt.o
 
 MODULES_LISTFMTS_OBJS= \
  modules/listfmts/nasm/nasm-listfmt.o
@@ -100,7 +102,6 @@ MODULES_OBJS = \
 
 YASM_OBJS= \
  frontends/yasm/yasm.o \
- Mkfiles/vc/yasm-module.o \
  frontends/yasm/yasm-options.o \
  $(LIBYASM_OBJS) \
  $(MODULES_OBJS)
index a71057bfb4836b58e412ff732b29e198164f1a5b..ec3569e42dc64463976e3b79e1832a5fc113cedc 100644 (file)
@@ -12,7 +12,7 @@
 #  CFLAGS appropriately, along with writing a config.h for the platform and
 #  placing it in a libyasm subdirectory.
 
-CFLAGS=-DHAVE_CONFIG_H -DWIN32 -IMkfiles -I. -Ifrontends/yasm
+CFLAGS=-DHAVE_CONFIG_H -IMkfiles -I. -Ifrontends/yasm
 CC=gcc
 
 all: yasm
@@ -37,7 +37,8 @@ LIBYASM_OBJS= \
  libyasm/symrec.o \
  libyasm/valparam.o \
  libyasm/xmalloc.o \
- libyasm/xstrdup.o
+ libyasm/xstrdup.o \
+ module.o
 
 MODULES_ARCH_X86_OBJS= \
  modules/arch/x86/x86arch.o \
@@ -55,7 +56,8 @@ MODULES_ARCH_OBJS= \
  $(MODULES_ARCH_LC3B_OBJS)
 
 MODULES_DBGFMTS_OBJS= \
- modules/dbgfmts/null/null-dbgfmt.o
+ modules/dbgfmts/null/null-dbgfmt.o \
+ modules/dbgfmts/stabs/stabs-dbgfmt.o
 
 MODULES_LISTFMTS_OBJS= \
  modules/listfmts/nasm/nasm-listfmt.o
@@ -103,7 +105,6 @@ MODULES_OBJS = \
 
 YASM_OBJS= \
  frontends/yasm/yasm.o \
- Mkfiles/vc/yasm-module.o \
  frontends/yasm/yasm-options.o \
  $(LIBYASM_OBJS) \
  $(MODULES_OBJS)
diff --git a/Mkfiles/vc/genmodule/genmodule.vcproj b/Mkfiles/vc/genmodule/genmodule.vcproj
new file mode 100644 (file)
index 0000000..fd4671d
--- /dev/null
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="7.10"\r
+       Name="genmodule"\r
+       ProjectGUID="{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}"\r
+       Keyword="Win32Proj">\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"/>\r
+       </Platforms>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="Debug"\r
+                       IntermediateDirectory="Debug"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               MinimalRebuild="TRUE"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="5"\r
+                               UsePrecompiledHeader="3"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="TRUE"\r
+                               DebugInformationFormat="4"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/genmodule.exe"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/genmodule.pdb"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="Release"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FILTERMODE"\r
+                               RuntimeLibrary="4"\r
+                               UsePrecompiledHeader="2"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="TRUE"\r
+                               DebugInformationFormat="3"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/genmodule.exe"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="TRUE"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               CommandLine="run.bat $(TargetPath)"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">\r
+                       <File\r
+                               RelativePath="..\..\..\libyasm\genmodule.c">\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/Mkfiles/vc/genmodule/run.bat b/Mkfiles/vc/genmodule/run.bat
new file mode 100644 (file)
index 0000000..fa5a90d
--- /dev/null
@@ -0,0 +1,6 @@
+@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
index 034bdfc26040e19f3763fc2642667f758b4621c9..1891b7293d19be8128ac11e773012e1637b9136e 100644 (file)
                                                BasicRuntimeChecks="3"/>\r
                                </FileConfiguration>\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\module.c">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\libyasm\objfmt.c">\r
                        </File>\r
index 4427f204b6e3ba2bcd6a7745bdfe3553dc171f77..56bcfd3f50dffb6a7f12e2c32fe0b5d84f234edd 100644 (file)
@@ -1,6 +1,7 @@
 Microsoft Visual Studio Solution File, Format Version 8.00\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyasm", "libyasm\libyasm.vcproj", "{29FE7874-1256-4AD6-B889-68E399DC9608}"\r
        ProjectSection(ProjectDependencies) = postProject\r
+               {F0E8B707-00C5-4FF2-B8EF-7C39817132A0} = {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}\r
        EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "modules\modules.vcproj", "{D715A3D4-EFAA-442E-AD8B-5B4FF64E1DD6}"\r
@@ -24,6 +25,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "re2c", "re2c\re2c.vcproj",
        ProjectSection(ProjectDependencies) = postProject\r
        EndProjectSection\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genmodule", "genmodule\genmodule.vcproj", "{F0E8B707-00C5-4FF2-B8EF-7C39817132A0}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfiguration) = preSolution\r
                Debug = Debug\r
@@ -50,6 +55,10 @@ Global
                {3C58BE13-50A3-4583-984D-D8902B3D7713}.Debug.Build.0 = Debug|Win32\r
                {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release.ActiveCfg = Release|Win32\r
                {3C58BE13-50A3-4583-984D-D8902B3D7713}.Release.Build.0 = Release|Win32\r
+               {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug.ActiveCfg = Debug|Win32\r
+               {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Debug.Build.0 = Debug|Win32\r
+               {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release.ActiveCfg = Release|Win32\r
+               {F0E8B707-00C5-4FF2-B8EF-7C39817132A0}.Release.Build.0 = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(ExtensibilityGlobals) = postSolution\r
        EndGlobalSection\r
index 9ecacaa977a757f0bdcdbd12717f21543e7d5641..dec2e4136c8441441f4ea1127bfdf3c69922d813 100644 (file)
                <Filter\r
                        Name="Source Files"\r
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">\r
-                       <File\r
-                               RelativePath="yasm-module.c">\r
-                               <FileConfiguration\r
-                                       Name="Debug|Win32">\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               Optimization="0"\r
-                                               AdditionalIncludeDirectories="../../frontends/yasm"\r
-                                               PreprocessorDefinitions=""\r
-                                               BasicRuntimeChecks="3"/>\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Release|Win32">\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               Optimization="2"\r
-                                               AdditionalIncludeDirectories="../../frontends/yasm"\r
-                                               PreprocessorDefinitions=""/>\r
-                               </FileConfiguration>\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\frontends\yasm\yasm-module.h">\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\frontends\yasm\yasm-options.c">\r
                                <FileConfiguration\r
index a1d36db793f0d2e555281cf28c33cb1001966b5d..9b8524f3264792e12d70dc69bffca0f933869557 100644 (file)
@@ -31,6 +31,7 @@
 
 #define OUTPUT "module.c"
 #define MAXLINE        1024
+#define MAXMODULES 128
 
 int
 main(int argc, char *argv[])
@@ -40,12 +41,46 @@ main(int argc, char *argv[])
     int i;
     int len;
     char *strp;
+    char *modules[MAXMODULES];
+    int num_modules = 0;
 
     if (argc < 2) {
        fprintf(stderr, "Usage: %s <file> [module_name ...]\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]);
+    }
+#endif
+
     out = fopen(OUTPUT, "wt");
 
     if (!out) {
@@ -53,8 +88,6 @@ main(int argc, char *argv[])
        return EXIT_FAILURE;
     }
 
-    str = malloc(MAXLINE);
-
     fprintf(out, "/* This file auto-generated by genmodule.c"
                 " - don't edit it */\n\n");
 
@@ -76,15 +109,15 @@ main(int argc, char *argv[])
            }
            *strp = '\0';
 
-           for (i=2; i<argc; i++) {
-               if (strncmp(argv[i], str+8, len) == 0) {
+           for (i=0; i<num_modules; i++) {
+               if (strncmp(modules[i], str+8, len) == 0) {
                    fprintf(out, "    {\"%s\", &yasm_%s_LTX_%s},\n",
-                           argv[i]+len+1, argv[i]+len+1, str+8);
+                           modules[i]+len+1, modules[i]+len+1, str+8);
                }
            }
        } else if (strncmp(str, "EXTERN_LIST", 11) == 0) {
-           for (i=2; i<argc; i++) {
-               strcpy(str, argv[i]);
+           for (i=0; i<num_modules; i++) {
+               strcpy(str, modules[i]);
                strp = str;
                while (*strp != '\0' && *strp != '_') {
                    len++;
@@ -102,6 +135,8 @@ main(int argc, char *argv[])
     fclose(in);
     fclose(out);
 
+    for (i=0; i<num_modules; i++)
+       free(modules[i]);
     free(str);
 
     return EXIT_SUCCESS;