Pre-build step forces rebuild of all files.  How to disable ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pre-build step forces rebuild of all files.  How to disable ?

1,605 Views
RWey
Contributor I

Using CodeWarrior 10.2, I have specified a Pre-build step operations ( calls an utility program ), and it seems having anything specified in this section forces a rebuild of all source files in the project.  Is there any way to stop it from doing this?

 

Thanks,

R. Wey

Labels (1)
0 Kudos
6 Replies

974 Views
CrasyCat
Specialist III

Hello

 

  This is not possible with this version of CodeWarrior.

 

  As far as I know a future release of the tool chain should allow you to specify the pre-build step do not

  have any side effect on the input files. This should prevent the IDE to perform a rebuild all.

 

 Not sure which CodeWarrior MCU release will include this feature.

 

CrasyCat

0 Kudos

974 Views
J2MEJediMaster
Specialist I

By default, when you specify pre-build operations the IDE forces a complete rebuild of the project because it cannot determine if the build require the results of your pre-build or not. That is, if the compiler or linker relies on the results generated by your utility, the build cannot start before the utility program is done. Likewise, what files the did utility affect? One of them? All of them? The IDE has no way of knowing and has to go with the worst case and re-builds the entire project.

 

Having said that, you can have the IDE start the build while the preprocessing stage runs. You can do this by choosing Window > Preferences. Expand the C/C++ item in the list. Select Build (do not expand it). Check the Use parallel build option.

 

Be aware that if you final result relies on the output of that utility, you may wind up with builds that contain stale information. Be very careful enabling this option. It is disabled automatically for a reason.

 

---Tom

0 Kudos

974 Views
RWey
Contributor I

J2MEJediMaster wrote:

By default, when you specify pre-build operations the IDE forces a complete rebuild of the project because it cannot determine if the build require the results of your pre-build or not. That is, if the compiler or linker relies on the results generated by your utility, the build cannot start before the utility program is done. Likewise, what files the did utility affect? One of them? All of them? The IDE has no way of knowing and has to go with the worst case and re-builds the entire project.

 

---Tom


I would think because it's a "prebuild" operation, that by definition the build should NOT start before the prebuild is complete.  Once done,  the files affected by the utility can simply be determined by inspecting their modified date/time.  This is the way makefile dependency has been done for decades.

The order of build operation should be:

 

1) Save all modified files open in the IDE, optionally prompting before saving ( but typically not done ).

2) Execute the prebuild step.  Any utility in this step has the responsibility to save and close any files it modifies.

3) Generate build dependencies.

4) Build the project.

 

This way, the build will consider files modified by the pre-build step, but no more so than files modified by the user within the IDE itself.

0 Kudos

974 Views
Captain
Contributor I

I know I am late to this conversation, but I just ran into this today - very frustrating.

I agree with Robert;  the pre-build step should complete, then the IDE should carry out its normal build process.  It shouldn't care if files were modified by the user or by the pre-build commands.

Does anyone know if this situation has been address since this thread was last updated?

Thanks!

0 Kudos

974 Views
lunminliang
NXP Employee
NXP Employee
0 Kudos

974 Views
yuxiangzhang
Contributor I

Hi

I am also late here, but I agree with Robert and Bruce. CW should not by default assume such behavior, at least it should be open for users to define.

Please let us know when could this be changed? I am using Codewarrior for Starcore Eclipse.

0 Kudos