Reputation: 8604
In a GNU makefile, I need to rename
/infiles/signal_*.wav
to
/outfiles/out_signal_*.wav
This works (using subst):
SIGNALIN += $(wildcard /infiles/signal_*.wav)
TEMP += $(subst infiles,outfiles, $(SIGNALIN) )
SIGNALOUT += $(subst signal,out_signal, $(TEMP) )
Is there a better, one-line way that would not include the TEMP
line?
Upvotes: 0
Views: 24
Reputation: 29177
In your case there are not really replacements at two places. What you want is replace /infiles/
at the beginning of each word by /outfiles/out_
. And that's one place. Try:
SIGNALOUT := $(patsubst /infiles/%,/outfiles/out_%,$(SIGNALIN))
Upvotes: 0
Reputation: 189447
You can wrap function calls:
SIGNALOUT += $(subst signal,out_signal,$(subst infiles,outfiles,$(SIGNALIN)))
Upvotes: 1