Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Scanner Discovery for Makefile Project
Scanner Discovery for Makefile Project [message #1852120] Sat, 30 April 2022 05:01 Go to next message
Peter Csaszar is currently offline Peter CsaszarFriend
Messages: 10
Registered: June 2017
Junior Member
Apologies if this is a trivial question with tons of answers, as it seems to be one of the fundamental features of Eclipse, but yet, I haven't been able to figure it out. Here is my case: I have a rather ordinary Makefile project that is built using a build script, by simply running "build.sh <target>". My understanding is that by entering this command somewhere in Eclipse and pushing a button, the indexer will discover all include files that apply (but not a single file more), so it will know exactly where to look for the different macro / variable / etc. definitions, and that's the end of the story. Is my understanding correct? If yes, can I see some step-by-step instructions as to how to achieve the above? Thanks in advance!
Re: Scanner Discovery for Makefile Project [message #1852129 is a reply to message #1852120] Sun, 01 May 2022 14:37 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 739
Registered: August 2014
Senior Member
This is not an ordinary Makefile project if it needs other than 'make <target>' to run the build process.

The indexer has no way of diving into your build shell script. All the necessary details are hidden inside it.

Another thing is if you're cross-compiling (targeting another machine than the one your Eclipse is running on). Even this is doable, but you have to introduce the toolkit and necessary directories to the project set-up.


--

Tauno Voipio
Re: Scanner Discovery for Makefile Project [message #1852150 is a reply to message #1852129] Mon, 02 May 2022 18:04 Go to previous messageGo to next message
Peter Csaszar is currently offline Peter CsaszarFriend
Messages: 10
Registered: June 2017
Junior Member
Thanks Tauno! So I thought the big idea behind the scanner mechanism was that the build output parser devours the output generated by the compiler and figures out the actual include file path that way, regardless of how the build process is being administered.

But with all that said, I just took a closer look at our build process and realized that it consists of hierarchical "make" calls, resulting in different include file paths for the different subdirectories - I don't believe Eclipse is prepared to deal with this scenario. (If it is, I would like to learn about it!) What ended up working quite well for me though is that in Path & Symbols > Source Location, I created a filter to exclude all the subdirectories that don't apply in a given configuration (because they're for a different target), so there are no more [apparent] ambiguities that would confuse the indexer, and the references are resolved successfully.
Re: Scanner Discovery for Makefile Project [message #1852153 is a reply to message #1852150] Mon, 02 May 2022 19:22 Go to previous messageGo to next message
Peter Csaszar is currently offline Peter CsaszarFriend
Messages: 10
Registered: June 2017
Junior Member
BTW, it looks like I spoke too soon. While the above seems to be working by-and-large, there are still cases, where Eclipse is confused, and a reference is found in a header file that is explicitly excluded by the filter. Even more sadly, I haven't been able to find a good workaround for this - rebuilding the index, closing & reopening the project or closing & reopening the app did not help. (I'm not too keen on deleting & re-creating the project.) This is on the 2021-03 (4.19.0) Linux edition - not sure if this has been fixed already.
Re: Scanner Discovery for Makefile Project [message #1853481 is a reply to message #1852153] Mon, 04 July 2022 14:03 Go to previous message
tepalia02 02 is currently offline tepalia02 02Friend
Messages: 20
Registered: April 2022
Junior Member
Hi, have you fixed the problem?
Previous Topic:Missing wiringpi lib
Next Topic:Multiple CDT embedded targets
Goto Forum:
  


Current Time: Tue Jan 31 11:39:14 GMT 2023

Powered by FUDForum. Page generated in 0.01868 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top