如何输入make -j2出现make: *** No targets specified and no makefile found. Stop.是为什么
时间: 2024-05-25 18:09:08 浏览: 14
当你输入make -j2命令时,系统会尝试在当前目录下查找Makefile文件并执行其中的指令。如果当前目录下没有Makefile文件或者Makefile文件中没有定义任何目标,则会出现"make: *** No targets specified and no makefile found. Stop."这个错误提示。
可能的原因如下:
1. 当前目录下没有Makefile文件
2. Makefile文件中没有定义任何目标
3. Makefile文件中定义的目标名称与你输入的名称不匹配
4. Makefile文件中存在语法错误
请检查当前目录下是否有Makefile文件,并确保其中定义了需要执行的目标。如果没有,则需要创建一个Makefile文件并定义需要执行的目标。如果存在语法错误,则需要修复语法错误。
相关问题
sudo make -j8 make: *** No targets specified and no makefile found. Stop.
这是一个在Linux系统中用来编译代码的命令。其中,make是一个常用的构建工具,-j8表示启动8个线程并行编译,可以加快编译速度。但是在您的问题中出现了错误提示" No targets specified and no makefile found. Stop.",这通常是因为没有Makefile文件或者Makefile文件中没有指定任何目标造成的。您需要确保在执行该命令之前已经生成了正确的Makefile文件并且指定了要编译的目标。如果您想要更深入地了解make命令和Makefile文件,请告诉我,我可以为您提供更多的信息。
Redis安装:make: *** No targets specified and no makefile found. Stop.
当Redis安装时出现"make: *** No targets specified and no makefile found. Stop."的错误时,可以尝试以下解决方法:
1. 确保已经正确下载并解压了Redis源代码文件。
2. 进入Redis源代码文件所在的目录,通常是通过cd命令进入该目录。
3. 运行make命令进行编译,如果出现报错信息,可以尝试先安装gcc编译器,可以通过执行"apt-get install gcc"命令来安装。
4. 如果仍然无法解决问题,可以尝试将Redis解压文件删除,重新解压,并再次执行make命令。
5. 进入Redis的src目录,执行make命令。
6. 最后一种方式是进入Redis目录(例如/opt/redis),执行make命令。
通过以上步骤,您应该能够成功解决"make: *** No targets specified and no makefile found. Stop."的错误并完成Redis的安装。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
相关推荐
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)