# Generating intermediate assembly files during compilation

**URL:** https://discourse.cmake.org/t/generating-intermediate-assembly-files-during-compilation/12867
**Category:** Code
**Created:** [October 30, 2024, 7:30pm UTC](https://discourse.cmake.org/t/generating-intermediate-assembly-files-during-compilation/12867 "2024-10-30T19:30:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![reimu](https://discourse.cmake.org/user_avatar/discourse.cmake.org/reimu/32/5063_2.png) [@reimu](https://discourse.cmake.org/u/reimu)
#### Post date: [October 30, 2024, 7:30pm UTC](https://discourse.cmake.org/t/generating-intermediate-assembly-files-during-compilation/12867/1 "2024-10-30T19:30:50Z")

</div>

Hi,

I want to make CMake generate intermediate assembly files for my C/C++ source code files and assemble them into object files in two distinct steps, and I want to know the most correct way of doing this.

If this requires platform-specific magic, I only need to make this work on Linux and with GNU toolchain.

In case anyone want to know the reason, it is because I want to patch these assembly files with an external program.

Thanks.
