Why does CW 10.4 attempt to compile a .c file not in source directory

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

Why does CW 10.4 attempt to compile a .c file not in source directory

2,677 Views
leonmcnutt
Contributor I


I have a construction file that just happens to have an .c extenstion which I #include in my source .c file. My source units compile correctly, however the IDE  attempts to compile my construction file too which stops the build.  I changed the extension of the construction file (.cw2) and I get my static library built. Why  is the IDE attempting to build with .c files outside of the source directory?

Labels (1)
0 Kudos
Reply
3 Replies

2,583 Views
stanish
NXP Employee
NXP Employee

Hello Leon,

The automatic CodeWarrior Makefile generator uses all the files with source file extension within project directory to build regardless of sub-folder where a file is placed.

So if your .c file you are including is not placed completely outside the project directory it will be compiled by default.

However you can explicitly exclude the file from build to avoid compilation of the file. (Click Right on the file -> "Resource Configuration" -> "Exclude from Build..." )

Make sure the include path  to the file is set in the compiler input settings/ Includes path settings.

Stanislav

0 Kudos
Reply

2,582 Views
leonmcnutt
Contributor I

Stanislav,

Thanks for the help!

0 Kudos
Reply

2,582 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

don't quite understand your situation. can you please upload your project to showcase the problem?

0 Kudos
Reply