2014-11-24 67 views
1

里面的cp命令括号我有这样的Makefile:如何逃脱一个Makefile

VAR=foo(1).txt foo(2).txt 
foobar: $VAR 
    cp -p $^ foo/  

当我运行它,我得到这个错误:

$ make test 
/bin/sh: -c: line 0: syntax error near unexpected token `(' 
/bin/sh: -c: line 0: `cp -p foo(1).txt foo(2).txt foo/' 
Makefile:3: recipe for target 'foobar' failed 
make: *** [test] Error 1 

如何快速摆脱它?

+1

一样吗? (1).txt foo \(2 \).txt out'或'cp“foo(1).txt”“foo(2).txt”out' ... – Kevin 2014-11-24 17:52:18

+2

将名称更改为不有他们的父亲 – 2014-11-24 17:54:25

+0

@JarrodRoberson好点但我不能改变这些名字:( – nowox 2014-11-24 17:59:21

回答

0

您可以在双引号

cp "foo(1).txt" "foo(2).txt" /out 

测试缠住的文件名

$ cp "foo(1).txt" "foo(2).txt" out/ 
$ ls out/ 
foo(1).txt foo(2).txt 

或者更安全会

你逃避什么
cp 'foo(1).txt' 'foo(2).txt' out/