Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Custom make target in managed project
Custom make target in managed project [message #204042] Fri, 02 November 2007 14:48 Go to next message
Eclipse UserFriend
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 #699275 is a reply to message #204042] Thu, 21 July 2011 04:52 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

I am sorry to resurrect such an old question, but I stumbled upon the same problem. While there are several tutorials over Internet where using "Make targets" with *Standard* Make projects, there isn't any about creating and using Make targets for *Managed* Make projects.

Simple questions:

- are "Make targets" (associated view and so on) supposed to be used with *Managed* Make projects?

- how to create and set-up a Make target for a Managed Make project?

I am using Eclipse Indigo.

Thank you.

Re: Custom make target in managed project [message #699383 is a reply to message #699275] Thu, 21 July 2011 09:24 Go to previous messageGo to next message
Eclipse UserFriend
felix wrote on Thu, 21 July 2011 04:52
Hello,

I am sorry to resurrect such an old question, but I stumbled upon the same problem. While there are several tutorials over Internet where using "Make targets" with *Standard* Make projects, there isn't any about creating and using Make targets for *Managed* Make projects.

Simple questions:

- are "Make targets" (associated view and so on) supposed to be used with *Managed* Make projects?

- how to create and set-up a Make target for a Managed Make project?

I am using Eclipse Indigo.

Thank you.


Make targets don't work if Internal builder is used, there is a bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=304774. Try to change your builder to "External builder" in project properties->C/C++ Build -> tab "Builder Settings".

Andrew
Re: Custom make target in managed project [message #699421 is a reply to message #699383] Thu, 21 July 2011 10:17 Go to previous messageGo to next message
Eclipse UserFriend
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 #699452 is a reply to message #699421] Thu, 21 July 2011 10:55 Go to previous messageGo to next message
Eclipse UserFriend
Make Targets View is not managed by managed build, you can't setup it this way.
What you can do is to add a custom command to run in MTV, or create additional make file which you manage yourself and call its targets using "make -f yours.mk".

Andrew
Re: Custom make target in managed project [message #699454 is a reply to message #699452] Thu, 21 July 2011 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Thank you, Andrew. I think documentation should stress better this issue.

I also think that it would be nice to implement this feature in Eclipse/CDT, simply by allowing to define a Make Target as text code that will be inserted in the Makefiles managed by Eclipse/CDT.

In the meantime, at least Make Targets View should be grayed out or disabled for Managed Makefile projects, because its availability is a bit misleading. Either to enhance it as above (ie. allowing to custom-define the make target), either to disable it.

Mixing Eclipse/CDT managed Makefiles and user-provided Makefiles risks to become clumsy.

Anyway, thank you very much.
Re: Custom make target in managed project [message #892977 is a reply to message #699454] Mon, 02 July 2012 04:21 Go to previous messageGo to next message
Eclipse UserFriend
<Post deleted> Wrong thread.

[Updated on: Mon, 02 July 2012 04:23] by Moderator

Re: Custom make target in managed project [message #1726470 is a reply to message #699454] Mon, 14 March 2016 04:18 Go to previous messageGo to next message
Eclipse UserFriend
I ran into this same problem. and have the same feeling as felix.
Re: Custom make target in managed project [message #1728315 is a reply to message #204042] Fri, 01 April 2016 17:12 Go to previous message
Eclipse UserFriend
I think you can specify your make targets by yourself if you create this file
../makefile.targets
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
makefile.init
and
makefile.defs


Hope this helps,

-Francisco
Previous Topic:Can Commercials Application built on Eclipse IDE C/C++ can be Reverse Engineer?
Next Topic:Adafruit Motor Shield sample code does not work on Eclipse ide
Goto Forum:
  


Current Time: Sat Jun 07 21:26:15 EDT 2025

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

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

Back to the top