I have some search patterns that fits poorly as part of a file name for the result. I therefore split the regular expression and the corresponding file name part into two different variables like below. How can I automate the following so that I do not have to manually list files for ALL and also do not have to manually enter the rules running grep?
SEARCH_RE = test a/b/c a.*b
SEARCH_FILE = test abc ab
ALL = result.test result.abc result.ab
all: $(ALL)
result.test:
grep test inputfile > result.test
result.abc:
grep a/b/c inputfile > result.abc
result.ab
grep a.*b inputfile > result.ab