免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 7499 | 回复: 20
打印 上一主题 下一主题

[FreeBSD] 如何强行执行make [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-06 10:47 |只看该作者 |倒序浏览
如论目标是否为最新,我都要强行让makefile重新执行一遍,怎么办?
最好不需要将目标删除.

论坛徽章:
0
2 [报告]
发表于 2006-09-06 11:54 |只看该作者
一个简单的Makefile示例:
all:
\t gcc ...

clean:
\t ...

.PHONY: clean #这里不要加上all


Makefile同目录里不要出现名为'all'的文件。

那么每次make,all目标都会被执行。

论坛徽章:
0
3 [报告]
发表于 2006-09-06 11:56 |只看该作者
原帖由 l.darkfire 于 2006-9-6 10:47 发表
如论目标是否为最新,我都要强行让makefile重新执行一遍,怎么办?
最好不需要将目标删除.


对于FreeBSD的make,把:换成!即可。

论坛徽章:
0
4 [报告]
发表于 2006-09-06 12:02 |只看该作者
原帖由 雨丝风片 于 2006-9-6 11:56 发表


对于FreeBSD的make,把:换成!即可。

这个通用不?

我发现如果组织得当,NetBSD的makefile完全可以与gmake的makefile通用。

论坛徽章:
0
5 [报告]
发表于 2006-09-06 12:06 |只看该作者
原帖由 assiss 于 2006-9-6 12:02 发表

这个通用不?

我发现如果组织得当,NetBSD的makefile完全可以与gmake的makefile通用。


这个只对pmake而言。要想写可移植的makefile,确实需要费心组织一下才行啊。

论坛徽章:
2
亥猪
日期:2014-03-19 16:36:35午马
日期:2014-11-23 23:48:46
6 [报告]
发表于 2006-09-06 14:29 |只看该作者
查了下,: :: !三个符号在pmake和gmake里的解释一摸一样。

pmake也可以在dependent list里面加 .EXEC 属性
SPECIAL SOURCES (ATTRIBUTES)
     .EXEC     Target is never out of date, but always execute commands any-
                    way.

论坛徽章:
0
7 [报告]
发表于 2006-09-06 14:38 |只看该作者
原帖由 gvim 于 2006-9-6 14:29 发表
查了下,: :: !三个符号在pmake和gmake里的解释一摸一样。

pmake也可以在dependent list里面加 .EXEC 属性


俺咋只在gmake手册里看到了::,而没有看到!涅?

论坛徽章:
2
亥猪
日期:2014-03-19 16:36:35午马
日期:2014-11-23 23:48:46
8 [报告]
发表于 2006-09-06 15:22 |只看该作者
灭.....我在http://linux.ctyme.com/man/man1594.htm看得手册,难道是盗BSD的版?

论坛徽章:
0
9 [报告]
发表于 2006-09-06 15:47 |只看该作者
原帖由 gvim 于 2006-9-6 15:22 发表
灭.....我在http://linux.ctyme.com/man/man1594.htm看得手册,难道是盗BSD的版?


经初步鉴定,盗版成立。

gnu的make手册上没讲:http://www.gnu.org/software/make/manual/make.html
在freebsd上man gmake也没讲。

而freebsd上man make则讲了。。。这就是pmake。

我们再来做盗版鉴定:
freebsd上man make的片断:

  1.      :     A target is considered out-of-date if its modification time is less
  2.            than those of any of its sources.  Sources for a target accumulate
  3.            over dependency lines when this operator is used.  The target is
  4.            removed if make is interrupted.

  5.      !     Targets are always re-created, but not until all sources have been
  6.            examined and re-created as necessary.  Sources for a target accumu-
  7.            late over dependency lines when this operator is used.  The target
  8.            is removed if make is interrupted.

  9.      ::    If no sources are specified, the target is always re-created.  Oth-
  10.            erwise, a target is considered out-of-date if any of its sources
  11.            has been modified more recently than the target.  Sources for a
  12.            target do not accumulate over dependency lines when this operator
  13.            is used.  The target will not be removed if make is interrupted.
复制代码


你给的网页上的片断:
  1. : A target is considered out-of-date if its modification time is less than those of any of its sources. Sources for a target accumulate over dependency lines when this operator is used. The target is removed if is interrupted.

  2. ! Targets are always re-created, but not until all sources have been examined and re-created as necessary. Sources for a target accumulate over dependency lines when this operator is used. The target is removed if is interrupted.

  3. :: If no sources are specified, the target is always re-created. Otherwise, a target is considered out-of-date if any of its sources has been modified more recently than the target. Sources for a target do not accumulate over dependency lines when this operator is used. The target will not be removed if is interrupted.
复制代码

论坛徽章:
0
10 [报告]
发表于 2006-09-06 15:52 |只看该作者
原帖由 雨丝风片 于 2006-9-6 15:47 发表


经初步鉴定,盗版成立。

gnu的make手册上没讲:http://www.gnu.org/software/make/manual/make.html
在freebsd上man gmake也没讲。

而freebsd上man make则讲了。。。这就是pmake。

我们再 ...

我在NetBSD上试用gmake,似乎也的确不能用!代替:。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP