1<?xml version="1.0" encoding="utf-8"?>
2<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3  <ItemGroup>
4    <PropertyPageSchema
5      Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
6    <AvailableItemName
7      Include="NASM">
8      <Targets>_NASM</Targets>
9    </AvailableItemName>
10  </ItemGroup>
11  <UsingTask
12    TaskName="NASM"
13    TaskFactory="XamlTaskFactory"
14    AssemblyName="Microsoft.Build.Tasks.v4.0">
15    <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
16  </UsingTask>
17  <Target
18    Name="_NASM"
19    BeforeTargets="$(NASMBeforeTargets)"
20    AfterTargets="$(NASMAfterTargets)"
21    Condition="'@(NASM)' != ''"
22    DependsOnTargets="$(NASMDependsOn);ComputeNASMOutput"
23    Outputs="@(NASM-&gt;Metadata('Outputs')-&gt;Distinct())"
24    Inputs="@(NASM);%(NASM.AdditionalDependencies);$(MSBuildProjectFile)">
25    <ItemGroup
26      Condition="'@(SelectedFiles)' != ''">
27      <NASM
28        Remove="@(NASM)"
29        Condition="'%(Identity)' != '@(SelectedFiles)'" />
30    </ItemGroup>
31    <ItemGroup>
32      <NASM_tlog
33        Include="%(NASM.Outputs)"
34        Condition="'%(NASM.Outputs)' != '' and '%(NASM.ExcludedFromBuild)' != 'true'">
35        <Source>@(NASM, '|')</Source>
36      </NASM_tlog>
37    </ItemGroup>
38    <Message
39      Importance="High"
40      Text="%(NASM.ExecutionDescription)" />
41    <WriteLinesToFile
42      Condition="'@(NASM_tlog)' != '' and '%(NASM_tlog.ExcludedFromBuild)' != 'true'"
43      File="$(IntDir)$(ProjectName).write.1.tlog"
44      Lines="^%(NASM_tlog.Source);@(NASM_tlog-&gt;'%(Fullpath)')" />
45    <NASM
46      Condition="'@(NASM)' != '' and '%(NASM.ExcludedFromBuild)' != 'true'"
47      CommandLineTemplate="%(NASM.CommandLineTemplate)"
48      TreatWarningsAsErrors="%(NASM.TreatWarningsAsErrors)"
49      DisableOrphanLabelsWarning="%(NASM.DisableOrphanLabelsWarning)"
50      GenerateDebugInfo="%(NASM.GenerateDebugInfo)"
51      ObjectFileName="%(NASM.ObjectFileName)"
52      IncludePath="%(NASM.IncludePath)"
53      PreprocessorDefinitions="%(NASM.PreprocessorDefinitions)"
54      Optimization="%(NASM.Optimization)"
55      ObjectFileFormat="%(NASM.ObjectFileFormat)"
56      ErrorReportingFormat="%(NASM.ErrorReportingFormat)"
57      AdditionalOptions="%(NASM.AdditionalOptions)"
58      Inputs="@(NASM)" />
59  </Target>
60  <PropertyGroup>
61    <ComputeLinkInputsTargets>
62            $(ComputeLinkInputsTargets);
63            ComputeNASMOutput;
64          </ComputeLinkInputsTargets>
65    <ComputeLibInputsTargets>
66            $(ComputeLibInputsTargets);
67            ComputeNASMOutput;
68          </ComputeLibInputsTargets>
69  </PropertyGroup>
70  <Target
71    Name="ComputeNASMOutput"
72    Condition="'@(NASM)' != ''">
73    <ItemGroup>
74      <NASMDirsToMake
75        Condition="'@(NASM)' != '' and '%(NASM.ExcludedFromBuild)' != 'true'"
76        Include="%(NASM.Outputs)" />
77      <Link
78        Include="%(NASMDirsToMake.Identity)"
79        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
80      <Lib
81        Include="%(NASMDirsToMake.Identity)"
82        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
83      <ImpLib
84        Include="%(NASMDirsToMake.Identity)"
85        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
86    </ItemGroup>
87    <MakeDir
88      Directories="@(NASMDirsToMake-&gt;'%(RootDir)%(Directory)')" />
89  </Target>
90</Project>