makefile phony

东大坡居士 2012-10-21 04:41:42
hi, all

i am study the makefile recently, and found a knowledge point which can not understand clearly:

in my makefile, i defined two phony target:

.PHONY: test1 test2
test1:
@echo ###########

......

test2:
@echo ===========

why make can print first phony target informatin? but when to test2, make quit encountered some error and info not print out?


Thanks!
...全文
123 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoxiao8310 2012-10-21
  • 打赏
  • 举报
回复
每一个命令行必须以[Tab]字符开始,[Tab] 字符告诉make此行是一个命令行。
xiaoxiao8310 2012-10-21
  • 打赏
  • 举报
回复
make test2试试先,若不能打印出来,再看看@echo前面是不是TAB.
xiaoxiao8310 2012-10-21
  • 打赏
  • 举报
回复
make test试试先,若不能打印出来,再看看@echo前面是不是TAB.
JiMoKuangXiangQu 2012-10-21
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]
just: make
[/Quote]

和test1和test2应该没有关系,大概是.....有点问题吧.
可以贴得全一点,或者给出错信息,大家参考一下.
mujiok2003 2012-10-21
  • 打赏
  • 举报
回复
try: make test2

there are several grammar mistakes, by the way:-)
东大坡居士 2012-10-21
  • 打赏
  • 举报
回复
just: make
JiMoKuangXiangQu 2012-10-21
  • 打赏
  • 举报
回复
lz怎样运行你的makefile:
make
or
make test1
or
make test2
?

......
又都是什么内容?

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