Pass selected file to Make target [message #1737820] |
Wed, 13 July 2016 09:28 |
Arno Moonen Messages: 4 Registered: July 2016 |
Junior Member |
|
|
At the company I'm currently working for, several IDEs are being used (they develop firmware for different embedded platforms). All their C projects use a Makefile, so we decided to also add rules to their default Makefile to run static code analysis tools.
One of the IDEs they use is Eclipse. Here we have added additional targets to the Make Target view, that triggers the lint target from the Makefile, for example. Since we use multiple IDEs we can tell the tools called by the Makefile to generate specific output for the IDE being used. For Eclipse we do this by adjusting the Build Command and adding something like IDE_ENV=eclipse to the end. This works just fine.
Recently one of the engineers mentioned that it would be really helpful if he could run the tools, as defined in the Makefile, for a single file. So, I updated the Makefile and it now accepts a variable SOURCE_FILE with the path of the file that needs to be checked.
In Eclipse I tried adding SOURCE_FILE=${selected_resource_loc} and just SOURCE_FILE=${resource_loc}, but these variable do not seem to work when running a Make Target. I also tried to use $(selected_resource_loc) and $(resource_loc) directly in the Makefile, but without any luck.
Can somebody tell me how I can pass the current selected file to Make when running a target from the Make Target view?
PS: I've also asked this question on StackOverflow (can not add the link yet since this is my first post), but no answers have been posted yet, which gives me the feeling that it might not be possible currently.
|
|
|
|
|
|
Re: Pass selected file to Make target [message #1738205 is a reply to message #1738201] |
Mon, 18 July 2016 06:46 |
Arno Moonen Messages: 4 Registered: July 2016 |
Junior Member |
|
|
I just tried your suggestion and it is definitely a step in the right direction.
I see that the value is passed along to Make just fine, however Make seems to be executed in the installation path of Eclipse (or LPCxpresso in my case), instead of the project folder.
Update: both project_loc and project_name appear to be empty.
Adding -f C:\absolute\path\to\Makefile works, but isn't very clean.
[Updated on: Mon, 18 July 2016 06:48] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03645 seconds