NetBeans无法识别Makefile.am

时间:2012-12-25 12:20:50

标签: objective-c ios c netbeans compilation

我来自Objective-C / Xcode背景。

我习惯使用已导入XCode的C项目,但现在我想分析implementation algorithm我感兴趣的C project与我的项目集成。

只有这个项目完全用C语言编写,与Objective-C / Xcode等无关。

我不确定在Mac上查看纯this的最佳方式是什么,因此我安装了NetBeans for C / C ++。

问题在于,当我尝试在NetBeans上创建新项目并选择C/C++ Project with Existing Sources时,它会抱怨

no make files or configure scripts were found 

在根目录中..虽然它显然有一个Makefile.am

我知道Balsa项目是为linux编写的,但我对构建二进制文件不感兴趣我只想在IDE中查看源代码(即我可以点击函数调用并查看它实施等等)。

所以简而言之我的问题是为什么NetBeans不能识别我的Makefile.am

这里仅供参考,是Makefile.am

的内容
#intl dir needed for tarball --disable-nls build.
DISTCHECK_CONFIGURE_FLAGS=--disable-extra-mimeicons --without-gnome --without-html-widget
SUBDIRS = po sounds images doc libbalsa libinit_balsa src
# set tar in case it is not set by automake or make

man_MANS=balsa.1

pixmapdir = $(datadir)/pixmaps
pixmap_DATA = gnome-balsa2.png

desktopdir = $(datadir)/applications
desktop_in_files = balsa.desktop.in balsa-mailto-handler.desktop.in
desktop_DATA = balsa.desktop balsa-mailto-handler.desktop
@INTLTOOL_DESKTOP_RULE@

balsa_extra_dist =      \
    GNOME_Balsa.server.in   \
    HACKING         \
    balsa-mail-style.xml    \
    balsa-mail.lang     \
    balsa.1.in      \
    balsa.spec.in       \
    bootstrap.sh        \
    docs/mh-mail-HOWTO  \
    docs/pine2vcard     \
    docs/vconvert.awk   \
    $(desktop_in_files) \
    gnome-balsa2.png    \
    intltool-extract.in \
    intltool-merge.in   \
    intltool-update.in  \
    mkinstalldirs

if BUILD_WITH_G_D_U
balsa_g_d_u_extra_dist = gnome-doc-utils.make
endif

if !BUILD_WITH_UNIQUE
serverdir               = $(libdir)/bonobo/servers
server_in_files         = GNOME_Balsa.server
server_DATA             = $(server_in_files:.server.in=.server)

$(server_in_files): $(server_in_files).in
    sed -e "s|\@bindir\@|$(bindir)|" $< > $@

endif

EXTRA_DIST =            \
    $(balsa_extra_dist)     \
    $(balsa_g_d_u_extra_dist)

if BUILD_WITH_GTKSOURCEVIEW2
gtksourceviewdir = $(BALSA_DATA_PREFIX)/gtksourceview-2.0
gtksourceview_DATA = balsa-mail.lang        \
    balsa-mail-style.xml
endif

DISTCLEANFILES = $(desktop_DATA) $(server_DATA) \
    intltool-extract intltool-merge intltool-update \
    gnome-doc-utils.make


dist-hook: balsa.spec
    cp balsa.spec $(distdir)

@MAINT@RPM: balsa.spec
@MAINT@ rm -f *.rpm
@MAINT@ $(MAKE) distdir="$(PACKAGE)-@BALSA_VERSION@" dist
@MAINT@ cp $(top_srcdir)/rpm-po.patch $(top_builddir)/rpm-po.patch
@MAINT@ rpm -ta "./$(PACKAGE)-@BALSA_VERSION@.tar.gz"
@MAINT@ rm $(top_builddir)/rpm-po.patch
@MAINT@ -test -f "/usr/src/redhat/SRPMS/$(PACKAGE)-@VERSION@-@BALSA_RELEASE@.src.rpm" \
@MAINT@     && cp -f "/usr/src/redhat/SRPMS/$(PACKAGE)-@VERSION@-@BALSA_RELEASE@.src.rpm" .
@MAINT@ -for ping in /usr/src/redhat/RPMS/* ; do \
@MAINT@     if test -d $$ping ; then \
@MAINT@         arch=`echo $$ping |sed -e 's,/.*/\([^/][^/]*\),\1,'` ; \
@MAINT@         f="$$ping/$(PACKAGE)-@VERSION@-@BALSA_RELEASE@.$$arch.rpm" ; \
@MAINT@         test -f $$f && cp -f $$f . ; \
@MAINT@     fi ; \
@MAINT@ done

@MAINT@snapshot:
@MAINT@ $(MAKE) distdir=$(PACKAGE)-`date +"%y%m%d"` dist

@MAINT@balsa-dcheck:
@MAINT@ $(MAKE) BALSA_DISTCHECK_HACK=yes distcheck

## to automatically rebuild aclocal.m4 if any of the macros in
## `macros/' change
bzdist: distdir
    @test -n "$(AMTAR)" || { echo "AMTAR undefined. Run make bzdist AMTAR=gtar"; false; }
    -chmod -R a+r $(distdir)
    $(AMTAR) chojf $(distdir).tar.bz2 $(distdir)
    -rm -rf $(distdir)

# macros are not used any more by current configure.in, see also
# post by Ildar Mulyukov to balsa-list, 2006.06.27
# ACLOCAL_AMFLAGS = -I macros

更新

我试过{{3}}回答..但我得到了以下内容:

autoreconf --install
configure.in:250: warning: macro `AM_GLIB_GNU_GETTEXT' not found in library
glibtoolize: putting auxiliary files in `.'.
glibtoolize: copying file `./ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
glibtoolize: copying file `m4/libtool.m4'
glibtoolize: copying file `m4/ltoptions.m4'
glibtoolize: copying file `m4/ltsugar.m4'
glibtoolize: copying file `m4/ltversion.m4'
glibtoolize: copying file `m4/lt~obsolete.m4'
glibtoolize: Remember to add `LT_INIT' to configure.in.
glibtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
glibtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'
configure.in:250: warning: macro `AM_GLIB_GNU_GETTEXT' not found in library
configure.in:249: error: possibly undefined macro: AC_PROG_INTLTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.in:250: error: possibly undefined macro: AM_GLIB_GNU_GETTEXT
configure.in:301: error: possibly undefined macro: AC_MSG_ERROR
autoreconf: /usr/bin/autoconf failed with exit status: 1

我正在考虑使用输出中的建议..

2 个答案:

答案 0 :(得分:1)

有趣。我只是尝试下载“balsa”并注意到他们分发了Makefile.am和configure.in文件,而不是准备好运行配置脚本。您可以通过不预编译自己的autotools源来让软件包维护者知道他们没有做任何好处。

Makefile.am不是真正的Makefile。这是生成Makefile.in的东西,然后通过配置脚本将其转换为真正的Makefile。

请尝试以下步骤:

再次将源下载到balsa清理。然后从命令提示符键入以下内容:

autoreconf --install

(如果你没有autoreconf,你可能需要安装autotools软件包 - 呃......)

那应该生成配置脚本。然后输入:

./configure

它抱怨了一些遗漏的GMime依赖项,所以我没有看到它实际上生成了一个Makefile。一旦到达生成Makefile的位置,您应该能够将Netbeans指向“从现有源打开项目”。

答案 1 :(得分:0)

根据abbood的要求......

Netbeans对C开发不是很好。一种方法是在源代码库周围构建一个XCode项目。项目的维护者甚至可以接受XCode项目作为贡献。