Cosmos/source2/Build/Cosmos.Build.MSBuild/Cosmos.targets
BlueSkeye_cp 7372c8a9bd Bochs integration : alpha version
Limitations :

- Bochs must be installed on the system. This is not checked as a  prerequisite by the Builder.
- You will find a GuessForBochs Cosmos project under BlueSkeye user project folder that can be used to launch the Guess project under Bochs.
- You may have to fix manually the path for the following properties in Cosmos.bxrc file copied to the CosmosForBochs\Bin\Debug folder
  * romimage
  * vgaromimage
- The Cosmos project UI is not yet Bochs aware. If you do not use the GuessForBochs project you must manually edit your Cosmos project file to modify the following property in both the Debug and Release property group from the project file :

    <Launch>Bochs</Launch>

  You must also add the following properties in both the Debug and Release property group from the project file :

    <BochsConfig>Cosmos.bxrc</BochsConfig>
    <Bochs_Deployment>ISO</Bochs_Deployment>
    <Bochs_Launch>Bochs</Bochs_Launch>
    <Bochs_DebugEnabled>True</Bochs_DebugEnabled>
    <Bochs_DebugMode>Source</Bochs_DebugMode>
    <Bochs_IgnoreDebugStubAttribute />
    <Bochs_VMwareEdition>Player</Bochs_VMwareEdition>
    <Bochs_OutputPath>bin\Debug\</Bochs_OutputPath>
    <Bochs_Framework>MicrosoftNET</Bochs_Framework>
    <Bochs_UseInternalAssembler>False</Bochs_UseInternalAssembler>
    <Bochs_TraceAssemblies />
    <Bochs_EnableGDB>False</Bochs_EnableGDB>
    <Bochs_StartCosmosGDB>false</Bochs_StartCosmosGDB>
    <Bochs_Name>GuessForBochs</Bochs_Name>
    <Bochs_Description>Use Bochs emulator to deploy and debug.</Bochs_Description>
    <Bochs_VisualStudioDebugPort>Pipe: Cosmos\Serial</Bochs_VisualStudioDebugPort>
    <Bochs_PxeInterface>192.168.43.1</Bochs_PxeInterface>
    <Bochs_SlavePort>Serial: COM3</Bochs_SlavePort>
    <Bochs_ShowLaunchConsole>False</Bochs_ShowLaunchConsole>
2012-09-14 17:13:06 +00:00

95 lines
No EOL
4.5 KiB
XML

