In Simulink Coder, the choice of solver and its configuration settings are typically embedded in the generated code to ensure that the simulation behavior is accurately represented in the generated executable or code.
As you want to generate code without the solver being hard-coded into it, you can consider using the "Fixed-Step" solver option and manually remove the solver related components.
The fixed-step solvers use a predetermined step size, eliminating the need to include solver-related code in the generated code.
Another option is to use the embedded coder, which means to use "ert.tlc" as the target.
You can follow this link to Generate code using Embedded Coder
Also make sure to turn off MAT-File Logging, you will see that there will be a main driver c file which calls the step function from model.c infinitely.