制作带有两个目标的源
我使用这个名为 Lazy C++ 的工具,它将单个 C++ .lzz 文件分解为 .h 和 .cpp 文件。 我希望 Makepp 期望这两个文件在我构建 .lzz 文件的规则之后存在,但我'我不确定如何将两个目标放入一条构建线中。
I use this tool called Lazy C++ which breaks a single C++ .lzz file into a .h and .cpp file. I want Makepp to expect both of these files to exist after my rule for building .lzz files, but I'm not sure how to put two targets into a single build line.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LZ真是厉害啊! 这正是我正在寻找的 http:// groups.google.com/group/comp.lang.c++/browse_thread/thread/c50de73b70a6a957/f3f47fcdcfb6bc09
实际上,您所需要的只是(通常)在链接规则中依赖 foo.o 以及要调用的模式规则lzz:
剩下的会自动就位。 当编译任何包含 foo.h 的源代码,或将 foo.o 链接到库或程序时,lzz 将首先被自动调用。
Makepp 还将识别是否仅更改了时间戳而不更改了生成的文件的内容,并忽略它。 但通过使用 lzz 选项来抑制重新创建相同的文件,减少它的工作量也没什么坏处。
问候——丹尼尔
Lzz is amazing! This is just what I was looking for http://groups.google.com/group/comp.lang.c++/browse_thread/thread/c50de73b70a6a957/f3f47fcdcfb6bc09
Actually all you need is to depend (typically) on foo.o in your link rule, and a pattern rule to call lzz:
The rest will fall into place automatically. When compiling any source that includes foo.h, or linking foo.o to a library or program, lzz will first get called automatically.
Makepp will also recognize if only the timestamp but not the content of the produced file changed, and ignore that. But it can't hurt to give it less to do, by using the lzz options to suppress recreating an identical file.
Regards -- Daniel
我个人从未使用过 Makepp,但由于它是 GNU Make 的直接替代品,因此您应该能够执行以下操作:
也不确定那里的 lzz 调用,但这应该有所帮助。 您可以在 http://theory.uwinnipeg.ca/gnu/make 阅读更多相关信息/make_37.html。
I've never used Makepp personally, but since it's a drop-in replacement for GNU Make, you should be able to do something like:
Also not sure about the lzz invocation there, but that should help. You can read more about this at http://theory.uwinnipeg.ca/gnu/make/make_37.html.