makefile filter-out
时间: 2023-08-04 11:08:25 浏览: 57
Sure, I can help with that!
The `filter-out` function in a Makefile is used to remove certain strings from a list of strings.
Here's an example of how to use `filter-out` in a Makefile:
```
# Define a list of files
FILES := file1.txt file2.txt file3.dat file4.pdf
# Remove all files with a .pdf extension
PDF_FILES := $(filter-out %.pdf,$(FILES))
# Print the filtered list of files
all:
@echo $(PDF_FILES)
```
In the above example, the `filter-out` function removes all files with a `.pdf` extension from the `FILES` list and stores the resulting list in the `PDF_FILES` variable.
The resulting output when running `make` would be:
```
file1.txt file2.txt file3.dat
```
Let me know if you have any further questions!