makefile

1 .PHONY
.PHONY:clean #定义伪目标
  rm 1.txt
2. 条件分支ifeq
ifeq ($(CC),gcc)
  $(CC) -o foo $(objects) $(libs_for_gcc)
else
  $(CC) -o foo $(objects) $(normal_libs)
endif
3 ifneq
4 ifdef <variable-name>; #variable-name非空,执行
5 ifndef
6 赋值= := ?= += 

https://blog.csdn.net/more_thinking/article/details/119521669

7  $(filter PATTERN…,TEXT)   $(filter-out PATTERN…,TEXT) 

$(ad dprefix src/,foo bar)  返回值为“src/foo src/bar”。

posted @ 2023-04-17 10:38  MoonXu  阅读(12)  评论(0编辑  收藏  举报