The built in rules use a set of standard variables that allow you to specify local environment information (like where to find the ROOT include files) without re-writing all the rules. The ones most likely to be interesting to us are:
-
CC-- the c compiler to use -
CXX-- the c++ compiler to use -
LD-- the linker to use -
CFLAGS-- compilation flag for c source files -
CXXFLAGS-- compilation flags for c++ source files -
CPPFLAGS-- flags for the c-preprocessor (typically include file paths and symbols defined on the command line), used by c and c++ -
LDFLAGS-- linker flags -
LDLIBS-- libraries to link
CPPFLAGS、CFLAGS 和 CXXFLAGS的区别
LDFLAGS 和 LDLIBS的区别
exec:
cd /home/hchen; pwd
“-” 在命令前加上“-”表示忽略错误;还有一个全局的办法是,给make加上“-i”或是“--ignore-errors”参数,那么,Makefile中所有命令都会忽略错误
变量定义"="和“:=”的区别: "="的右值可以使用后面定义的变量,但容易形成无穷递归;":=" 只能使用之前定义好的变量值
调用其他makefile 先cd到目录,然后 && make如下
SUBDIR = ./test2
MAKE = make
subsystem:
cd $(SUBDIR) && $(MAKE)
674

被折叠的 条评论
为什么被折叠?



