Example #1
0
def CreateNantBuildFile(libs):
    stream = open("build.build", "w")
    stream.write("""<?xml version="1.0"?>
<project name="nant_test" default="all" basedir=".">  
""")

    for i in range(libs):
        libname = cppcodebase.lib_name(i)
        stream.write('''    <target name="''' + libname + '''">
        <mkdir dir="''' + libname + '''/obj"/>
        <cl outputdir="''' + libname + '''/obj">
            <sources>
                <include name="''' + libname + '''/*.cpp" />
            </sources>
            <includedirs>
                <include name="." />
            </includedirs>
        </cl>        
    </target>
''')

    stream.write('    <target name="all" depends="\n')
    for i in range(libs - 1):
        stream.write('    ' + cppcodebase.lib_name(i) + ',\n')
    stream.write('    ' + cppcodebase.lib_name(libs - 1) + '">\n')
    stream.write('    </target>\n')

    stream.write('    <target name="clean">\n')
    for i in range(libs):
        stream.write('        <delete dir="'
                     '' + cppcodebase.lib_name(i) + '/obj"/>\n')
    stream.write('    </target>\n')

    stream.write('</project>\n')
Example #2
0
def CreateAntBuildFile(libs, compiler):
    stream = file("build.xml", "w")
    stream.write("""<?xml version="1.0"?>
<project name="ant_test" default="all" basedir=".">  
    <taskdef resource="cpptasks.tasks"/>
    <typedef resource="cpptasks.types"/>
""")    

    for i in xrange(libs):
        libname = cppcodebase.lib_name(i)
        stream.write('''    <target name="''' + libname + '''">
        <mkdir dir="''' + libname + '''/obj"/>
        <cc subsystem="console"
            objdir="''' + libname + '''/obj" 
            outtype="static" 
            debug="true"
            name="''' + compiler + '''">
        <fileset dir="''' + libname + '''" includes="*.cpp"/>
        <includepath path="."/>          
        </cc>
    </target>
''')

    stream.write('    <target name="all" depends="\n')
    for i in xrange(libs-1):
        stream.write('    ' + cppcodebase.lib_name(i) + ',\n')
    stream.write('    ' + cppcodebase.lib_name(libs-1) + '">\n')    
    stream.write('    </target>\n')
    
    stream.write('    <target name="clean">\n')
    for i in xrange(libs):
        stream.write('        <delete dir="''' + cppcodebase.lib_name(i) + '/obj"/>\n')
    stream.write('    </target>\n')
    
    stream.write('</project>\n')
Example #3
0
def CreateMSVCSolution(libs):
    handle = open("solution.sln", "w")
    handle.write(
        "Microsoft Visual Studio Solution File, Format Version 11.00\n")

    for i in range(libs):
        project_name = cppcodebase.lib_name(i) + '\\' + cppcodebase.lib_name(
            i) + '.vcxproj'
        handle.write('Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "' +
                     cppcodebase.lib_name(i) + '", "' + project_name +
                     '", "{' + LibraryGUID(i) + '}"\n')
        handle.write('EndProject\n')

    handle.write("""
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
""")
    for i in range(libs):
        handle.write("""		{""" + LibraryGUID(i) +
                     """}.Debug|Win32.ActiveCfg = Debug|Win32
		{""" + LibraryGUID(i) + """}.Debug|Win32.Build.0 = Debug|Win32
""")
    handle.write("""	EndGlobalSection
EndGlobal
""")
Example #4
0
def CreateNantBuildFile(libs):
    stream = open("build.build", "w")
    stream.write("""<?xml version="1.0"?>
<project name="nant_test" default="all" basedir=".">  
""")    

    for i in range(libs):
        libname = cppcodebase.lib_name(i)
        stream.write('''    <target name="''' + libname + '''">
        <mkdir dir="''' + libname + '''/obj"/>
        <cl outputdir="''' + libname + '''/obj">
            <sources>
                <include name="''' + libname + '''/*.cpp" />
            </sources>
            <includedirs>
                <include name="." />
            </includedirs>
        </cl>        
    </target>
''')

    stream.write('    <target name="all" depends="\n')
    for i in range(libs-1):
        stream.write('    ' + cppcodebase.lib_name(i) + ',\n')
    stream.write('    ' + cppcodebase.lib_name(libs-1) + '">\n')    
    stream.write('    </target>\n')
    
    stream.write('    <target name="clean">\n')
    for i in range(libs):
        stream.write('        <delete dir="''' + cppcodebase.lib_name(i) + '/obj"/>\n')
    stream.write('    </target>\n')
    
    stream.write('</project>\n')
