为了账号安全,请及时绑定邮箱和手机立即绑定

如下所示,我知道这是一个eclipse的工程,请帮忙解释5到35行,谢谢!

如下所示,我知道这是一个eclipse的工程,请帮忙解释5到35行,谢谢!

眼眸繁星 2022-11-18 17:13:49
12 # Automatically-generated file. Do not edit!5 -include ../makefile.init6 7 RM := rm -rf8 9 # All of the sources participating in the build are defined here10 -include sources.mk11 -include subdir.mk12 -include objects.mk13 14 ifneq ($(MAKECMDGOALS),clean)15 ifneq ($(strip $(C++_DEPS)),)16 -include $(C++_DEPS)17 endif18 ifneq ($(strip $(C_DEPS)),)19 -include $(C_DEPS)20 endif21 ifneq ($(strip $(CC_DEPS)),)22 -include $(CC_DEPS)23 endif24 ifneq ($(strip $(CPP_DEPS)),)25 -include $(CPP_DEPS)26 endif27 ifneq ($(strip $(CXX_DEPS)),)28 -include $(CXX_DEPS)29 endif30 ifneq ($(strip $(C_UPPER_DEPS)),)31 -include $(C_UPPER_DEPS)32 endif33 endif35 -include ../makefile.defs
查看完整描述

2 回答

?
繁华开满天机

TA贡献1816条经验 获得超4个赞

1
2 # Automatically-generated file. Do not edit!
5 -include ../makefile.init //包含上级目录的makefile.init文件

7 RM := rm -rf //定义一个变量RM,初始值是rm -rf,下文如有用到RM,等价于使用命令"rm - rf", 即强制删除文件命令。

9 # All of the sources participating in the build are defined here
10 -include sources.mk //包含当前目录下的sources.mk文件
11 -include subdir.mk //包含当前目录下的subdir.mk文件
12 -include objects.mk //包含当前目录下的objects.mk文件
13 
14 ifneq ($(MAKECMDGOALS),clean) //比较参数“MAKECMDGOALS ”的值是否等于"clean", 如果不等,则为真。
15 ifneq ($(strip $(C++_DEPS)),)
16 -include $(C++_DEPS) //包含当前目录下的$(C++_DEPS) 文件
17 endif
18 ifneq ($(strip $(C_DEPS)),) //strip函数的功能是去掉字符串开头和结尾的空格
19 -include $(C_DEPS)
20 endif
21 ifneq ($(strip $(CC_DEPS)),)
22 -include $(CC_DEPS)
23 endif
24 ifneq ($(strip $(CPP_DEPS)),)
25 -include $(CPP_DEPS)
26 endif
27 ifneq ($(strip $(CXX_DEPS)),)
28 -include $(CXX_DEPS)
29 endif
30 ifneq ($(strip $(C_UPPER_DEPS)),)
31 -include $(C_UPPER_DEPS)
32 endif
33 endif
35 -include ../makefile.defs

 


查看完整回答
反对 回复 2022-11-22
?
不负相思意

TA贡献1777条经验 获得超10个赞

easy, 不过一行一行的比较麻烦:

1, -include 和c语言的 #include 差不多,是把文件插入到当前文件的当前位置。

2, ifneq ($(MAKECMDGOALS),clean) : 如果变量MAKECMDGOALS 的值 不等于 clean.

3,strip函数的功能是取掉字符串开头和结尾的空格, $(stip ni hao ) 示例以" ni hao "作参数时其返回值是"ni hao". 

注意: makefile和shell类似,变量类型只有一种,那就是字符串类型,即使你这样定义 INT = 123, INT 也会被当作"123"字符串来处理。

1, ../makefile.init 代表当前目录的父目录下的makfile.init 文件, 这句就是把当期目录的父目录下的makefile.init插入到当前文件的当前位置。 

 2, ifneq ($(MAKECMDGOALS),clean) 里面这个MAKECMDGOALS是个变量,makefile没有宏这个说法。 因为在这句之前有 -include ../makefile.init -include sources.mk -include subdir.mk -include objects.mk  这4句,所以如果你在当前makefile找不到MAKECMDGOALS这个变量就去上面的4个文件里去找找,如果真的找不到,那么就是说没有定义MAKECMDGOALS这个变量,这时$(MAKECMDGOALS)等于空,即""。

查看完整回答
反对 回复 2022-11-22
  • 2 回答
  • 0 关注
  • 114 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信