KDS: Compile Only Files Changed

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

KDS: Compile Only Files Changed

Jump to solution
4,929 Views
philhale
Contributor IV

Silly question:  What KDS settings need to change to compile only files which have changed?  Each time I compile (not a BUILD ALL) every .C file gets recompiled and this takes a ton of time. I know there is a setting(s) which makes this possible so only files that have changed get re-compiled.

KDS Version is 3.2.0

Thank you in advance.

Phil

Tags (1)
1 Solution
1,220 Views
BlackNight
NXP Employee
NXP Employee

Hi Phil,

have you renamed your project (or someone else did not correctly rename it)? Check the refresh policy (have a read at Eclipse Project ‘Refresh Policy’: Broken Incremental Build with External Make? | MCU on Eclipse ) which is most likely the reason for that problem.

I hope that helps,

Erich

View solution in original post

6 Replies
1,221 Views
BlackNight
NXP Employee
NXP Employee

Hi Phil,

have you renamed your project (or someone else did not correctly rename it)? Check the refresh policy (have a read at Eclipse Project ‘Refresh Policy’: Broken Incremental Build with External Make? | MCU on Eclipse ) which is most likely the reason for that problem.

I hope that helps,

Erich

1,220 Views
philhale
Contributor IV

Erich,

That was exactly the problem! The link explains exactly what was happening. Great article!

Thank you very much!  This was really bugging me!  :smileyhappy:

Phil

0 Kudos
1,220 Views
scottm
Senior Contributor II

If you're going to be doing any real work at all with Kinetis and KDS or MCUXpresso, I really strongly recommend following Erich's blog, and skimming over all of the past posts when you have time!  I have lost count of how many times his posts have covered exactly what I needed to know, plus a bunch of stuff I wouldn't have had time to go find out about on my own.  It's a better source of information than any official NXP outlet.

Scott

0 Kudos
1,221 Views
philhale
Contributor IV

Agree. This is the second problem that Erich has resolved by one of these blogs.

Thank you.

0 Kudos
1,221 Views
scottm
Senior Contributor II

Hi Phil,

I don't use KDS much but it seems to be set up roughly the same as CodeWarrior and MCUXpresso, and it ought to compile only the required files by default.  Go to the project properties, and check the settings under C/C++ Build.  I recommend setting 'Enable parallel build' at least - it's disabled by default, and on my machine it makes a huge improvement in build speed.  Check that the other settings look sane.

Keep in mind that if you edit a .h file that's used by a lot of .c files, all of those .c files are going to get recompiled.  I just checked with a simple KDS 3.2 project that hasn't had any obscure settings tweaked and I verified that editing one .c file results in just that .c file being compiled, plus linking of course:

20:09:11 **** Incremental Build of configuration Debug for project replay ****
make all
Building file: ../Sources/spiflash.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc (...) -c -o "Sources/spiflash.o" "../Sources/spiflash.c"
Finished building: ../Sources/spiflash.c

Building target: replay.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ (...)
Finished building target: replay.elf

See what you're getting on the console.  I'd start by just building the whole thing when it's already built to see what it does, and then change just one .c file and see what changes.  If it's recompiling everything, I'd check the makefile and see what it's trying to do.

Hope that helps,

Scott

0 Kudos
1,221 Views
philhale
Contributor IV

Scott,

Thanks for the quick reply.  I will try the setting you suggest.  Doesn't really matter what I modify, the entire package gets recompiled and we are talking about 70+ files. In fact, I can do a Build All then turn around and do a Debug build and it recompiles everything. Weird.

I will try what you suggest and reply with the results.

Thanks, Scott.

0 Kudos