Example #5
0
def CreateMSVCSolution(libs):
    handle = file("solution.sln", "w")
    handle.write("Microsoft Visual Studio Solution File, Format Version 8.00\n")
    
    for i in xrange(libs):
        project_name = cppcodebase.lib_name(i) + '\\' + cppcodebase.lib_name(i) + '.vcproj'
        handle.write('Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "' + cppcodebase.lib_name(i) + 
                      '", "' + project_name + '", "{' + LibraryGUID(i) + '}"\n')
        handle.write('EndProject\n')
Example #6
0
def CreateMSVCProjFile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 
    handle = file("lib_" + str(lib_number) + ".vcproj", "w")
    handle.write("""<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="7.10"
	Name=""" + '"' + cppcodebase.lib_name(lib_number) + '"' + """
	ProjectGUID="{""" + LibraryGUID(lib_number) + """}"
	Keyword="Win32Proj">
	<Platforms>
		<Platform
			Name="Win32"/>
	</Platforms>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="Debug"
			IntermediateDirectory="Debug"
			ConfigurationType="4"
			CharacterSet="2">
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
                AdditionalIncludeDirectories=".."
				MinimalRebuild="TRUE"
				BasicRuntimeChecks="3"
				RuntimeLibrary="5"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				Detect64BitPortabilityProblems="TRUE"
				DebugInformationFormat="4"/>
			<Tool
				Name="VCCustomBuildTool"/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="$(OutDir)/""" + cppcodebase.lib_name(lib_number) + """.lib"/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
""")

    for i in xrange(classes):
        handle.write('  <File RelativePath=".\class_' + str(i) + '.cpp"/>\n')

    handle.write("""
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>
""")
    os.chdir('..') 
Example #7
0
def CreateMSVCProjFile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number))
    handle = file("lib_" + str(lib_number) + ".vcproj", "w")
    handle.write("""<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="7.10"
	Name=""" + '"' + cppcodebase.lib_name(lib_number) + '"' + """
	ProjectGUID="{""" + LibraryGUID(lib_number) + """}"
	Keyword="Win32Proj">
	<Platforms>
		<Platform
			Name="Win32"/>
	</Platforms>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="Debug"
			IntermediateDirectory="Debug"
			ConfigurationType="4"
			CharacterSet="2">
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
                AdditionalIncludeDirectories=".."
				MinimalRebuild="TRUE"
				BasicRuntimeChecks="3"
				RuntimeLibrary="5"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				Detect64BitPortabilityProblems="TRUE"
				DebugInformationFormat="4"/>
			<Tool
				Name="VCCustomBuildTool"/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="$(OutDir)/""" + cppcodebase.lib_name(lib_number) + """.lib"/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
""")

    for i in xrange(classes):
        handle.write('  <File RelativePath=".\class_' + str(i) + '.cpp"/>\n')

    handle.write("""
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>
""")
    os.chdir('..')
Example #8
0
def CreateMSVCSolution(libs):
    handle = file("solution.sln", "w")
    handle.write(
        "Microsoft Visual Studio Solution File, Format Version 8.00\n")

    for i in xrange(libs):
        project_name = cppcodebase.lib_name(i) + '\\' + cppcodebase.lib_name(
            i) + '.vcproj'
        handle.write('Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "' +
                     cppcodebase.lib_name(i) + '", "' + project_name +
                     '", "{' + LibraryGUID(i) + '}"\n')
        handle.write('EndProject\n')
