How to implement built-in function as below
Text-processing function
https://www.gnu.org/software/make/manual/html_node/Text-Functions.html#Text-Functions
$(patsubst %.c,%.o,x.c.c bar.c)
Result: ‘x.c.o bar.o’
$(sort foo bar lose)
Result:‘bar foo lose’
$(word 2, foo bar baz)
Result:‘bar’
Filename manipulate function
https://www.gnu.org/software/make/manual/html_node/File-Name-Functions.html
$(dir src/foo.c hacks)
Result:‘src/ ./’
$(notdir src/foo.c hacks)
Result:‘foo.c hacks’
$(suffix src/foo.c src-1.0/bar.c hacks)
Result:‘.c .c’
$(addprefix src/,foo bar)
Result:‘src/foo src/bar’
No comments:
Post a Comment