Hi Ahmed,
Disclaimer: I'm not an expert on the details of code generation; so for deep questions you can contact MathWorks Tech Support.
A couple points:
1) MathWorks Code generation is great for embedded systems and deployment. 1000's of customers do this every day. The phone in your pocket, the satellite it connects to in orbit, the rocket that put the satellite there, and car or train you rode in today; all of them likely are running MathWorks generated code. The Mars Rover (still running around on Mars) is running MathWorks generated code in an embedded system.
2) You are looking for code generation speed up. Here's an article on this topic: Increase Code Generation Speed
3) One of the methods is to use incremental builds. This is what I was referring to above. When enabled, the code generator looks at your model, see what has changed, and only rebuilds what it needs to. However in the case where you are connecting to NXP hardware, the changes you make may force a larger code rebuild because numerous things have changed in the model (that you may not be able to see directly). There are ways to shortcut and force faster code generation - but for every shortcut, you might also be reducing the performance of the code. Personally, I'd just let the code generation do what it needs to do and have a coffee/tea if it takes a few minutes. If it is a massive issue - open up a help ticket with MathWorks - there might be ways to restructure your model to make code generation more efficient
Cheers,
-Brian