Example #9
0
def CreateFullJamfile(libs):
    handle = file("Jamfile.jam", "w")
    handle.write("SubDir TOP ;\n\n")

    for i in xrange(libs):
        handle.write('SubInclude TOP ' + cppcodebase.lib_name(i) + ' ;\n')

    handle.write('\nWorkspace GeneratedLibs :\n')
    for i in xrange(libs):
        handle.write('\t\t' + cppcodebase.lib_name(i) + '\n')
    handle.write(';\n')

    handle = file("Jamrules.jam", "w")
    handle.write('INCLUDES = $(TOP) ;\n')
Example #10
0
def CreateLibBuildfile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number))
    handle = open(cppcodebase.lib_name(lib_number) + ".build", "w")
    handle.write('Library {\n')
    handle.write('  id = "' + cppcodebase.lib_name(lib_number) + '";\n')
    handle.write('  Source {\n')

    for i in range(classes):
        handle.write('    "class_' + str(i) + '.cpp",\n')

    handle.write("""  };
}
""")
    os.chdir('..')
Example #11
0
def CreateLibBuildfile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 
    handle = open(cppcodebase.lib_name(lib_number) + ".build", "w");
    handle.write ('Library {\n')
    handle.write ('  id = "' + cppcodebase.lib_name(lib_number) + '";\n');
    handle.write('  Source {\n');

    for i in range(classes):
        handle.write('    "class_' + str(i) + '.cpp",\n')

    handle.write("""  };
}
""")
    os.chdir('..')
Example #12
0
def CreateFullJamfile(libs):
    handle = file("Jamfile.jam", "w")
    handle.write ("SubDir TOP ;\n\n")

    for i in xrange(libs):
        handle.write('SubInclude TOP ' + cppcodebase.lib_name(i) + ' ;\n')

    handle.write('\nWorkspace GeneratedLibs :\n')
    for i in xrange(libs):
        handle.write('\t\t' + cppcodebase.lib_name(i) + '\n')
    handle.write(';\n')

    handle = file("Jamrules.jam", "w")
    handle.write ('INCLUDES = $(TOP) ;\n')
Example #13
0
def CreateLibMakefile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 
    handle = open("Makefile", "w");
    handle.write ("""COMPILER = g++
INC = -I..
CCFLAGS = -g -O0 -Wall -pedantic -pipe $(INC)
ARCHIVE = ar
.SUFFIXES: .o .cpp

""")
    handle.write ("lib = lib_" + str(lib_number) + ".a\n")
    handle.write ("src = \\\n")
    for i in range(classes):
        handle.write('class_' + str(i) + '.cpp \\\n')
    handle.write ("""
    

objects = $(patsubst %.cpp, %.o, $(src))

all: $(lib)
 
$(lib): $(objects)
	$(ARCHIVE) cr $@ $^

.cpp.o:
	$(COMPILER) -MMD -MT $@ -MF [email protected] $(CCFLAGS) -c $< -o $@

clean:
	@del $(objects) $(lib)

""")    
    os.chdir('..')
Example #14
0
def CreateLibMakefile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number))
    handle = open("Makefile", "w")
    handle.write("""COMPILER = g++
INC = -I..
CCFLAGS = -g -O0 -Wall -pedantic -pipe $(INC)
ARCHIVE = ar
.SUFFIXES: .o .cpp

""")
    handle.write("lib = lib_" + str(lib_number) + ".a\n")
    handle.write("src = \\\n")
    for i in range(classes):
        handle.write('class_' + str(i) + '.cpp \\\n')
    handle.write("""
    

objects = $(patsubst %.cpp, %.o, $(src))

all: $(lib)
 
$(lib): $(objects)
	$(ARCHIVE) cr $@ $^

.cpp.o:
	$(COMPILER) -MMD -MT $@ -MF [email protected] $(CCFLAGS) -c $< -o $@

clean:
	@del $(objects) $(lib)

""")
    os.chdir('..')
Example #15
0
def CreateFullBoostV2File(libs):
    stream = file("Jamfile", "w")
    for i in xrange(libs):
        stream.write( "build-project %s ;\n" % cppcodebase.lib_name(i) )

    file("project-root.jam","w").close()
    build = file("boost-build.jam","w")
    build.write ("boost-build %s ;\n" % BOOST_BUILD_PATH)
