Eclipse CDT and Make interaction [message #757130] |
Wed, 16 November 2011 15:59 |
Mario Messages: 1 Registered: November 2011 |
Junior Member |
|
|
Hello guys,
I have created a C project that uses an external make file that I created to compile my code. The make file always works as expected, generating dependencies, object files, and linking appropriately. We use eclipse CDT to edit our code base and to compile using this make file. The results are output to the console provided by eclipse and from there we can simply double click and go to the warning or error in the code using the IDE.
The problem is that our make file whenever some new line is added like below for conditional compilation, then the time it takes eclipse to compile becomes really slow. Each C file is compiled at a very slow rate. Also, if an error is detected while compiling any C file, the IDE will not stop there (even though the option is checked) and will simply continue compiling and even tries to link.
# Disable optimizations if we are debugging.
ifeq ($(MAKECMDGOALS), debug)
OPTIONS := -fpack-struct
endif
The interesting thing is that if I manually run the same make file from the linux console, everything works as expected. The makefile stops when an error is detected and it compiles everything really fast. That is why I think the problem is in the interaction between make and eclipse.
Through trial an error, I discovered that it seems that the error goes away if more lines are added or removed from the make file. For example, If I was to change the code from above to the following and leave the rest of the make file the same, then eclipse compiles everything as it should really fast.
# Disable optimizations if we are debugging.
ifeq ($(MAKECMDGOALS), debug)
OPTIONS := -fno-guess-branch-probability -freorder-blocks -freorder-functions \
-fpack-struct
endif
I wish I could post the code but it is proprietary and I cannot do so.
Note that I use a series of crosscompilers from inside the make file rather than the standard GDB. I don't think this has anything to do with it, but I figure I would mention it.
Any help or ideas as to where the problem could be will be really appreciated.
See versions below:
Eclipse IDE for C/C++ Developers
Version: Helios Service Release 2
Build id: 20110301-1815
make --version
GNU Make 3.80
[Updated on: Wed, 16 November 2011 16:00] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03344 seconds