如何从 C 程序创建 makefile?
你好,作为评估的一部分,我必须提交需要一些非标准库的代码。为了节省提交头文件和代码,我想用代码和所需的附加组件“捆绑”在一起形成一个“makefile”。我完全不知道如何去做这件事,任何建议将不胜感激!
Hiya, as part of an assessment I have to hand in a code which requires a few non-standard libraries. In order to save submitting the header files and the code I would like to form a 'makefile' with the code and required add-ons sort of 'bundled' together. I have absolutely no idea idea how to go about doing this though and any suggestions would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
生成文件看起来不是您正在寻找的内容。您不能将内容捆绑到 makefile 中。将 makefile 视为伴随源文件和包含配方的头文件的文件。它将告诉如何使用所有其他文件构建您的程序。
A makefile does not look to be what you are looking for. You cannot bundle things into a makefile. Think of a makefile as a file accompanying your source and header files that will contain the recipe. It will tell how to build your program using all the other files.
在不了解具体情况的情况下,我只能为您指出正确的方向。这个网站虽然不太赏心悦目,但相当容易理解:
Makefile 教程
这个 是“make”的 GNU 手册页
Without knowing specifics, I can only point you in the right direction. This site, although not very pleasing to the eye, is fairly easy to understand:
Makefile Tutorial
This is the GNU manual page for 'make'
只需打包源代码并在某处的描述中列出要求即可。
例如:
让源用户负责获取/安装/配置所需的库。
Just package your source code and list the requirements in a description somewhere.
For example:
Let the responsability of getting/installing/configuring the required libraries be with the user of your source.