Example #16
0
def CreateFullJamfile(libs):
    handle = file("Jamfile", "w")
    handle.write("SubDir TOP ;\n\n")

    for i in xrange(libs):
        handle.write('SubInclude TOP ' + cppcodebase.lib_name(i) + ' ;\n')

    handle = file("Jamrules", "w")
    handle.write('INCLUDES = $(TOP) ;\n')
Example #17
0
def CreateFullJamfile(libs):
    handle = file("Jamfile", "w")
    handle.write ("SubDir TOP ;\n\n")
    
    for i in xrange(libs):
        handle.write('SubInclude TOP ' + cppcodebase.lib_name(i) + ' ;\n')
        
    handle = file("Jamrules", "w")
    handle.write ('INCLUDES = $(TOP) ;\n')    
Example #18
0
def CreateLibBoostV2File(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 
    handle = file("Jamfile", "w")
    handle.write ( "project %s : ;\n\n" % lib_number )
    handle.write ( "lib %s : \n" % lib_number )
    for i in xrange(classes):
        handle.write('\tclass_' + str(i) + '.cpp\n')
    handle.write ('\t: <link>static <include>.. ;')            
    os.chdir('..') 
Example #19
0
def CreateLibJamfile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number))
    handle = file("Jamfile.jam", "w")
    handle.write("SubDir TOP lib_" + str(lib_number) + " ;\n\n")
    handle.write("SubDirHdrs $(INCLUDES) ;\n\n")
    handle.write("Library lib_" + str(lib_number) + " :\n")
    for i in xrange(classes):
        handle.write('    class_' + str(i) + '.cpp\n')
    handle.write('    ;\n')
    os.chdir('..')