<?xml version="1.0"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4">
<PropertyGroup>
<CosmosDir Condition="$(CosmosDir) == ''">$([MSBuild]::GetRegistryValue("HKEY_LOCAL_MACHINE\Software\Cosmos", "UserKit"))</CosmosDir>
<BuildToolsDir Condition="$(BuildToolsDir) == ''">$(CosmosDir)\Build\Tools</BuildToolsDir>
<VSIPDir Condition="$(VSIPDir) == ''">$(CosmosDir)\Build\VSIP</VSIPDir>
<NasmFile>$(BuildToolsDir)\Nasm\nasm.exe</NasmFile>
<BinFormat Condition="$(BinFormat) == ''">bin</BinFormat>
</PropertyGroup>
<UsingTask TaskName="Cosmos.Build.MSBuild.IL2CPU" AssemblyFile="$(VSIPDir)\Cosmos.Build.MSBuild.dll" />
<UsingTask TaskName="Cosmos.Build.MSBuild.NAsm" AssemblyFile="$(VSIPDir)\Cosmos.Build.MSBuild.dll" />
<UsingTask TaskName="Cosmos.Build.MSBuild.MakeISO" AssemblyFile="$(VSIPDir)\Cosmos.Build.MSBuild.dll" />
<UsingTask TaskName="Cosmos.Build.MSBuild.Ld" AssemblyFile="$(VSIPDir)\Cosmos.Build.MSBuild.dll" />
<UsingTask TaskName="Cosmos.Build.MSBuild.ReadNAsmMapToCosmosMap" AssemblyFile="$(VSIPDir)\Cosmos.Build.MSBuild.dll" />
<UsingTask TaskName="Cosmos.Build.MSBuild.ExtractMapFromElfFile" AssemblyFile="$(VSIPDir)\Cosmos.Build.MSBuild.dll" />
<Target Name="CoreCompile">
<Error Text="File %(Compile.Identity) is set to compile, but .Cosmos projects don't compile any source themselves!"
Condition="$(Compile) != ''"/>
<CreateProperty Value="true" Condition="$(BinFormat) == 'elf'">
<Output PropertyName="IsELF" TaskParameter="Value"/>
</CreateProperty>
<CreateProperty Value="false" Condition="$(BinFormat) == 'bin'">
<Output PropertyName="IsELF" TaskParameter="Value"/>
</CreateProperty>
<IL2CPU DebugMode="$(DebugMode)"
DebugEnabled="$(DebugEnabled)"
TraceAssemblies="$(TraceAssemblies)"
IgnoreDebugStubAttribute="$(IgnoreDebugStubAttribute)"
DebugCom="1"
UseNAsm="true"
References="@(ReferencePath)"
OutputFilename="$(TargetDir)$(MSBuildProjectName).asm"
EnableLogging="true"
EmitDebugSymbols="$(DebugSymbols)"/>
<NAsm InputFile="$(TargetDir)$(MSBuildProjectName).asm"
OutputFile="$(TargetDir)$(MSBuildProjectName).obj"
IsELF="$(IsELF)"
ExePath="$(NasmFile)" />
<!--ELF only-->
<!-- 16 MB 0x1000000 as per hpa (syslinux) is a good spot.
For now just put some dummy values. 16 and 32 MB. Later size better.-->
<Ld CosmosBuildDir="$(CosmosDir)\Build"
WorkingDir="$(TargetDir)"
Arguments="-Ttext 0x2000000 -Tdata 0x1000000 -e Kernel_Start -o '$(TargetDir)$(MSBuildProjectName).bin' '$(TargetDir)$(MSBuildProjectName).obj'"
Condition="$(IsELF) == 'true'"/>
<ExtractMapFromElfFile InputFile="$(TargetDir)$(MSBuildProjectName).bin"
DebugInfoFile="$(TargetDir)$(MSBuildProjectName).mdf"
WorkingDir="$(TargetDir)"
CosmosBuildDir="$(CosmosDir)\Build"
Condition="$(IsELF) == 'true'"/>
<CreateItem Include="$(TargetDir)$(MSBuildProjectName).bin" Condition="$(IsELF) == 'true'">
<Output TaskParameter="Include"
ItemName="TempFilesToCopy"/>
</CreateItem>
<!--End of ELF only-->
<!--binary only-->
<ReadNAsmMapToCosmosMap InputBaseDir="$(TargetDir)"
DebugInfoFile="$(TargetDir)$(MSBuildProjectName).mdf"
Condition="$(IsELF) == 'false'"/>
<!--end of binary only-->
<!--todo: update cxdb to cxdbg-->
<!-- We dont build ISO in MSBuild any more because not all targets need it and it takes time.
But we do delete it, so we dont have out of date outputs. -->
<!-- <MakeISO InputFile="$(TargetDir)$(MSBuildProjectName).bin"
OutputFile="$(TargetDir)$(MSBuildProjectName).iso"
CosmosBuildDir="$(CosmosDir)\Build" /> -->
<Delete Files="$(TargetDir)$(MSBuildProjectName).iso" />
</Target>
<!-- compat targets -->
<Target Name="CreateManifestResourceNames">
</Target>
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
<Target Name="CopyFilesToOutputDirectory">
<!-- copy <AssemblyName>.exe from obj\Debug to bin\Debug-->
<Copy SourceFiles="Cosmos.bxrc"
DestinationFolder="$(TargetDir)"/>
</Target>
</Project>