Reputation: 9878
I have a line in my Makefile that's about something like that:
prog /something/f.{one,two,three}
but running the make file I get from prog that
/something/f.{one,two,three}
does not exist. Which leads me to believe that make
is not expanding the glob. Normally this would work for me in Bash but I'm running zshell now so I think that's the problem. Anyone know how to specify that pattern portably?
Upvotes: 1
Views: 788
Reputation: 49543
An alternative to what ThePosey suggested would be making use of addprefix
:
FILE_SUFFIXES := one two three
FILE_BASE := /something/f
FILES := $(addprefix $(FILE_BASE).,$(FILE_SUFFIXES))
my_rule:
prog $(FILES)
Upvotes: 1
Reputation: 2734
Does it have to be shell expanded? Make can do something similar for you. This is just one way to do it:
EXPANDED_POSTFIX := one two three
BASE_FILE := f.
PROG_FILE_LIST := $(foreach post,${EXPANDED_POSTFIX},${BASE_FILE}${post})
exec_prog:
prog ${PROG_FILE_LIST}
Upvotes: 1