失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > make 报错 *** recipe commences before first target. Stop.

make 报错 *** recipe commences before first target. Stop.

时间:2021-07-23 09:28:59

相关推荐

make 报错 *** recipe commences before first target. Stop.

背景

学习linux设备驱动,写第一个hello world程序,make报错:

eden@ubuntu:~/Documents/Project/scull/hello_world$ make

Makefile:17: *** recipe commences before first target. Stop.

原因

最后查明原因是我的target多了tab

Makefile的rule基本是这样的

targets: prerequisites

command

command

command

targets前不能有tab键

command要使用tab键开始

我错误的写法是:

ifneq ($(KERNELRELEASE),)hello-objs := hello.oobj-m := hello.oelseKERNELDIR ?= /lib/modules/$(shell uname -r)/buildPWD := $(shell pwd)modules:$(MAKE) -C $(KERNELDIR) M=$(PWD) modulesendif

改为:

ifneq ($(KERNELRELEASE),)hello-objs := hello.oobj-m := hello.oelseKERNELDIR ?= /lib/modules/$(shell uname -r)/buildPWD := $(shell pwd)modules:$(MAKE) -C $(KERNELDIR) M=$(PWD) modulesendif

问题解决

如果觉得《make 报错 *** recipe commences before first target. Stop.》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。