Example #20
0
def CreateSConscript(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 
    handle = file("SConscript", "w");
    handle.write("Import('env')\n")
    handle.write('list = Split("""\n');
    for i in xrange(classes):
        handle.write('    class_' + str(i) + '.cpp\n')
    handle.write('    """)\n\n')
    handle.write('env.StaticLibrary("lib_' + str(lib_number) + '", list)\n\n')
    os.chdir('..') 
Example #21
0
def CreateLibJamfile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 
    handle = file("Jamfile", "w")
    handle.write ("SubDir TOP lib_" + str(lib_number) + " ;\n\n")
    handle.write ("SubDirHdrs $(INCLUDES) ;\n\n")
    handle.write ("Library lib_" + str(lib_number) + " :\n")
    for i in xrange(classes):
        handle.write('    class_' + str(i) + '.cpp\n')
    handle.write ('    ;\n')
    os.chdir('..')
Example #22
0
def CreateFullJamfile(libs):
    handle = open("Jamfile", "w")
    handle.write("SubDir TOP ;\n\n")

    for i in range(libs):
        handle.write('SubInclude TOP ' + cppcodebase.lib_name(i) + ' ;\n')

    handle = open("Jamrules", "w")
    handle.write('INCLUDES = $(TOP) ;\n')
    handle.write('CCFLAGS = -g -O0 -Wall -pedantic -pipe ;\n')
    handle.write('C++FLAGS = -g -O0 -Wall -pedantic -pipe ;\n')
Example #23
0
def CreateFullRantfile(libs):
    handle = file("Rantfile", "w")
    handle.write ('import "c/dependencies"\n\n')
    
    handle.write ('desc "Build all"\n')    
    handle.write ('task :all => [\n')
    for i in xrange(libs):
        handle.write('\t\t"' + cppcodebase.lib_name(i) + '/lib' + str(i) + '.a",\n')
    handle.write ('] do\nend\n\n')
        
    handle.write ('desc "Clean all"\n')    
    handle.write ('task :clean => [\n')
    for i in xrange(libs):
        handle.write('\t\t"lib_' + str(i) + '/clean",\n')
    handle.write ('] do\nend\n\n')
    
    handle.write ('subdirs [\n')
    for i in xrange(libs):
        handle.write('\t\t"' + cppcodebase.lib_name(i) + '",\n')
    handle.write (']\n')
Example #24
0
def CreateFullJamfile(libs):
    handle = open("Jamfile", "w")
    handle.write ("SubDir TOP ;\n\n")
    
    for i in range(libs):
        handle.write('SubInclude TOP ' + cppcodebase.lib_name(i) + ' ;\n')
        
    handle = open("Jamrules", "w")
    handle.write ('INCLUDES = $(TOP) ;\n')
    handle.write('CCFLAGS = -g -O0 -Wall -pedantic -pipe ;\n')
    handle.write('C++FLAGS = -g -O0 -Wall -pedantic -pipe ;\n')
Example #25
0
def CreateMSVCXProjFile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 
    handle = open("lib_" + str(lib_number) + ".vcxproj", "w")
    handle.write("""<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" />
  <PropertyGroup>
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <ProjectGuid>{ """ + LibraryGUID(lib_number) + """}</ProjectGuid>
    <ShowAllFiles>false</ShowAllFiles>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)/Microsoft.Cpp.props" />
  <ItemDefinitionGroup>
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <AdditionalIncludeDirectories>..;</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;</PreprocessorDefinitions>
      <MinimalRebuild>true</MinimalRebuild>
      <WarningLevel>Level3</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
    </ClCompile>
  </ItemDefinitionGroup>
  <ItemGroup>
""")
    for i in range(classes):
        handle.write('    <ClCompile Include=".\class_' + str(i) + '.cpp"/>\n')

    handle.write("""
  </ItemGroup>
  <ItemGroup>
""")
    for i in range(classes):
        handle.write('    <ClInclude Include=".\class_' + str(i) + '.h"/>\n')
  
    handle.write("""
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" />
</Project>
""")
    os.chdir('..') 
Example #26
0
def CreateMSVCXProjFile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number))
    handle = open("lib_" + str(lib_number) + ".vcxproj", "w")
    handle.write("""<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" />
  <PropertyGroup>
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <ProjectGuid>{ """ + LibraryGUID(lib_number) + """}</ProjectGuid>
    <ShowAllFiles>false</ShowAllFiles>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)/Microsoft.Cpp.props" />
  <ItemDefinitionGroup>
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <AdditionalIncludeDirectories>..;</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;</PreprocessorDefinitions>
      <MinimalRebuild>true</MinimalRebuild>
      <WarningLevel>Level3</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
    </ClCompile>
  </ItemDefinitionGroup>
  <ItemGroup>
""")
    for i in range(classes):
        handle.write('    <ClCompile Include=".\class_' + str(i) + '.cpp"/>\n')

    handle.write("""
  </ItemGroup>
  <ItemGroup>
""")
    for i in range(classes):
        handle.write('    <ClInclude Include=".\class_' + str(i) + '.h"/>\n')

    handle.write("""
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" />
</Project>
""")
    os.chdir('..')
Example #27
0
def CreateAntBuildFile(libs, compiler):
    stream = file("build.xml", "w")
    stream.write("""<?xml version="1.0"?>
<project name="ant_test" default="all" basedir=".">  
    <taskdef resource="cpptasks.tasks"/>
    <typedef resource="cpptasks.types"/>
""")

    for i in xrange(libs):
        libname = cppcodebase.lib_name(i)
        stream.write('''    <target name="''' + libname + '''">
        <mkdir dir="''' + libname + '''/obj"/>
        <cc subsystem="console"
            objdir="''' + libname + '''/obj" 
            outtype="static" 
            debug="true"
            name="''' + compiler + '''">
        <fileset dir="''' + libname + '''" includes="*.cpp"/>
        <includepath path="."/>          
        </cc>
    </target>
''')

    stream.write('    <target name="all" depends="\n')
    for i in xrange(libs - 1):
        stream.write('    ' + cppcodebase.lib_name(i) + ',\n')
    stream.write('    ' + cppcodebase.lib_name(libs - 1) + '">\n')
    stream.write('    </target>\n')

    stream.write('    <target name="clean">\n')
    for i in xrange(libs):
        stream.write('        <delete dir="'
                     '' + cppcodebase.lib_name(i) + '/obj"/>\n')
    stream.write('    </target>\n')

    stream.write('</project>\n')
