コロンを含むファイル名で GNU make を正しく動作させる方法はありますか?
私が直面している特定の問題には、たまたまパターン ルールが関係しています。タブ文字の切り取りと貼り付けに依存しない単純化されたバージョンを次に示します。
% make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-redhat-linux-gnu
% cat Makefile
COLON := \:
all: ; true
%.bar: ; cp $< $@
x.bar: x.foo
%.foo: ; touch $@
a$(COLON)b.bar: a$(COLON)b.foo
all: x.bar a$(COLON)b.bar
clean: ; rm -f *.foo *.bar
% make clean
rm -f *.foo *.bar
% make
touch x.foo
cp x.foo x.bar
cp a\:b.bar
cp: missing destination file operand after `a:b.bar'
Try `cp --help' for more information.
make: *** [a\:b.bar] Error 1
$(COLON) をリテラル : に置き換えると、まったく同じ結果が得られます。バックスラッシュがないと、次のようになります。
Makefile:6: *** target pattern contains no `%'. Stop.