Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » the automatically generated makefile(how to read the generated makefile)
the automatically generated makefile [message #1412604] Tue, 26 August 2014 15:12 Go to next message
Sequoia Tree is currently offline Sequoia TreeFriend
Messages: 28
Registered: August 2014
Junior Member
I'm doing some exotic linking and compiling with libraries and such in my experiment.

I've used the project configuration where the makefile is automatically written by CDT or something. I've got it to compile a bit but I need to see how it links all the libs from Qt to understand this further.

How can I read the makefile that the Eclipse IDE creates. Where is it?

my code :

//============================================================================
// Name        : Sf1.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include "SfWin.h"

int main() {

	SfWin w;
	w.show();

	return 0;
}

---------------------------------------------------------------
/*
 * SfWin.h
 *
 *  Created on: 26.08.2014
 *      Author: David
 */

#ifndef SFWIN_H_
#define SFWIN_H_

#include <QWidget>

class SfWin : public QWidget {

//	Q_OBJECT

public:
	SfWin();
	virtual ~SfWin();
	void show();
};

#endif /* SFWIN_H_ */

---------------------------------------------------------------
/*
 * SfWin.cpp
 *
 *  Created on: 26.08.2014
 *      Author: 
 */

#include <iostream>
#include "SfWin.h"

using namespace std;

SfWin::SfWin() {
	// TODO Auto-generated constructor stub

}

SfWin::~SfWin() {
	// TODO Auto-generated destructor stub
}

void SfWin::show() {

	std::cout << "SfWin.show()" << std::endl;
}

---------------------------------------------------------------
Re: the automatically generated makefile [message #1412637 is a reply to message #1412604] Tue, 26 August 2014 17:12 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Moving this to the CDT forum group.
Re: the automatically generated makefile [message #1412682 is a reply to message #1412604] Tue, 26 August 2014 20:29 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
David Hall wrote on Tue, 26 August 2014 18:12
I'm doing some exotic linking and compiling with libraries and such in my experiment.

I've used the project configuration where the makefile is automatically written by CDT or something. I've got it to compile a bit but I need to see how it links all the libs from Qt to understand this further.

How can I read the makefile that the Eclipse IDE creates. Where is it?



The makefile is in the build configuration subdirectory
(usually Release or Debug). It is named 'makefile', and it
includes some auxiliary makefiles (*.mk).

The makefiles are explained in the GNU Make manual, which
is available from the GNU software website (The forum did
not allow to post a link, sorry).




--

Tauno Voipio
Re: the automatically generated makefile [message #1412707 is a reply to message #1412682] Tue, 26 August 2014 22:04 Go to previous messageGo to next message
Sequoia Tree is currently offline Sequoia TreeFriend
Messages: 28
Registered: August 2014
Junior Member
This is Eclipse Luna 4.4.0

I created a project 'Ab' using File/New/C-C++ Project/Hello World C++ Project
and a source directory is created as well as a .cproject and .project file.
Under src directory is Ab.cpp where the main() lies.

No makefile.

after a Debug build there is a Debug directory with an exe file and a src directory where
the object file lies. The same happens with a Release build.

No makefile.

Nothing with an extension of ".mk"
Re: the automatically generated makefile [message #1412859 is a reply to message #1412707] Wed, 27 August 2014 08:43 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
I had to create a fresh C project for hello to check (Luna 4.4.0, 20140612-0600).

Here is the Eclipse window before first build:

index.php/fa/18948/0/

Here is the Eclipse window after first debug build:

index.php/fa/18947/0/ Attached are two screen captures:

I just wonder if your setup has some settings gone fishy.


--

Tauno Voipio
Re: the automatically generated makefile [message #1412861 is a reply to message #1412859] Wed, 27 August 2014 08:44 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Sorry, the forum switched the images, please regard as built image first.

--

Tauno Voipio
Re: the automatically generated makefile [message #1412884 is a reply to message #1412861] Wed, 27 August 2014 09:33 Go to previous messageGo to next message
Sequoia Tree is currently offline Sequoia TreeFriend
Messages: 28
Registered: August 2014
Junior Member
Very interesting Tauno.
Here is a shot of my C++ project, after build.

Where can I see a summary of all my preferences? In some kind of .project file??

index.php/fa/18950/0/
Re: the automatically generated makefile [message #1412886 is a reply to message #1412884] Wed, 27 August 2014 09:39 Go to previous messageGo to next message
Sequoia Tree is currently offline Sequoia TreeFriend
Messages: 28
Registered: August 2014
Junior Member
I tried to create a C Hello World project named "Test", just like yours.

This is what I got :

index.php/fa/18951/0/
Re: the automatically generated makefile [message #1412889 is a reply to message #1412884] Wed, 27 August 2014 09:47 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
The workspace preferences are found in Window -> Preferences (Eclipse -> Preferences in OS X).

The project preferences are in Project -> Properties.

It seems to me that you're using cmake instead of GNU make. Out of curiosity, have a look at the cmake subdirectory.


--

Tauno Voipio
Re: the automatically generated makefile [message #1412901 is a reply to message #1412604] Wed, 27 August 2014 10:23 Go to previous messageGo to next message
Klaus km is currently offline Klaus kmFriend
Messages: 142
Registered: November 2011
Senior Member
Hello David,

you must select the "External builder" type to get the makefiles in the project settings:
http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Ftasks%2Fcdt_t_proj_build_set.htm

But to learn make you better should read the make manual:
http://www.gnu.org/software/make/manual/make.html#Introduction


regards,
Klaus


Re: the automatically generated makefile [message #1412990 is a reply to message #1412889] Wed, 27 August 2014 14:13 Go to previous messageGo to next message
Sequoia Tree is currently offline Sequoia TreeFriend
Messages: 28
Registered: August 2014
Junior Member
Thanks Tauno
That whole CMake folder got sucked into the project when I imported the many, many library files from Qt/../lib. I only know a bit about working with MAKE, not CMAKE, XMAKE, YMAKE, or not even QMAKE.

I'll check out those preferences Mr. Klaus, thanks.
Re: the automatically generated makefile [message #1413009 is a reply to message #1412901] Wed, 27 August 2014 14:57 Go to previous messageGo to next message
Sequoia Tree is currently offline Sequoia TreeFriend
Messages: 28
Registered: August 2014
Junior Member
Mr. Klaus I have looked up the links you showed.
As is often the case the help file image you gave the link to
has only a vague similarity to reality.

I am working with Eclipse Luna 4.4.0

This is the menu I have when I select properties from the context menu of my project and select C/C++ Build on the left-hand tree.

In this menu under the tab Builder Settings is the textfield Builder Type. !! It is blocked from entering anything. The two other tabs I have, 'Behaviour' and 'Refresh Policy' are not depicted in the help file image.
It has Internal Builder and no other options.
index.php/fa/18963/0/

The second screen shot is from C/C++ Build/Settings on the left-hand tree.
Here nothing resembles 'Builder Type'
index.php/fa/18964/0/
Re: the automatically generated makefile [message #1413046 is a reply to message #1413009] Wed, 27 August 2014 16:28 Go to previous messageGo to next message
Sequoia Tree is currently offline Sequoia TreeFriend
Messages: 28
Registered: August 2014
Junior Member
Now I find that the only way to have a generated makefile visible is to create a "Makefile Project"

All this time I have been creating an "Executable" project.

So Executable projects don't use makefiles. Is that the way this is??
Re: the automatically generated makefile [message #1413110 is a reply to message #1413046] Wed, 27 August 2014 20:39 Go to previous messageGo to next message
Klaus km is currently offline Klaus kmFriend
Messages: 142
Registered: November 2011
Senior Member
David Hall wrote on Wed, 27 August 2014 18:28
Now I find that the only way to have a generated makefile visible is to create a "Makefile Project"

All this time I have been creating an "Executable" project.

So Executable projects don't use makefiles. Is that the way this is??


You can use "Executable project", but then you must switch the "Current builder" within the properties once (and therefore i forgot that...).

index.php/fa/18980/0/

After changing the setting to "Gnu Make Builder" you can go back to the other dialog and switch the setting between internal and external builder.

Do not ask me why this is necessary, i don't know. CDT settings are tricky Crying or Very Sad

regards
  • Attachment: eclipse.PNG
    (Size: 27.60KB, Downloaded 1689 times)


Re: the automatically generated makefile [message #1413258 is a reply to message #1413046] Thu, 28 August 2014 07:05 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Hello David,

I'm a bit slow - it seems that you are attempting to cut corners compiling a Qt application. The Qt qmake creates the necessary makefiles.

Eclipse has a Qt support module which is installable using the Luna site.


--

Tauno Voipio
Re: the automatically generated makefile [message #1413306 is a reply to message #1413258] Thu, 28 August 2014 08:47 Go to previous messageGo to next message
Sequoia Tree is currently offline Sequoia TreeFriend
Messages: 28
Registered: August 2014
Junior Member
>>I'm a bit slow - it seems that you are attempting to cut corners compiling a Qt application. The Qt qmake creates the necessary makefiles.
>>Eclipse has a Qt support module which is installable using the Luna site.

If cutting corners means trying to find out how something works then you are right on the button.

I want to learn how to use eclipse and one way is to transform my monstrous SpaceFlight project from Java to C++. For that I need to learn how Eclipse does GUI. And I am starting with Qt library QWidgets. True, I could use the Qt Creator IDE to do this, but I would like to finally understand this behemoth Eclipse.

If this Qt Support Module really exists, possibly you could put up a link.

[Updated on: Thu, 28 August 2014 08:58]

Report message to a moderator

Re: the automatically generated makefile [message #1413308 is a reply to message #1413306] Thu, 28 August 2014 08:50 Go to previous messageGo to next message
Sequoia Tree is currently offline Sequoia TreeFriend
Messages: 28
Registered: August 2014
Junior Member
Mr. Klaus, ausgezeichnet.
You solved it for me.
Re: the automatically generated makefile [message #1413809 is a reply to message #1413306] Fri, 29 August 2014 13:22 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
David Hall wrote on Thu, 28 August 2014 11:47

If this Qt Support Module really exists, possibly you could put up a link.


Open your Luna, Help -> Install New Software, select Luna site (download.eclipse.org/releases/luna), Programming Languages -> C/C++ Qt Support.


--

Tauno Voipio
Previous Topic:Custom Tool Chain for IBM Visual Age C/C++
Next Topic:Opening .exe instead of eclipse console
Goto Forum:
  


Current Time: Sun Oct 13 16:56:52 GMT 2024

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

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

Back to the top