1.在Makefile中
一般使用一个总控Makefile来指明文件的编译规则
如:
subsystem:
cd subdir && $(MAKE)
其等价于
subsystem:
$(MAKE) -C subdir
这两者表达相同的意思:先进入“subdir”目录中,然后执行make命令;
2.一般使用export来到处变量为环境变量,以便于在下级的Makefile文件中能够使用这个变量;
使用unexport不导出变量为环境变量
3.存在两个变量无论是否export,这两个变量都会导出传递到下层的Makefile中:SHELL , MAKEFLAGS
MAKEFLAGS是一个系统级别的环境变量;
当执行总控Makefile文件时,make 参数(如make -s)或者上一层Makefile文件中定义了这个变量,那么MAKEFLAGS将会是这些参数,并且会传递到下一层的Makefile中;
需要注意的是:
"-C","-f","-h","-o","-W"这些参数将不会继续往下传递参数;
4.执行make -s施行静默编译
5.make -w是在make过程中输出一些路径信息;