make文件这么写对么?为什么出错

yangbc 2006-05-06 09:07:41
makefile:
就一个test.c文件,一个头文件a.h

test:test.o
gcc -o test test.o
test.o:test.c a.h
gcc -c test.c


可是make后,出现下面问题,各位高手指点一下
tbcs1:p6906:/bosshome/tbcs1/yangbc> make
"makefile", line 11: make: 1254-055 Dependency line needs colon or double colon operator.
"makefile", line 13: make: 1254-055 Dependency line needs colon or double colon operator.
make: 1254-058 Fatal errors encountered -- cannot continue.
...全文
541 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zidane_yubo 2006-05-20
  • 打赏
  • 举报
回复
来晚了
test:test.o
gcc -o test test.o

test.o:test.c a.h
gcc -c test.c

gcc前tab键
darkstar21cn 2006-05-19
  • 打赏
  • 举报
回复
berniechen0123() 正解
命令前面要加tab键
berniechen0123 2006-05-19
  • 打赏
  • 举报
回复
test:test.o
gcc -o test test.o

这样就ok了
gudulyn 2006-05-19
  • 打赏
  • 举报
回复
Makefile中的动作,必须以TAB键开始。
linux_DD 2006-05-06
  • 打赏
  • 举报
回复
Makefile中的动作,必须以TAB键开始

看看她报的错:“Shell command needs a leading tab“
Easwy 2006-05-06
  • 打赏
  • 举报
回复
test:test.o
gcc -o test test.o

test.o:test.c a.h
gcc -c test.c

Makefile中的动作,必须以TAB键开始。
建议看一下"跟我一起写 Makefile" (http://blog.csdn.net/haoel/category/9198.aspx)
yangbc 2006-05-06
  • 打赏
  • 举报
回复
现在成了这个错误了
tbcs1:p6906:/bosshome/tbcs1/yangbc> make
"makefile", line 12: make: 1254-057 Shell command needs a leading tab.
"makefile", line 14: make: 1254-057 Shell command needs a leading tab.
make: 1254-058 Fatal errors encountered -- cannot continue.
tbcs1:p6906:/bosshome/tbcs1/yangbc>

23,128

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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