Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Makefile(How to create the makefile?)
Makefile [message #1784093] Thu, 22 March 2018 12:47 Go to next message
Elena Tagliabracci is currently offline Elena TagliabracciFriend
Messages: 2
Registered: March 2018
Junior Member
I've just downloaded Eclipse and added the compiler.
Now I need to add the makefile but I didn't understand if I have to write it (and in that case how I do it?) or if I can download something that does it automatically for me.
Re: Makefile [message #1784150 is a reply to message #1784093] Thu, 22 March 2018 23:58 Go to previous messageGo to next message
Seth Nowlin is currently offline Seth NowlinFriend
Messages: 30
Registered: October 2017
Location: Louisiana
Member
Hello,

Sometimes the CDT makes the makefile for you. See here: https://help.eclipse.org/oxygen/index.jsp. Oh and to start reading the extensive doc. on Eclipse, look for the CDT or C/C++ Development section in the index to the left. Building would be your subject. It has a bunch of makefile stuff in it.

Seth
Re: Makefile [message #1784157 is a reply to message #1784150] Fri, 23 March 2018 01:48 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
In addition to what Seth has told you,
Create a C or C++ HelloWorld project for an example.
The makefiles will be in the <project>/Debug and <project>/Release directories.
Your source should be placed in the <project>/src directory.
---
Writing a makefile is not particularly hard but it isn't trivial either.
How to write one is generally off-topic for this forum.
Search for "using make" and "gnu make tutorial".
The GNU make manual: https://www.gnu.org/software/make/manual/make.html

Re: Makefile [message #1784208 is a reply to message #1784157] Fri, 23 March 2018 14:05 Go to previous messageGo to next message
Elena Tagliabracci is currently offline Elena TagliabracciFriend
Messages: 2
Registered: March 2018
Junior Member
I'm quite new to C++ and other languages in general and it's quite confusing, I have a basic idea on how to write a makefile but if I can avoid i'd be happier.
I have Eclipse already installed in my laptop, however someone else set it up for me but I remembered that he installed 'cmake'.
Have you heard of it? And in that case do you know if it serves my purpose?
Re: Makefile [message #1784240 is a reply to message #1784208] Sat, 24 March 2018 08:55 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Eclipse CDT was designed to use the GCC tool chain which uses make.
Using something else will just increase your workload.

There are a coupe of plugins in the Marketplace for cmake.
Also, there is this: https://www.eclipse.org/forums/index.php?t=msg&th=1086492&goto=1765018&#msg_1765018
Or search for "eclipse cdt cmake".

As has been pointed out, Eclipse will generate a makefile for you.
Just create an HelloWorld project and
replace everything in the <project>/src directory with your own source.
Doesn't get much easier than that.

[Updated on: Sat, 24 March 2018 09:01]

Report message to a moderator

Re: Makefile [message #1784266 is a reply to message #1784240] Sun, 25 March 2018 20:05 Go to previous messageGo to next message
Seth Nowlin is currently offline Seth NowlinFriend
Messages: 30
Registered: October 2017
Location: Louisiana
Member
Hello Mr. David,

Seth here. Thank you for the link to "make" on gnu.org.

Seth

P.S. I needed to read up more on it, too.
Re: Makefile [message #1785049 is a reply to message #1784208] Sun, 08 April 2018 17:32 Go to previous message
sydney faria is currently offline sydney fariaFriend
Messages: 54
Registered: March 2013
Member
Creating a c or c++ project will automatically create a makefile for the project. I've done this several times. Just look in the debug directory and you will find it.
Previous Topic:"Pascal Plugin for Eclipse" from sourceforge.net
Next Topic:warning - implicit
Goto Forum:
  


Current Time: Thu Mar 28 18:19:14 GMT 2024

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

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

Back to the top