Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » link variable from Makefile
link variable from Makefile [message #643401] Mon, 06 December 2010 18:27 Go to next message
Gabriele  is currently offline Gabriele
Messages: 5
Registered: December 2010
Junior Member
Hello!
I'd like build a project with an existing makefile.

the makefile is below:


#########################################################
#  THIS MAKEFILE IS GENERATED BY THE CONFIGURE SCRIPT!  #
#     add Includes/Libraries in the configure file      #
#########################################################


include /media/Dati/WORKHOME2/repos/make/make.def

SRCS = testgabordescriptor_b.cpp testgabordescriptor_c.cpp 

#INCLUDES = -I$(CSCSRV)/include $(CSCLIBSINC) $(OPENCVINC) $(XMLPLUSPLUSINC)
INCLUDES = $(CSCLIBSINC) $(OPENCVINC) $(XMLPLUSPLUSINC)
LIBS     = $(CSCLIBSLIB) -lcscframe -lcsccluster -lcscdatamanagement -lcscdatatype -lcscdisplay -lcscimage -lcscsearch -lcscsegment -lcscregiondetector -lcscregiondescriptor -lpthread

BINS = ${SRCS:%.cpp=%}

binaries: $(BINS)

% : %.cpp
	$(CPPCMD) $(LDFLAGS) $(CPPFLAGS) $(INCLUDES) -o $@ $< $(LIBS)

clean:
	rm -f *.o *% *~ .depends* core $(BINS)

cleaner: clean
	rm -f Makefile



As you can seen in the makefile some variables (like $(CSCSRV)) are called. They are set in the file included in the first line. in order to have an idea the make.def file is:
#
# make.def:
#
# global definitions and rules to be included by all makefiles
#

SHELL     = /bin/bash

# global compile options

LIBSUFFIX = .so

LDCMD = g++
#LDCMD = icpc

CPPCMD = g++
#CPPCMD = icpc


CPPFLAGS += -Wall -pipe -O0 -ggdb -fno-strict-aliasing -fPIC

LDFLAGS  +=$(CPPFLAGS)
LDLIBFLAGS += $(LDFLAGS) -shared -fpics


#######################
# 3rd party libraries #
#######################

# GSL (GNU Scientific Library)
GSLINC = -I$(USERINSTALLEDLIB)/gsl/include
GSLLIB = -L$(USERINSTALLEDLIB)/gsl/lib -lgsl -lgslcblas -lm

# CommonC++ (for multithreading and socket communication)
CCPPINC = `pkg-config --cflags libccgnu2`
CCPPLIB = `pkg-config --libs libccgnu2`


# OpenCV
# For quad.csc.uni-frankfurt.de
OPENCVINC = -I/usr/local/include/opencv 
OPENCVLIB = -L/usr/local/lib -lml -lcvaux -lhighgui -lcv -lcxcore  


# Approximate Nearest Neighbor search library (http://www.cs.umd.edu/~mount/ANN/)
ANNINC = -I$(USERINSTALLEDLIB)/ann/include/ANN
ANNLIB = -L$(USERINSTALLEDLIB)/ann/lib -lANN

# XML++

XMLPLUSPLUSINC = -I$(USERINSTALLEDLIB)/libxml++/include -I$(USERINSTALLEDLIB)/libxml++/include/libxml++-2.6 -I$(USERINSTALLEDLIB)/libxml++/lib/libxml++-2.6/include -I$(USERINSTALLEDLIB)/libxml2/include/libxml2/libxml -I$(USERINSTALLEDLIB)/glibmm/include/glibmm-2.4 -I$(USERINSTALLEDLIB)/glibmm/include/glibmm-2.4/glibmm -I$(USERINSTALLEDLIB)/glibmm/include/glibmm-2.4/glibmm/private -I$(USERINSTALLEDLIB)/glibmm/lib/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I$(USERINSTALLEDLIB)/glib/include/glib-2.0 -I$(USERINSTALLEDLIB)/glib/include/glib-2.0/glib -I$(USERINSTALLEDLIB)/glib/include/glib-2.0/gobject -I$(USERINSTALLEDLIB)/glib/include/glib-2.0/gio -I$(USERINSTALLEDLIB)/glib/lib/glib-2.0/include

XMLPLUSPLUSLIB = -L$(USERINSTALLEDLIB)/libxml++/lib -lxml++-2.6 -L$(USERINSTALLEDLIB)/libxml2/lib -lxml2 -L/usr/lib/ -lz -lm -L$(USERINSTALLEDLIB)/glibmm/lib -lglibmm-2.4 -L$(USERINSTALLEDLIB)/glib/lib -lgobject-2.0 -lsigc-2.0 -lglib-2.0




# For libdc1394 version 2.0.1
# For my workstation
DC1394V2INC = -I$(USERINSTALLEDLIB)/libdc1394/include/dc1394 -I$(USERINSTALLEDLIB)/libraw1394/include/libraw1394
DC1394V2LIB = -L$(USERINSTALLEDLIB)/libdc1394/lib -ldc1394 -L$(USERINSTALLEDLIB)/libraw1394/lib -lraw1394 


# FLTK
FLTKINC = `fltk-config --cxxflags`
FLTKLIB = `fltk-config --ldflags` `fltk-config --libs`




CSCLIBSINCDIR = $(SOURCEHOME)/lib
CSCLIBSLIBDIR = $(TARGETHOME)/lib
CSCLIBSLIB = -L$(CSCLIBSLIBDIR)
CSCLIBSINC = -I$(CSCLIBSINCDIR)/cscframe \
	-I$(CSCLIBSINCDIR)/cscdatatype \
	-I$(CSCLIBSINCDIR)/cscdatamanagement \
	-I$(CSCLIBSINCDIR)/cscregiondetector \
	-I$(CSCLIBSINCDIR)/cscregiondescriptor \
	-I$(CSCLIBSINCDIR)/cscsegment \
	-I$(CSCLIBSINCDIR)/cscimage \
	-I$(CSCLIBSINCDIR)/csccamera \
	-I$(CSCLIBSINCDIR)/csccluster \
	-I$(CSCLIBSINCDIR)/cscdisplay \
	-I$(CSCLIBSINCDIR)/cscrecog \
	-I$(CSCLIBSINCDIR)/cscsearch \
	-I$(CSCLIBSINCDIR)/csctracking \
	-I$(CSCLIBSINCDIR)/cscgazefollowing



It uses other environment variable set in a baschrc file:

export WORKHOME=/media/Dati/WORKHOME2
export SOURCEHOME=/media/Dati/WORKHOME2/repos
export TARGETHOME=/media/Dati/WORKHOME2/repos
export USERINSTALLEDLIB=/media/Dati/WORKHOME/3rdparty


How can I link all these stuff?
I have the makefile in the project root folder.
When I try to build the project I receive no rule to make target 'all'.

Please help me!
cheers
gabbo
Re: link variable from Makefile [message #643527 is a reply to message #643401] Tue, 07 December 2010 09:36 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1952
Registered: July 2009
Senior Member
Quote:
When I try to build the project I receive no rule to make target 'all'.

Well, your makefile has indeed no target "all". You should either add the target "all" to your makefile or change the target in Eclipse. Project Properties->C/C++Build go to the tab "Behavior" and change "Build (Incremental build)" from "all" to "binaries" (I guess this is the make target you are actually using).


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: link variable from Makefile [message #643535 is a reply to message #643527] Tue, 07 December 2010 10:04 Go to previous messageGo to next message
Gabriele  is currently offline Gabriele
Messages: 5
Registered: December 2010
Junior Member
hello Axel,

I'm sorry but it doesn't work!
I tried putting the environment variables setting directly in the makefile but it doesn't work too.
#########################################################
#  THIS MAKEFILE IS GENERATED BY THE CONFIGURE SCRIPT!  #
#     add Includes/Libraries in the configure file      #
#########################################################

export WORKHOME=/media/Dati/WORKHOME2
export SOURCEHOME=/media/Dati/WORKHOME2/repos
export TARGETHOME=/media/Dati/WORKHOME2/repos
export USERINSTALLEDLIB=/media/Dati/WORKHOME/3rdparty


include $(SOURCEHOME)/make/make.def

SRCS = testgabordescriptor_b.cpp testgabordescriptor_c.cpp 

#INCLUDES = -I$(CSCSRV)/include $(CSCLIBSINC) $(OPENCVINC) $(XMLPLUSPLUSINC)
INCLUDES = $(CSCLIBSINC) $(OPENCVINC) $(XMLPLUSPLUSINC)
LIBS     = $(CSCLIBSLIB) -lcscframe -lcsccluster -lcscdatamanagement -lcscdatatype -lcscdisplay -lcscimage -lcscsearch -lcscsegment -lcscregiondetector -lcscregiondescriptor -lpthread

BINS = ${SRCS:%.cpp=%}

binaries: $(BINS)

% : %.cpp
	$(CPPCMD) $(LDFLAGS) $(CPPFLAGS) $(INCLUDES) -o $@ $< $(LIBS)

clean:
	rm -f *.o *% *~ .depends* core $(BINS)

cleaner: clean
	rm -f Makefile



for the other question? I mean...are the various (makefile, make.def, bashrc) file connected?

thank you
Gabriele
Re: link variable from Makefile [message #643677 is a reply to message #643535] Tue, 07 December 2010 19:54 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1952
Registered: July 2009
Senior Member
You can put the environment variables into Eclipse. Project Properties->C/C++ Build->Environment.
Did you change the "Build (Incremental build)" from "all" to "binaries" as I advised in my last comment?
When you build the project from Eclipse it will execute then the command
make binaries
. This will call your Makefile which will include make.def.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: link variable from Makefile [message #644443 is a reply to message #643677] Sat, 11 December 2010 11:36 Go to previous messageGo to next message
Gabriele  is currently offline Gabriele
Messages: 5
Registered: December 2010
Junior Member
Hello Alex,

I tried but it doesn't work!! Sad
could you have a look at this please?

http://www.eclipse.org/forums/index.php?t=msg&th=201414& amp;start=0&S=62991d9d14260fd630a0b164edba57b4

this is my configuration of the files.....

please I really will appreciate your help!

thanks
Gabriele
Re: link variable from Makefile [message #644602 is a reply to message #644443] Mon, 13 December 2010 12:52 Go to previous message
Axel Mueller is currently offline Axel Mueller
Messages: 1952
Registered: July 2009
Senior Member
Gabriele wrote on Sat, 11 December 2010 12:36
Hello Alex,

I tried but it doesn't work!! Sad
could you have a look at this please?

http://www.eclipse.org/forums/index.php?t=msg&th=201414& amp; amp;start=0&S=62991d9d14260fd630a0b164edba57b4

this is my configuration of the files.....

please I really will appreciate your help!

thanks
Gabriele

Well, I already posted an answer to this other thread.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Launch Failed : Binary not found
Next Topic:[Help] CDT Corrupted When Running on 64bit Fedora FC14
Goto Forum:
  


Current Time: Fri Sep 19 02:02:15 GMT 2014

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

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