728x90
$(filter PATTERN...,TEXT)
Returns all whitespace-separated words in TEXT that *do* match any of the
PATTERN words, removing any words that *do not* match. The patterns are written
using %, just like the patterns used in the patsubst function above.
The filter function can be used to separate out different types of strings (such
as file names) in a variable. For example:
sources := foo.c bar.c baz.s ugh.h
foo: $(sources)
cc $(filter %.c %.s,$(sources)) -o foo
says that foo depends of foo.c, bar.c, baz.s and ugh.h but only foo.c,
bar.c and baz.s should be specified in the command to the compiler.
Returns all whitespace-separated words in TEXT that *do* match any of the
PATTERN words, removing any words that *do not* match. The patterns are written
using %, just like the patterns used in the patsubst function above.
The filter function can be used to separate out different types of strings (such
as file names) in a variable. For example:
sources := foo.c bar.c baz.s ugh.h
foo: $(sources)
cc $(filter %.c %.s,$(sources)) -o foo
says that foo depends of foo.c, bar.c, baz.s and ugh.h but only foo.c,
bar.c and baz.s should be specified in the command to the compiler.
728x90
'Research > Programming' 카테고리의 다른 글
gcc 이야기 (0) | 2009.07.22 |
---|---|
$(warning TEXT...) (0) | 2006.01.09 |
외부 프로그램을 실행시키고 출력결과를 가져오려면 ? (0) | 2005.08.23 |
Learn a new trick with the offsetof() macro (0) | 2004.12.31 |
Why do a lot of #defines in the kernel use do { ... } while(0)? (0) | 2004.12.18 |