Custom make target in managed project [message #204042] |
Fri, 02 November 2007 14:48  |
Eclipse User |
|
|
|
Originally posted by: tamirh.gmail.com
What I want to do now is along with building an executable, also build a
library (ar rc file1.o file2.o ...) Either by having it do it at the same
time as make all, or have a separate target called like make lib
I've created a managed make C project and the executable is building fine.
Now I try to go to the make target pane and add a new make target, but
it's all greyed out. Is there any way to add a custom make target to the
managed make project? Or can I change the make all target somehow to have
it create the library along with the executable?
Or is the only way to go about doing this by changing the project to be a
standard make project?
Thanks,
Tamir
|
|
|
|
|
Re: Custom make target in managed project [message #699421 is a reply to message #699383] |
Thu, 21 July 2011 10:17   |
Eclipse User |
|
|
|
Thank you, Andrew.
However, I am already using the external builder, except that it works with Makefiles that are managed (i.e. written automatically) by Eclipse/CDT.
Unmanaged (aka "standard") Makefiles are provided by the user, so he can add Make Targets for those Makefiles.
The procedure for creating a Make Target is simple, see here: h t t p ://help . eclipse . org/galileo/index.jsp?topic=/org.eclipse.cdt.doc.user/tasks/cdt_t_addmaketarget.htm
However, to "make" that Make Target you need to manually modify the Makefile and to add the target inside (along with required commands).
This is doable in Makefiles that are written by the user. The changes are persistent and all modifications to the Makefile are delegated to the user.
However, how to set up Make targets in Makefiles that are automatically rewritten (ie. managed) by Eclipse/CDT? Changes into those Makefiles are supposed to be made by Eclipse/CDT. Any user modification is subject to re-writing by Eclipse/CDT.
I expect that Eclipse/CDT will also manage Make Targets created into Make Targets View.
However, there is no procedure to define a Make Target besides creating it into the Make Targets View. And, then, when trying to build it, the make program does not find this target, which is true since Eclipse/CDT apparently does not write the Make Target into the Makefiles.
So, are the Make Targets available for (Eclipse/CDT) managed Makefiles or no? If yes, how to set it up?
The thread that I resurrected was the only one appearing through Google and tackling at this problem.
Thanks again.
|
|
|
|
|
|
|
Re: Custom make target in managed project [message #1728315 is a reply to message #204042] |
Fri, 01 April 2016 17:12  |
Eclipse User |
|
|
|
I think you can specify your make targets by yourself if you create this file which you would manage yourself and will get included in the managed (autogenerated) makefile.
As you can see, the autogenerated makefile has this include:
-include ../makefile.targets
So, you can write your custom targets and they will be included in the autogenerated makefile
At least, that's how I'm doing it with my C++ managed projects. There are also some other includes like and
Hope this helps,
-Francisco
|
|
|
Powered by
FUDForum. Page generated in 0.46574 seconds