vsyasm.targets 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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="YASM">
  8. <Targets>_YASM</Targets>
  9. </AvailableItemName>
  10. </ItemGroup>
  11. <UsingTask
  12. TaskName="YASM"
  13. TaskFactory="XamlTaskFactory"
  14. AssemblyName="Microsoft.Build.Tasks.v4.0">
  15. <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
  16. </UsingTask>
  17. <Target
  18. Name="_YASM"
  19. BeforeTargets="$(YASMBeforeTargets)"
  20. AfterTargets="$(YASMAfterTargets)"
  21. Condition="'@(YASM)' != ''"
  22. DependsOnTargets="$(YASMDependsOn);ComputeYASMOutput"
  23. Outputs="@(YASM->'%(ObjectFile)')"
  24. Inputs="@(YASM);%(YASM.AdditionalDependencies);$(MSBuildProjectFile)">
  25. <ItemGroup
  26. Condition="'@(SelectedFiles)' != ''">
  27. <YASM
  28. Remove="@(YASM)"
  29. Condition="'%(Identity)' != '@(SelectedFiles)'" />
  30. </ItemGroup>
  31. <ItemGroup>
  32. <YASM_tlog
  33. Include="%(YASM.ObjectFile)"
  34. Condition="'%(YASM.ObjectFile)' != '' and '%(YASM.ExcludedFromBuild)' != 'true'">
  35. <Source>@(YASM, '|')</Source>
  36. </YASM_tlog>
  37. </ItemGroup>
  38. <Message
  39. Importance="High"
  40. Text="%(YASM.ExecutionDescription)" />
  41. <WriteLinesToFile
  42. Condition="'@(YASM_tlog)' != '' and '%(YASM_tlog.ExcludedFromBuild)' != 'true'"
  43. File="$(IntDir)$(ProjectName).write.1.tlog"
  44. Lines="^%(YASM_tlog.Source);@(YASM_tlog->'%(Fullpath)')" />
  45. <YASM
  46. Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true'"
  47. CommandLineTemplate="%(YASM.CommandLineTemplate)"
  48. Debug="%(YASM.Debug)"
  49. PreIncludeFile="%(YASM.PreIncludeFile)"
  50. IncludePaths="%(YASM.IncludePaths)"
  51. Defines="%(YASM.Defines)"
  52. UnDefines="%(YASM.UnDefines)"
  53. ObjectFile="%(YASM.ObjectFile)"
  54. ListFile="%(YASM.ListFile)"
  55. MapFile="%(YASM.MapFile)"
  56. ErrorFile="%(YASM.ErrorFile)"
  57. SymbolPrefix="%(YASM.SymbolPrefix)"
  58. SymbolSuffix="%(YASM.SymbolSuffix)"
  59. PreProc="%(YASM.PreProc)"
  60. Parser="%(YASM.Parser)"
  61. AdditionalOptions="%(YASM.AdditionalOptions)"
  62. Inputs="@(YASM)" />
  63. </Target>
  64. <PropertyGroup>
  65. <ComputeLinkInputsTargets>
  66. $(ComputeLinkInputsTargets);
  67. ComputeYASMOutput;
  68. </ComputeLinkInputsTargets>
  69. <ComputeLibInputsTargets>
  70. $(ComputeLibInputsTargets);
  71. ComputeYASMOutput;
  72. </ComputeLibInputsTargets>
  73. </PropertyGroup>
  74. <Target
  75. Name="ComputeYASMOutput"
  76. Condition="'@(YASM)' != ''">
  77. <ItemGroup>
  78. <YASMDirsToMake
  79. Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true' and !HasTrailingSlash('%(YASM.ObjectFile)')"
  80. Include="%(YASM.ObjectFile)" />
  81. <Link
  82. Include="%(YASMDirsToMake.Identity)"
  83. Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
  84. <Lib
  85. Include="%(YASMDirsToMake.Identity)"
  86. Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
  87. <ImpLib
  88. Include="%(YASMDirsToMake.Identity)"
  89. Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
  90. </ItemGroup>
  91. <ItemGroup>
  92. <YASMDirsToMake
  93. Condition="'@(YASM)' != '' and '%(YASM.ExcludedFromBuild)' != 'true' and HasTrailingSlash('%(YASM.ObjectFile)')"
  94. Include="@(YASM->'%(ObjectFile)%(Filename).obj')" />
  95. <Link
  96. Include="%(YASMDirsToMake.Identity)"
  97. Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
  98. <Lib
  99. Include="%(YASMDirsToMake.Identity)"
  100. Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
  101. <ImpLib
  102. Include="%(YASMDirsToMake.Identity)"
  103. Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
  104. </ItemGroup>
  105. <MakeDir
  106. Directories="@(YASMDirsToMake->'%(RootDir)%(Directory)')" />
  107. </Target>
  108. </Project>