在没有makefile的情况下使用make命令? [英] Using the make command without makefiles?

查看:39
本文介绍了在没有makefile的情况下使用make命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个作业编译一些 C 代码并运行make codeFile",其中codeFile"是我的 C 程序的名称,即使我没有 makefile,也创建了一个可执行文件,并且它运行正常.

I was compiling some C code for an assignment and I ran "make codeFile", where "codeFile" was the name of my C program, and even though I didn't have a makefile, an executable was created, and it ran and worked correctly.

有人知道为什么会这样吗?为什么即使我没有makefile,make 也会编译一些东西?我能找到的唯一参考是:http://daly.axiom-developer.org/TimothyDaly_files/class5/node5.html

Does anyone know why this worked? Why does make compile something even if I don't have a makefile? The only reference I could find was this: http://daly.axiom-developer.org/TimothyDaly_files/class5/node5.html

推荐答案

Make 有一个带有隐式规则的内部数据库.您可以使用 make -p 列出它们.make -d 还会告诉您正在应用哪些规则,这样可以帮助您发现在这种情况下正在使用哪些隐式规则.

Make has an internal database with implicit rules. You can use make -p to list them. Also make -d will tell you which rules are being applied, so that would help you discover which implicit rules are being used in this case.

这篇关于在没有makefile的情况下使用make命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