2021-04-06 19:54:43 -03:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<ItemGroup>
|
|
|
|
<_PegenSources Include="$(PySourcePath)Grammar\python.gram;$(PySourcePath)Grammar\Tokens" />
|
|
|
|
<_PegenOutputs Include="$(PySourcePath)Parser\parser.c" />
|
|
|
|
<_ASTSources Include="$(PySourcePath)Parser\Python.asdl" />
|
|
|
|
<_ASTOutputs Include="$(PySourcePath)Include\internal\pycore_ast.h">
|
|
|
|
<Argument>-H</Argument>
|
|
|
|
</_ASTOutputs>
|
|
|
|
<_ASTOutputs Include="$(PySourcePath)Include\internal\pycore_ast_state.h">
|
|
|
|
<Argument>-I</Argument>
|
|
|
|
</_ASTOutputs>
|
|
|
|
<_ASTOutputs Include="$(PySourcePath)Python\Python-ast.c">
|
|
|
|
<Argument>-C</Argument>
|
|
|
|
</_ASTOutputs>
|
|
|
|
<_TokenSources Include="$(PySourcePath)Grammar\Tokens" />
|
|
|
|
<_TokenOutputs Include="$(PySourcePath)Doc\library\token-list.inc">
|
|
|
|
<Format>rst</Format>
|
|
|
|
</_TokenOutputs>
|
2022-05-11 18:22:50 -03:00
|
|
|
<_TokenOutputs Include="$(PySourcePath)Include\internal\pycore_token.h">
|
2021-04-06 19:54:43 -03:00
|
|
|
<Format>h</Format>
|
|
|
|
</_TokenOutputs>
|
|
|
|
<_TokenOutputs Include="$(PySourcePath)Parser\token.c">
|
|
|
|
<Format>c</Format>
|
|
|
|
</_TokenOutputs>
|
|
|
|
<_TokenOutputs Include="$(PySourcePath)Lib\token.py">
|
|
|
|
<Format>py</Format>
|
|
|
|
</_TokenOutputs>
|
|
|
|
<_KeywordSources Include="$(PySourcePath)Grammar\python.gram;$(PySourcePath)Grammar\Tokens" />
|
|
|
|
<_KeywordOutputs Include="$(PySourcePath)Lib\keyword.py" />
|
2024-01-28 22:48:48 -04:00
|
|
|
<!-- Taken from _Target._compute_digest in Tools\jit\_targets.py: -->
|
|
|
|
<_JITSources Include="$(PySourcePath)Python\executor_cases.c.h;$(GeneratedPyConfigDir)pyconfig.h;$(PySourcePath)Tools\jit\**"/>
|
|
|
|
<_JITOutputs Include="$(GeneratedPyConfigDir)jit_stencils.h"/>
|
2021-04-06 19:54:43 -03:00
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Target Name="_TouchRegenSources" Condition="$(ForceRegen) == 'true'">
|
|
|
|
<Message Text="Touching source files to force regeneration" Importance="high" />
|
2023-08-23 14:39:00 -03:00
|
|
|
<Touch Files="@(_PegenSources);@(_ASTSources);@(_TokenSources);@(_KeywordOutputs)"
|
2021-04-06 19:54:43 -03:00
|
|
|
AlwaysCreate="False" />
|
|
|
|
</Target>
|
|
|
|
|
2021-12-18 09:05:45 -04:00
|
|
|
<Target Name="_RegenPegen"
|
|
|
|
Inputs="@(_PegenSources)" Outputs="@(_PegenOutputs)"
|
|
|
|
DependsOnTargets="FindPythonForBuild">
|
2021-04-06 19:54:43 -03:00
|
|
|
<Message Text="Regenerate @(_PegenOutputs->'%(Filename)%(Extension)',' ')" Importance="high" />
|
|
|
|
<!-- Specify python.gram with POSIX-like path because the argument gets written into the file verbatim -->
|
|
|
|
<Exec Command="set PYTHONPATH=Tools\peg_generator%0D%0A$(PythonForBuild) -m pegen -q c ./Grammar/python.gram Grammar\Tokens -o Parser\parser.c"
|
|
|
|
WorkingDirectory="$(PySourcePath)" />
|
|
|
|
</Target>
|
|
|
|
|
2021-12-18 09:05:45 -04:00
|
|
|
<Target Name="_RegenAST_H"
|
|
|
|
Inputs="@(_ASTSources)" Outputs="@(_ASTOutputs)"
|
|
|
|
DependsOnTargets="FindPythonForBuild">
|
2021-04-06 19:54:43 -03:00
|
|
|
<Message Text="Regenerate @(_ASTOutputs->'%(Filename)%(Extension)',' ')" Importance="high" />
|
|
|
|
<Exec Command="$(PythonForBuild) Parser\asdl_c.py Parser\Python.asdl @(_ASTOutputs->'%(Argument) "%(Identity)"',' ')"
|
|
|
|
WorkingDirectory="$(PySourcePath)" />
|
|
|
|
</Target>
|
|
|
|
|
2021-12-18 09:05:45 -04:00
|
|
|
<Target Name="_RegenTokens"
|
|
|
|
Inputs="@(_TokenSources)" Outputs="@(_TokenOutputs)"
|
|
|
|
DependsOnTargets="FindPythonForBuild">
|
2021-04-06 19:54:43 -03:00
|
|
|
<Message Text="Regenerate @(_TokenOutputs->'%(Filename)%(Extension)',' ')" Importance="high" />
|
2022-10-17 07:01:00 -03:00
|
|
|
<Exec Command="$(PythonForBuild) Tools\build\generate_token.py %(_TokenOutputs.Format) Grammar\Tokens "%(_TokenOutputs.Identity)""
|
2021-04-06 19:54:43 -03:00
|
|
|
WorkingDirectory="$(PySourcePath)" />
|
|
|
|
<Touch Files="@(_TokenOutputs)" />
|
|
|
|
</Target>
|
|
|
|
|
2021-12-18 09:05:45 -04:00
|
|
|
<Target Name="_RegenKeywords"
|
|
|
|
Inputs="@(_KeywordSources)" Outputs="@(_KeywordOutputs)"
|
|
|
|
DependsOnTargets="FindPythonForBuild">
|
2021-07-05 12:18:14 -03:00
|
|
|
<Message Text="Regenerate @(_KeywordOutputs->'%(Filename)%(Extension)',' ')" Importance="high" />
|
2021-04-06 19:54:43 -03:00
|
|
|
<Exec Command="set PYTHONPATH=Tools\peg_generator%0D%0A$(PythonForBuild) -m pegen.keywordgen Grammar\python.gram Grammar\Tokens Lib\keyword.py"
|
|
|
|
WorkingDirectory="$(PySourcePath)" />
|
|
|
|
</Target>
|
2021-07-05 12:18:14 -03:00
|
|
|
|
2022-08-30 14:41:27 -03:00
|
|
|
<Target Name="_RegenGlobalObjects"
|
|
|
|
DependsOnTargets="FindPythonForBuild">
|
|
|
|
<Message Text="Regenerate Global Objects" Importance="high" />
|
2022-10-17 07:01:00 -03:00
|
|
|
<Exec Command="$(PythonForBuild) Tools\build\generate_global_objects.py"
|
2022-08-30 14:41:27 -03:00
|
|
|
WorkingDirectory="$(PySourcePath)" />
|
|
|
|
</Target>
|
2024-01-28 22:48:48 -04:00
|
|
|
|
|
|
|
<Target Name="_RegenJIT"
|
|
|
|
Condition="'$(UseJIT)' == 'true'"
|
|
|
|
DependsOnTargets="_UpdatePyconfig;FindPythonForBuild"
|
|
|
|
Inputs="@(_JITSources)"
|
|
|
|
Outputs="@(_JITOutputs)">
|
|
|
|
<PropertyGroup>
|
|
|
|
<JITArgs Condition="$(Platform) == 'ARM64'">aarch64-pc-windows-msvc</JITArgs>
|
|
|
|
<JITArgs Condition="$(Platform) == 'Win32'">i686-pc-windows-msvc</JITArgs>
|
|
|
|
<JITArgs Condition="$(Platform) == 'x64'">x86_64-pc-windows-msvc</JITArgs>
|
|
|
|
<JITArgs Condition="$(Configuration) == 'Debug'">$(JITArgs) --debug</JITArgs>
|
|
|
|
</PropertyGroup>
|
|
|
|
<Exec Command='$(PythonForBuild) "$(PySourcePath)Tools\jit\build.py" $(JITArgs)'
|
|
|
|
WorkingDirectory="$(GeneratedPyConfigDir)"/>
|
|
|
|
</Target>
|
2022-08-30 14:41:27 -03:00
|
|
|
|
2024-01-28 22:48:48 -04:00
|
|
|
<Target Name="_RegenNoPGUpdate"
|
2021-07-29 16:53:29 -03:00
|
|
|
Condition="$(Configuration) != 'PGUpdate'"
|
2023-08-23 14:39:00 -03:00
|
|
|
DependsOnTargets="_TouchRegenSources;_RegenPegen;_RegenAST_H;_RegenTokens;_RegenKeywords;_RegenGlobalObjects">
|
2024-01-28 22:48:48 -04:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="Regen" DependsOnTargets="_RegenNoPGUpdate;_RegenJIT">
|
2021-04-06 19:54:43 -03:00
|
|
|
<Message Text="Generated sources are up to date" Importance="high" />
|
|
|
|
</Target>
|
2021-07-05 12:18:14 -03:00
|
|
|
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<_TestFrozenSources Include="$(PySourcePath)Programs\freeze_test_frozenmain.py;
|
|
|
|
$(PySourcePath)Programs\test_frozenmain.py;
|
|
|
|
@(_OpcodeOutputs)" />
|
|
|
|
<_TestFrozenOutputs Include="$(PySourcePath)Programs\test_frozenmain.h" />
|
|
|
|
<_LicenseSources Include="$(PySourcePath)LICENSE;
|
|
|
|
$(PySourcePath)PC\crtlicense.txt;
|
|
|
|
$(bz2Dir)LICENSE;
|
|
|
|
$(libffiDir)LICENSE;" />
|
2023-07-12 09:46:30 -03:00
|
|
|
<_LicenseSources Include="$(opensslOutDir)LICENSE.txt" Condition="Exists('$(opensslOutDir)LICENSE.txt')" />
|
|
|
|
<_LicenseSources Include="$(opensslOutDir)LICENSE" Condition="!Exists('$(opensslOutDir)LICENSE.txt')" />
|
2021-07-05 12:18:14 -03:00
|
|
|
<_LicenseSources Include="$(tcltkDir)tcllicense.terms;
|
2023-05-27 14:34:19 -03:00
|
|
|
$(tcltkDir)tklicense.terms" Condition="$(IncludeTkinter)" />
|
2021-07-05 12:18:14 -03:00
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Target Name="_RegenTestFrozenmain" Inputs="@(_TestFrozenSources)" Outputs="@(_TestFrozenOutputs)"
|
2021-08-03 12:52:45 -03:00
|
|
|
Condition="($(Platform) == 'Win32' or $(Platform) == 'x64') and
|
|
|
|
$(Configuration) != 'PGInstrument' and $(Configuration) != 'PGUpdate'">
|
2021-07-05 12:18:14 -03:00
|
|
|
<Message Text="Regenerate @(_TestFrozenOutputs->'%(Filename)%(Extension)', ' ')" Importance="high" />
|
2021-10-05 09:37:43 -03:00
|
|
|
<Exec Command='setlocal
|
|
|
|
set PYTHONPATH=$(PySourcePath)Lib
|
|
|
|
"$(PythonExe)" Programs\freeze_test_frozenmain.py Programs\test_frozenmain.h'
|
2021-07-05 12:18:14 -03:00
|
|
|
WorkingDirectory="$(PySourcePath)" />
|
|
|
|
</Target>
|
|
|
|
|
2021-07-07 14:21:54 -03:00
|
|
|
<Target Name="_RegenLicense">
|
2021-07-05 12:18:14 -03:00
|
|
|
<ItemGroup>
|
2021-07-07 14:21:54 -03:00
|
|
|
<_Text1 Include="@(_LicenseSources)">
|
2021-07-05 12:18:14 -03:00
|
|
|
<Content Condition="Exists(%(FullPath))">$([System.IO.File]::ReadAllText(%(FullPath)))</Content>
|
2021-07-07 14:21:54 -03:00
|
|
|
</_Text1>
|
|
|
|
<_Text Include="@(_Text1->'%(Content)')" />
|
2021-07-05 12:18:14 -03:00
|
|
|
</ItemGroup>
|
|
|
|
|
2021-07-07 14:21:54 -03:00
|
|
|
<WriteLinesToFile File="$(OutDir)LICENSE.txt" Overwrite="true" Lines="@(_Text)" />
|
|
|
|
<Warning Text="License file %(_LicenseSources.FullPath) is missing"
|
|
|
|
Condition="!Exists(@(_LicenseSources))" />
|
|
|
|
<Message Text="Wrote $(OutDir)LICENSE.txt" Importance="high" />
|
2021-07-05 12:18:14 -03:00
|
|
|
</Target>
|
|
|
|
|
2021-08-03 12:52:45 -03:00
|
|
|
<Target Name="PostBuildRegen" DependsOnTargets="_RegenTestFrozenmain;_RegenLicense" />
|
2021-04-06 19:54:43 -03:00
|
|
|
</Project>
|