目标模式不包含“%".生成文件 [英] Target pattern contains no '%'. Makefile

查看:608
本文介绍了目标模式不包含“%".生成文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Google中搜索了此问题,但仍然没有解决问题的方法.我有2个Makefile:一个作为示例,一个作为我的文件. 示例:

I have searched this problem in google, but still don't have some way to resolve a problem. I have 2 Makefiles: One as example and one as my file. Example:

BINDDIR=/src/binding
XBUILD=/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
PROJECT_ROOT=XMBindingLibrarySample
PROJECT=$(PROJECT_ROOT)/XMBindingLibrarySample.xcodeproj
TARGET=XMBindingLibrarySample
BTOUCH=/Developer/MonoTouch/usr/bin/btouch

 XMBindingLibrary.dll
libXMBindingLibrarySample-i386.a:
$(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphonesimulator -configuration Release clean build -mv $(PROJECT_ROOT)/build/Release-iphonesimulator/lib$(TARGET).a $@
libXMBindingLibrarySample-armv6.a:
$(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphoneos -arch armv6 -configuration Release clean      build -mv $(PROJECT_ROOT)/build/Release-iphoneos/lib$(TARGET).a $@

libXMBindingLibrarySample-armv7.a:
$(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphoneos -arch armv7 -configuration Release clean build -mv $(PROJECT_ROOT)/build/Release-iphoneos/lib$(TARGET).a $@

libXMBindingLibrarySampleUniversal.a: libXMBindingLibrarySample-armv7.a libXMBindingLibrarySample-i386.a
lipo -create -output $@ $^

XMBindingLibrary.dll: AssemblyInfo.cs XMBindingLibrarySample.cs extras.cs libXMBindingLibrarySampleUniversal.a

$(BTOUCH) -unsafe --outdir=tmp -out:$@ XMBindingLibrarySample.cs -x=AssemblyInfo.cs -x=extras.cs --link-with=libXMBindingLibrarySampleUniversal.a,libXMBindingLibrarySampleUniversal.a

clean:
-rm -f *.a *.dll

我的文件:

My file:

BTOUCH=/Developer/MonoTouch/usr/bin/btouch
BINDDIR=/src/binding
XBUILD=/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
PROJECT_ROOT=IIViewDeckControllerSample
PROJECT=$(PROJECT_ROOT)/IIViewDeckController.xcodeproj
TARGET=IIViewDeckController

all: IIViewDeckController.dll

libIIViewDeckController-i386.a:
$(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphonesimulator -configuration Release clean build -mv $(PROJECT_ROOT)/build/Release-iphonesimulator/lib$(TARGET).a $@

libIIViewDeckController-armv7.a:
$(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphoneos -arch armv7 -configuration Release clean build  -mv $(PROJECT_ROOT)/build/Release-iphoneos/lib$(TARGET).a $@

libIIViewDeckControllerUniversal.a: libIIViewDeckController-armv7.a libIIViewDeckController-i386.a
lipo -create -output $@ $^

IIViewDeckController.dll: AssemblyInfo.cs APIDefinition.cs StructsAndEnums.cs libIIViewDeckControllerUniversal.a
$(BTOUCH) -unsafe  -out:$@ APIDefinition.cs -x=AssemblyInfo.cs -x=StructsAndEnums.cs --link-with=libIIViewDeckControllerUniversal.a,libIIViewDeckControllerUniversal.a

clean:
-rm -f *.a *.dll

使用示例文件,一切正常,我的错误:

With example file everything is OK, with mine I have Error:

Makefile:4: *** target pattern contains no `%'.  Stop.
make: *** [all] Error 2

推荐答案

这是来自Make的错误书写的错误消息.这意味着您的文件名之一具有可能是正则表达式一部分的字符". Make对文件系统和引用非常幼稚.它不相信:

This is a badly written error message from Make. It means "one of your filenames had a character that could be part of a regular expression". Make is very naive about filesystems and quoting. It doesn't believe that:

foo:  'The bar.'

是指文字字符串.它以The作为一个单词,将bar.作为另一个单词,然后在句点上倒钩.改为执行此操作:

refers to a literal string. It takes The as one word, bar. as another word, and then barfs on the period. Do this instead:

foo:  The\ bar\.

,或者在您的情况下,反斜杠到.xcodeproj中的句点.

or in your case, backslash to the period in .xcodeproj.

这篇关于目标模式不包含“%".生成文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