Makeのaddprefix関数を見てください。
addsuffixと一緒に使用して、objファイルをソースの下にある1つのディレクトリ の下に置く例を示します。
SOURCE += MainThread.cpp
SOURCE += Blah.cpp
OBJ=$(join $(addsuffix ../obj/, $(dir $(SOURCE))), $(notdir $(SOURCE:.cpp=.o)))
メイクマニュアルから: http://www.gnu.org/software/make/manual/make.html
$(addprefix prefix,names...)
The argument names is regarded as a series of names, separated by whitespace;
prefix is used as a unit. The value of prefix is prepended to the front of each
individual name and the resulting larger names are concatenated with single
spaces between them. For example,
$(addprefix src/,foo bar)
produces the result `src/foo src/bar'.
ああありがとう!私はaddprefix/addsuffix関数について知っていましたが、私は結合関数が欠けていました... – dm76
私はdm76のassesmentに同意します。実際にこの素晴らしい答えのキー値はjoin()です。 –