- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
这个问题扩展了问题 How to handle subprojects with autotools?
所以我有一些项目有自己的 Makefile(不是 GNU autotools)模块/libfoo
我添加了 SUBDIRS = include/jsonbox Makefile.am 并且它编译正常,但前提是我从顶级目录调用 ./configure 和 make。
如果我创建一个子目录,比如构建,然后从中运行 ../configure,我在 make 期间遇到错误:
Making all in modules/libfoo
/bin/sh: line 17: cd: modules/libfoo: No such file or directory
make: *** [all-recursive] Error 1
这个可以处理吗?我需要为不同的 archs 和 CFLAGS 构建多个目录。
编辑:正如它在 docs 中所提到的那样我在嵌套项目中创建了一个 GNUmakefile.in。但它仍然不适用于 VPATH:
Making all in modules/libfoo
make[1]: Entering directory `/home/galadog/test/build/moudles/libfoo'
GNUmakefile:2: Makefile: No such file or directory
make[1]: *** No rule to make target `Makefile'. Stop.
make[1]: Leaving directory `/home/galadog/test/build/moudles/libfoo'
make: *** [all-recursive] Error 1
编辑2实际的 Makefile 可以在这里看到: https://github.com/anhero/JsonBox/blob/master/Makefile
最佳答案
遗憾的是,如果没有以下任何一项,您将无法正确地实现此目的:
您链接的文档主要侧重于解决 make distcheck
的问题,而不支持实际构建。
然而,有一种简单的 hack 可以用最少的工作来工作——它是将整个子树复制到构建目录。这不是一个很好的解决方案,但它会使子树构建工作:
SUBDIRS = modules/libfoo
# and possibly all other -recursive targets you'll be using
all-recursive: copy-libfoo
copy-libfoo:
mkdir -p modules
cp -R -H $(top_srcdir)/modules/libfoo modules/
但正如我所说,它很丑陋。上游 Makefile 仍然需要定义正确的 automake 目标(all
、install
等),因此在您的情况下,您还需要添加一个 GNUmakefile
在项目子目录中,如:
include Makefile
INSTALL:
这将提供一个虚拟目标来避免*** No rule to make target 'install'
;也可能是这样。然后 EXTRA_DIST
如果您想使用 make dist
但这都包含在链接文档中。
老实说,您的地面很滑。如果我是你,我要么根本不使用那个项目,要么忽略它,因为维护它比从头开始编写同样的东西更难。
我会考虑的第二个解决方案,也是一个正确的解决方案,是在您的主 Makefile.am
中复制 Makefile,而不对该子目录使用递归自动生成:
LIBRARIES = modules/libfoo/libfoo.a
modules_libfoo_libfoo_a_SOURCES = modules/libfoo/src/a.c # ...
# and possibly some...
EXTRA_DIST = # ...
关于linux - Autotools 和一个带有普通 Makefile 的嵌套项目工程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12026697/
假设您有一个在白天接收订单的仓库。这些订单可以是提取产品或向仓库添加产品。在一天结束时,您会得到一份仍包含在仓库中的元素 list 。由于劳动力非常稀少,因此可能会发生订单在仓库的票务系统收到订单的当
有哪些学习音频操作/工程/编程的好资源? 最佳答案 如果您对编写音频效果感兴趣,这两个网站非常好: Music DSP KVR Developer Forum 关于audio - 有哪些学习音频操作/
我的程序写错了 struct vector v; 代替 vector v; 但编译器似乎并不关心:http://codepad.org/TCPb8p2u 为什么有效?使用或不使用 struct 是否存
我创建了一个 Settings自动检索或打印关联 JTextField 上的设置值的类。我的绑定(bind)函数如下所示: public void bindToInput(final String s
下面的例子可以编译,但是输出很奇怪: #include #include struct A { int a; char b; bool c; }; int main() {
如何在Mac-Os上打开已有的Android Studio制作的Flutter工程导出ipa版本的app?可以使用 Mac-Os 版本的 Android Studio 来完成,还是我必须使用 X-Co
我是一名优秀的程序员,十分优秀!