make 没有规则可以创建目标 install 。

727 views
Skip to first unread message

路佚2

unread,
Dec 22, 2009, 8:20:31 PM12/22/09
to xiyou...@googlegroups.com

我写了一个makefile,但是运行make install 就出现这个错误,下面是我的makefile内容,
-- APPS = cb_read cb_write
ROBJECTS = cb_read.o cb_user.o
WOBJECTS = cb_write.o cb_user.o
CFLAGS = -O2 -Wall
all: $(APPS)
cb_write: $(WOBJECTS)
 cc $(CFLAGS) $(WOBJECTS) -o $@
cb_read: $(ROBJECTS)
 cc $(CFLAGS) $(ROBJECTS) -o $@
clean:
 @rm -f *o $(APPS)
 
但是我的GCC  已经安装了, 如果我再写install还真的不会写
install:
gcc -o .......

请大家帮个忙, 万分感谢
Best Regards

from :Joshua

Américo Wang

unread,
Dec 23, 2009, 11:11:53 AM12/23/09
to 路佚2, xiyou...@googlegroups.com

install是安装,不是编译。你需要把前面编译生成的二进制安装到
指定的目录,比如:/usr/bin/。


--
Live like a child, think like the god.

路佚2

unread,
Dec 23, 2009, 8:18:40 PM12/23/09
to Américo Wang, xiyou...@googlegroups.com
搞定,
谢谢

2009/12/24 Américo Wang <xiyou.w...@gmail.com>



--
from :Joshua
Reply all
Reply to author
Forward
0 new messages