makefile filter
时间: 2023-09-25 08:10:56 浏览: 142
跟我一起编写makefile
As an AI language model, I don't have access to your local machine to create a makefile filter. But, I can provide you with some information about how to use filters in makefiles.
Makefile filters are used to manipulate text strings in makefiles. Filters can be used to modify variable values, file names, or any other text strings in a makefile.
Here are some examples of filters in makefiles:
1. $(filter pattern, text)
This filter selects all words in the text that match the pattern. For example, $(filter %.c, foo.c bar.o baz.c) will return foo.c baz.c.
2. $(wildcard pattern)
This filter expands the pattern to a list of file names that match the pattern. For example, $(wildcard *.c) will return a list of all the .c files in the current directory.
3. $(patsubst pattern, replacement, text)
This filter replaces all occurrences of the pattern in the text with the replacement. For example, $(patsubst %.c, %.o, foo.c bar.c) will return foo.o bar.o.
4. $(subst from, to, text)
This filter replaces all occurrences of from in the text with to. For example, $(subst x, y, axbxc) will return aybyc.
These are just a few examples of filters in makefiles. There are many other filters available, and you can even create your own custom filters. Filters can be a powerful tool for manipulating text in makefiles, and they can help make your build process more efficient and flexible.
阅读全文