Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » ${resource_name} is empty in make target
${resource_name} is empty in make target [message #1708522] Thu, 17 September 2015 05:50 Go to next message
Eclipse UserFriend
Hi,

I'm trying to get some content-aware builds for my test harness (Ceedling/Unity/CMock). I have added a new target with the following configuration:

Target name: test:this
Make target: test:${resource_name}
Build command: rake

Now, when I build the target I get rake test: and not the expected rake test:MyFile

What am I missing?
The file is in my project viewer, located at src/MyFile.h.

OS: OSX
Eclipse: Eclipse IDE for C/C++ Developers, Version: Mars Release (4.5.0), Build id: 20150621-1200

Thanks in advance for any help!

Edit: Formatting.

[Updated on: Sat, 19 September 2015 03:22] by Moderator

Re: ${resource_name} is empty in make target [message #1708560 is a reply to message #1708522] Thu, 17 September 2015 09:04 Go to previous messageGo to next message
Eclipse UserFriend
Moving this to the CDT forum.
Re: ${resource_name} is empty in make target [message #1708704 is a reply to message #1708560] Fri, 18 September 2015 23:16 Go to previous messageGo to next message
Eclipse UserFriend
You may be asking in the wrong place as the Project setup for these is rather specific to Unity, etc.

This link may be relevant
http://throwtheswitch.squarespace.com/white-papers/using-eclipse-ide.html

There are a number of links (mostly old ones) that pop up when Googling unity eclipse that you may find useful.


Re: ${resource_name} is empty in make target [message #1708711 is a reply to message #1708704] Sat, 19 September 2015 03:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Thank you for your reply. I do not think this is related to Unity. I did follow the link you supplied and Ceedling is working fine. I can make a new target called test:all and this will run all tests. The issue is I want to edit a file and then only run that files test. This would work if I could get Eclipse to insert the resource's name into the make target, but it only gives me blanks, so Ceedling does not know what to test. I can edit the target and replace ${resource_name} with the name of the file I'm currently editing, but then I would either have one target per module (lots of targets) or I would need to constantly edit the target.

Why does Eclipse not insert ${resource_name}?
Re: ${resource_name} is empty in make target [message #1708719 is a reply to message #1708711] Sat, 19 September 2015 06:03 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Quote:
Why does Eclipse not insert ${resource_name}?


because it's not implemented yet or because it's a bug?

I found this in Bugzilla:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=227591
https://bugs.eclipse.org/bugs/show_bug.cgi?id=446176

Maybe you have the skills to help Eclipse to implement this feature?

regard,
Klaus
Re: ${resource_name} is empty in make target [message #1708728 is a reply to message #1708711] Sat, 19 September 2015 08:42 Go to previous messageGo to next message
Eclipse UserFriend
Maybe because ${resource_name} isn't defined?
Try using ${selected_resource_name} instead. I created a build target with that and the name of the current file is passed to the build command,

You can view the available variables with Project ==> Properties ==> C/C++ Build ==> Build Variables

set Show System Variables at the bottom of the list box. You will need to "edit" dynamic variables to see the current value
Re: ${resource_name} is empty in make target [message #1708744 is a reply to message #1708728] Sat, 19 September 2015 16:45 Go to previous message
Eclipse UserFriend
I must have been reading some old manual. Thanks for the info about build variables and showing system variables. Found the selected_resource_name there and it works!

Only thing to be aware of is that it won't work unless you actually right-click the resource and select Rebuild Last Target (just building won't work in my case, since this will run the actual target build - not the test build) or hit F9. And selecting and and hitting the target in the Make Target window won't work, because it is not the selected resource anymore.

Many thanks! Smile
Previous Topic:Console output cannot link to the source files (remote build using synchronized project)
Next Topic:Debugging Matlab Mex Files with Eclipse+CDT
Goto Forum:
  


Current Time: Tue Apr 22 19:48:42 EDT 2025

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

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

Back to the top