C++ eclipsec++;如何使用现有的makefile

C++ eclipsec++;如何使用现有的makefile,c++,eclipse,makefile,C++,Eclipse,Makefile,我是个新手,我有个问题! 我必须使用C++代码,我不知道如何导入它,以及如何在Ecclipse上编译它(我用命令行编译)。 该代码具有特定的结构,其组织方式如下: repos____lib____configure (execute the configure file inside the libraries folders) I I___makefile (execute the make file inside the librari

我是个新手,我有个问题! 我必须使用C++代码,我不知道如何导入它,以及如何在Ecclipse上编译它(我用命令行编译)。 该代码具有特定的结构,其组织方式如下:

repos____lib____configure (execute the configure file inside the libraries folders)
                  I           I___makefile (execute the make file inside the libraries folders,
                                                        requires make/make.def)
      I           I___ib1____.cpp
      I           I            I____.h
      I           ...          I____configure (it requires make/configure_lib and
                                                              make/configure_includes
      I           ...          I____makefile (generated by configure)
      I           I___lib2___....
      i           I___.......
      I           I___libn____.cpp
      i                        I____.h
      i                        I____configure
      i                        I____makefile (generated by configure)
      I
      I___make(folder)__bashrc (are set the some environment variables)
      I                               I__configure_bin
      I                               I__configure_includes
      I                               I__configure_lib
      I                               I__make.def (are set all the include path and library path used
      I                                                         in the configure file)
      I___application__main.cpp
                                   I__configure
                                   I__makefile(generated by the configure file)
为了确保你理解我的问题…(当然…:)

第一个配置文件是:

cd lib1; ./configure
cd ../lib2; ./configure
.....
....
cd ../libn; ./configure
cd
第一个makefile是

include /media/Dati/WORKHOME/repos/make/make.def
这是整个库的makefile 配置文件(lib1中的文件)的示例:

#/usr/bin/perl

$INC='$(OPENCVINC)$(FLTKINC)$(DC1394V2INC)'## 通过使用“将现有代码作为makefile项目导入”,您已经做了正确的事情。 现在eclipse知道它需要调用make并使用makefile。但您的构建过程不仅仅是由make驱动的

一种解决方案是编写一个调用所有构建步骤的makefile。比如:

all:
    cd dir1 && ./configure && make
    cd dir2 && ./configure && make 
    etc.
my2c

编辑:


我目前没有安装eclipse,所以我无法向您发送详细的步骤。。。抱歉

+1对于一个人的格式良好的问题,请回答6次。(:@gabriele:这是正确的方式。StackOverflow不同于其他论坛,因为它强调书面的问题和答案。这种方式是对问题/答案进行评论,并在需要时对其进行编辑。这样你最终会得到书面的正确答案,而不是大量的评论/回复/答案。。。
   #!/usr/bin/perl

$INC = '$(OPENCVINC) $(FLTKINC) $(DC1394V2INC)';  ##<-DEFINED IN /make.def
$LIB = '$(OPENCVLIB) $(FLTKLIB) $(DC1394V2LIB)';      #####################

#-------------------------------------------------------------------------------

require '/media/Dati/WORKHOME/repos/make/configure_lib';
print "Created Makefile.\n";

# this will create a include file for the whole directory, 
# using the template <dirname>.h.templ
require '/media/Dati/WORKHOME/repos/make/configure_includes';
print "Created $libname.h\n";
all:
    cd dir1 && ./configure && make
    cd dir2 && ./configure && make 
    etc.