how to stop pre-build step compiling whole CW project?

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

how to stop pre-build step compiling whole CW project?

Jump to solution
1,391 Views
yuxiangzhang
Contributor I

hi

 

Could someone use pre-build steps in Codewarrior?

We want to add some *TOUCH* commands and so that some *.c file which contains the version information and compile time could be always recompiled, and so each new binary image could be kept with correct build information.

 

But see attached file, when I just put an "dir" in the pre-build, EVERY source files in the whole CW will be recompiled! This is really awful, and we don't expect such behavior from Codewarrior.

 

could someone help me on how to override this problem?

Labels (1)
0 Kudos
1 Solution
720 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hello,

Please try this way:

#1: remove any references from the pre-build commands;

#2: go to project properties at Builder settings and change the build command like below. Please note that the bat file must be the fist argument.

Step1.png

#3: Edit the test.bat file to contain make file like commands. E.g.:

@echo This is a test

@dir

@cmd /c "%*"

@exit

This way the CW should not recompile each file within the project each time you execute a build command.

In this particular case the second time you click on build the console should display something like this:

D:\CW\CW_SC_v10.5.0\test.bat D:\CW\CW_SC_v10.5.0\eclipse/../gnu/bin/mingw32-make.exe -j8 all

This is a test

Volume in drive D is Secondary

Volume Serial Number is FAE4-32EF

Directory of D:\CW\CW_SC_v10.5.0\WCDMA\qert\SDOS_Debug_HW

07/08/2013  03:14 PM    <DIR>          .

07/08/2013  03:14 PM    <DIR>          ..

07/08/2013  03:14 PM           729,645 basic_demo_demo_dbg.map

... info removed by myself ...

              17 File(s)     14,552,831 bytes

               5 Dir(s)  197,772,849,152 bytes free

mingw32-make.exe: Nothing to be done for `all'.

As can be seen in this case the maker return: mingw32-make.exe: Nothing to be done for `all'. If a file is touched only that one will be compiled.

For your reference i used the CW10.5.0

Hope it helps!

Daniel

View solution in original post

0 Kudos
1 Reply
721 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hello,

Please try this way:

#1: remove any references from the pre-build commands;

#2: go to project properties at Builder settings and change the build command like below. Please note that the bat file must be the fist argument.

Step1.png

#3: Edit the test.bat file to contain make file like commands. E.g.:

@echo This is a test

@dir

@cmd /c "%*"

@exit

This way the CW should not recompile each file within the project each time you execute a build command.

In this particular case the second time you click on build the console should display something like this:

D:\CW\CW_SC_v10.5.0\test.bat D:\CW\CW_SC_v10.5.0\eclipse/../gnu/bin/mingw32-make.exe -j8 all

This is a test

Volume in drive D is Secondary

Volume Serial Number is FAE4-32EF

Directory of D:\CW\CW_SC_v10.5.0\WCDMA\qert\SDOS_Debug_HW

07/08/2013  03:14 PM    <DIR>          .

07/08/2013  03:14 PM    <DIR>          ..

07/08/2013  03:14 PM           729,645 basic_demo_demo_dbg.map

... info removed by myself ...

              17 File(s)     14,552,831 bytes

               5 Dir(s)  197,772,849,152 bytes free

mingw32-make.exe: Nothing to be done for `all'.

As can be seen in this case the maker return: mingw32-make.exe: Nothing to be done for `all'. If a file is touched only that one will be compiled.

For your reference i used the CW10.5.0

Hope it helps!

Daniel

0 Kudos