1. 程式人生 > >makefile中的patsubst函數有何作用?

makefile中的patsubst函數有何作用?

模式替換 clas 內容 replace file pla makefile repl 格式

答:這是個模式替換函數,格式為:

$(patsubst <pattern>,<replacement>,<text>) 

  查找text中的單詞,如果匹配pattern,那麽就用replacement的內容替換

  舉例:

  $(patsubst %.c,%.o,jello1.c jello2.c)

  那麽將會替換成jello1.o jello2.o

makefile中的patsubst函數有何作用?