Makefile如何知道文件已更改(然后重新编译)? [英] How does Makefile know that a file changed (and then recompile it)?

查看:1706
本文介绍了Makefile如何知道文件已更改(然后重新编译)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是出于好奇,Makefile如何知道一个文件改变了(然后重新编译它)?是否 make ?是由编译器吗?如果是,是否依赖于语言?

Just out of curiosity, how does Makefile know that a file changed (and then recompile it)? Is it up to make? Is it up to the compiler? If so, is it language dependent?

推荐答案

它查看文件时间戳 - 如果依赖关系比目标更新,则重建目标。

It looks at the file time-stamp - simple as that. If a dependency is newer that the target, the target is rebuilt.

这篇关于Makefile如何知道文件已更改(然后重新编译)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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