我发现在下面使用erl -make的情况下不会编译文件。
a.erla.erla.erla.erl未编译然后我在OS上进行了测试,成功地编译了a.erl。
在上述两种情况下,唯一的区别是在使用cp命令复制文件时更改了OS中的“最后修改时间”,而在没有命令的情况下没有更改。
发布于 2013-08-21 20:45:02
听起来您已经知道了:当源文件比编译文件更新时,就会触发重新编译。您的Windows保留了修改时间,因此我们不会重新编译。Mac终端外壳(bash)更新修改时间,因此旧文件看起来是新的。
以下是make(3)手册页的相关部分:
Traversing the set of modules, it then recompiles every module for which at least one of the following conditions apply: \* there is no object file, or \* the source file has been modified since it was last com- piled, or, \* an include file has been modified since the source file was last compiled. As a side effect, the function prints the name of each module it tries to compile. If compilation fails for a module, the make procedure stops and error is returned.
在Windows下,最好的选择是在要强制重新编译时删除已编译的模块。您也可能有更好的时间使用一些源代码管理(SVN,Git等)。我相信即使在Windows环境下,他们也会更新恢复文件的修改时间。
https://stackoverflow.com/questions/18348724
复制相似问题