You are probably not working on this anymore but you should have your code generation target simply append a non-existent file to the CustomAdditionalCompileInputs item. For instance
<Target Name="RegenCode">
<Message Text="RegenCode Called" Importance="high"/>
<ItemGroup>
<CustomAdditionalCompileInputs Include="non-existent file"/>
</ItemGroup>
</Target>
Then if you call the targets RegenCode;Build it make sure that the CoreCompile target is never skipped.
My Book:
Inside the Microsoft Build Engine: Using MSBuild and Team Foundation Build
My Blog:
sedodream.com
Visual C# MVP