Example #28
0
def CreateMSVCSolution(libs):
    handle = open("solution.sln", "w")
    handle.write("Microsoft Visual Studio Solution File, Format Version 11.00\n")
    
    for i in range(libs):
        project_name = cppcodebase.lib_name(i) + '\\' + cppcodebase.lib_name(i) + '.vcxproj'
        handle.write('Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "' + cppcodebase.lib_name(i) + 
                      '", "' + project_name + '", "{' + LibraryGUID(i) + '}"\n')
        handle.write('EndProject\n')
    
    handle.write("""
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
""")
    for i in range(libs):
        handle.write("""		{""" + LibraryGUID(i) + """}.Debug|Win32.ActiveCfg = Debug|Win32
		{""" + LibraryGUID(i) + """}.Debug|Win32.Build.0 = Debug|Win32
""")
    handle.write("""	EndGlobalSection
EndGlobal
""")
Example #29
0
def CreateLibRantfileMsvc(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 

    handle = open("Rantfile", "w")
    handle.write ('''import "c/dependencies"
    
file "lib''' + str(lib_number) + '''.a" => sys["*.cpp"].sub_ext("obj") do |t|
   sys "lib /nologo /out:#{t.name} #{t.prerequisites}"
end

gen Rule, '.obj' => '.cpp' do |t|
   sys "cl /Od /nologo /c /I.. #{t.source}"
end

gen C::Dependencies
gen Action do source "c_dependencies" end

task :clean do
    sys.rm_f Dir["*.obj"] + %w(lib''' + str(lib_number) + '''.a) + %w(c_dependencies)
end
''')
    os.chdir('..')
Example #30
0
def CreateLibRantfileGcc(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 

    handle = file("Rantfile", "w")
    handle.write ('''import "c/dependencies"
    
file "lib''' + str(lib_number) + '''.a" => sys["*.cpp"].sub_ext("o") do |t|
  sys "ar cr #{t.name} #{t.prerequisites}"
end

gen Rule, '.o' => '.cpp' do |t|
  sys "g++ -c -I.. -o #{t.name} #{t.source}"
end

gen C::Dependencies
gen Action do source "c_dependencies" end

task :clean do
    sys.rm_f Dir["*.o"] + %w(lib''' + str(lib_number) + '''.a) + %w(c_dependencies)
end
''')
    os.chdir('..')
Example #31
0
def CreateLibMakefile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number))
    handle = file("Makefile", "w")
    handle.write("""COMPILER = g++
INC = -I..
CCFLAGS = -Wall $(INC)
ARCHIVE = ar
DEPEND = makedepend
.SUFFIXES: .o .cpp

""")
    handle.write("lib = lib_" + str(lib_number) + ".a\n")
    handle.write("src = \\\n")
    for i in xrange(classes):
        handle.write('class_' + str(i) + '.cpp \\\n')
    handle.write("""
    

objects = $(patsubst %.cpp, %.o, $(src))

all: depend $(lib)
 
$(lib): $(objects)
	$(ARCHIVE) cr $@ $^
	touch $@

.cpp.o:
	$(COMPILER) $(CCFLAGS) -c $<

clean:
	@rm $(objects) $(lib) 2> /dev/null

depend:
	@$(DEPEND) $(INC) $(src)

""")
    os.chdir('..')
Example #32
0
def CreateLibMakefile(lib_number, classes):
    os.chdir(cppcodebase.lib_name(lib_number)) 
    handle = file("Makefile", "w");
    handle.write ("""COMPILER = g++
INC = -I..
CCFLAGS = -g -Wall $(INC)
ARCHIVE = ar
DEPEND = makedepend
.SUFFIXES: .o .cpp

""")
    handle.write ("lib = lib_" + str(lib_number) + ".a\n")
    handle.write ("src = \\\n")
    for i in xrange(classes):
        handle.write('class_' + str(i) + '.cpp \\\n')
    handle.write ("""
    

objects = $(patsubst %.cpp, %.o, $(src))

all: depend $(lib)
 
$(lib): $(objects)
	$(ARCHIVE) cr $@ $^
	touch $@

.cpp.o:
	$(COMPILER) $(CCFLAGS) -c $<

clean:
	@rm $(objects) $(lib) 2> /dev/null

depend:
	@$(DEPEND) $(INC) $(src)

""")    
    os.chdir('..')