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

1
2 # Automatically-generated file. Do not edit!
5 -include ../makefile.init

7 RM := rm -rf

9 # All of the sources participating in the build are defined here
10 -include sources.mk
11 -include subdir.mk
12 -include objects.mk
13 
14 ifneq ($(MAKECMDGOALS),clean)
15 ifneq ($(strip $(C++_DEPS)),)
16 -include $(C++_DEPS)
17 endif
18 ifneq ($(strip $(C_DEPS)),)
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

眼眸繁星
浏览 117回答 2
2回答

繁华开满天机

12 # Automatically-generated file. Do not edit!5 -include ../makefile.init //包含上级目录的makefile.init文件6 7 RM := rm -rf //定义一个变量RM,初始值是rm -rf,下文如有用到RM,等价于使用命令"rm - rf", 即强制删除文件命令。8 9 # All of the sources participating in the build are defined here10 -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 endif18 ifneq ($(strip $(C_DEPS)),) //strip函数的功能是去掉字符串开头和结尾的空格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 

不负相思意

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)等于空,即""。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Oracle
MySQL