Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ifndef CC CC := icc endif override CC := $(CC)
然后的结果
make
是吗CC=cc。make CC=gcc是正确的。
CC=cc
make CC=gcc
如果我更改ifndef为ifdefthenCC=icc并且一切正常。
ifndef
ifdef
CC=icc
它是如何工作的?
CC是默认定义的。所以make等价于make CC=cc。
CC
make CC=cc
您可以完全跳过条件并获得您想要的行为:
override CC := icc