mafile中注释的几种方式有哪些
时间: 2023-12-14 11:05:17 浏览: 37
在 Makefile 中,可以使用以下几种方式来添加注释:
1. 使用 `#` 符号:在行的开头使用 `#` 符号表示该行为注释,这是最常见和简单的注释方式。
```makefile
# 这是一行注释
```
2. 使用 `##` 符号:在行的开头使用 `##` 符号表示该行为注释,并且这种注释会被 Makefile 的解析器输出到标准输出中。
```makefile
## 这是一行注释
```
3. 使用空行:在 Makefile 中添加空行也可以作为注释,空行会被解析器忽略。
```makefile
# 这是一行注释
```
请注意,Makefile 中的注释只能在行的开头,不能在行内或行末添加注释。注释内容不会被 Makefile 的解析器处理或执行。
相关问题
configure里没有uninstall,所以生成的Mafile里也没有uninstall选项,所以报错make[1]: *** No rule to make target 'uninstall'. Stop.,该怎么修改?
如果 configure 脚本中没有包含 uninstall 目标,那么你可以手动添加 uninstall 目标。你可以在 Makefile.am 文件中添加以下内容:
```
uninstall:
-$(RM) <安装目录>/<安装文件>
```
其中,`<安装目录>` 是你的程序在安装时所在的目录,`<安装文件>` 是你的程序在安装时所生成的文件名。你需要将这两个参数替换成你的实际参数。
然后运行以下命令重新生成 Makefile:
```
$ autoreconf -i
```
然后再次运行 make 命令,就应该可以正常执行 uninstall 目标了。
Makefile.am和configure里没有uninstall,所以生成的Mafile里也没有uninstall选项,所以报错make[1]: *** No rule to make target 'uninstall'. Stop.,该怎么修改?
如果生成的 Makefile 中没有包含 uninstall 目标,那么你可以手动添加 uninstall 目标。你可以在 Makefile.am 文件中添加以下内容:
```
uninstall:
-$(RM) <安装目录>/<安装文件>
```
其中,`<安装目录>` 是你的程序在安装时所在的目录,`<安装文件>` 是你的程序在安装时所生成的文件名。你需要将这两个参数替换成你的实际参数。
然后运行以下命令重新生成 Makefile:
```
$ autoreconf -i
```
然后再次运行 make 命令,就应该可以正常执行 uninstall 目标了。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![rp](https://img-home.csdnimg.cn/images/20210720083646.png)