linux中makefile问题,帮帮看看哪错了吧
CC=/ralink/RT288x_SDK/toolchain/buildroot-gcc342/bin/mipsel-linux-gccOBJS=delete_cdr....
CC=/ralink/RT288x_SDK/toolchain/buildroot-gcc342/bin/mipsel-linux-gcc
OBJS = delete_cdr.o write_cron.o
CDREXE = delete_cdr write_cron
#stdlibc++ known issue:
#If your program needs libstdc++, please turn off code optimization
CFLAGS +=-I/ralink/RT288x_SDK/source/lib/libsqlite3
LDFLAGS +=-L/ralink/RT288x_SDK/source/lib/libsqlite3 -lsqlite3
LDFLAGS +=-L/ralink/RT288x_SDK/source/romfs/lib -lpthread -ldl
all: delete_cdr write_cron
ledset: $(OBJS)
$(CC) $^ -o $@
romfs:
$(ROMFSINST) /bin/$(CDREXE)
clean:
rm -f $(CDREXE) *.elf *.gdb *.o
~
提示
make: *** No rule to make target `write_cron', needed by `all'. Stop.
求教啊 展开
OBJS = delete_cdr.o write_cron.o
CDREXE = delete_cdr write_cron
#stdlibc++ known issue:
#If your program needs libstdc++, please turn off code optimization
CFLAGS +=-I/ralink/RT288x_SDK/source/lib/libsqlite3
LDFLAGS +=-L/ralink/RT288x_SDK/source/lib/libsqlite3 -lsqlite3
LDFLAGS +=-L/ralink/RT288x_SDK/source/romfs/lib -lpthread -ldl
all: delete_cdr write_cron
ledset: $(OBJS)
$(CC) $^ -o $@
romfs:
$(ROMFSINST) /bin/$(CDREXE)
clean:
rm -f $(CDREXE) *.elf *.gdb *.o
~
提示
make: *** No rule to make target `write_cron', needed by `all'. Stop.
求教啊 展开
2个回答
展开全部
all 这个目标生成需要依赖delete_cdr write_cron。但是这2个文件,没有任何规则来编译生成他们啊。
由于定义了 CDREXE = delete_cdr write_cron
我估计,至少需要增加一个类似的规则
就是怎么通过delete_cdr.o 生成delete_cdr
通过write_cron.o 生成write_cron
由于定义了 CDREXE = delete_cdr write_cron
我估计,至少需要增加一个类似的规则
就是怎么通过delete_cdr.o 生成delete_cdr
通过write_cron.o 生成write_cron
追问
真心不好意思,这个makefile没错哦,我粗心把文件名写错了,还有一个问题,我希望把生成的delete_cdr write_cron这两个可执行程序编译完直接拷贝到/home下,应该如何修改这个makefile呢?如果好用,马上就采纳了,谢谢啦
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我希望把生成的delete_cdr write_cron这两个可执行程序编译完直接拷贝到/home下,应该如何修改这个makefile呢? 办法如下,在Makefile中添加下边三句话,注意点和tab键别弄错了。
.PHONY:install
install:
cp delete_cdr write_cron /home; chmod 775 delete_cdr write_cron ;
.PHONY:install
install:
cp delete_cdr write_cron /home; chmod 775 delete_cdr write_cron ;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询