无法使用make命令

时间:2016-02-26 06:54:42

标签: ios objective-c swift makefile

我的Makefile如下所示,它给出了make:

的错误
  

未指定目标且未找到makefile。停止。

XBUILD=/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
PROJECT_ROOT=/Users/AshrafMac/Desktop/iOSSDK/
PROJECT=$(PROJECT_ROOT)/InfColorPicker.xcodeproj
TARGET=/Users/AshrafMac/Desktop/iOSSDK/

all: libInfColorPickerSDK.a

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

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

libInfColorPickerSDK.a: libInfColorPicker-i386.a libInfColorPicker-armv7.a
    xcrun -sdk iphoneos lipo -create -output $@ $^

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

无法使用make命令创建ios静态库.a文件。

1 个答案:

答案 0 :(得分:0)

  

xcodebuild -project' MyProject.xcodeproj ' -configuration'发布'   -sdk' iphoneos9.3 '干净的建筑ARCHS =' armv7 armv7s' IPHONEOS_DEPLOYMENT_TARGET =' 5.0' TARGET_BUILD_DIR =' ./建立臂'   BUILT_PRODUCTS_DIR =' ./建立臂'

     

xcodebuild -project' MyProject.xcodeproj ' -configuration'发布'   -sdk' iphoneos9.3 '干净的建筑ARCHS =' arm64' IPHONEOS_DEPLOYMENT_TARGET =' 6.0' TARGET_BUILD_DIR =' ./集结arm64'   BUILT_PRODUCTS_DIR =' ./集结arm64'

     

xcodebuild -project' MyProject.xcodeproj ' -configuration'发布'   -sdk' iphonesimulator9.3 '干净的建筑ARCHS =' i386' IPHONEOS_DEPLOYMENT_TARGET =' 5.0' TARGET_BUILD_DIR =' ./建立-I386'   BUILT_PRODUCTS_DIR =' ./建立-I386'

     

xcodebuild -project' MyProject.xcodeproj ' -configuration'发布'   -sdk' iphonesimulator9.3 '干净的构建ARCHS =' x86_64' VALID_ARCHS =' x86_64的' IPHONEOS_DEPLOYMENT_TARGET =' 6.0'   TARGET_BUILD_DIR =' ./集结x86_64的' BUILT_PRODUCTS_DIR =' ./集结x86_64的'

     

lipo -create' ./ build-arm / MyProject.a '   ' ./集结arm64 /的 MyProject.a ' ' ./建立-I386 /的 MyProject.a '   ' ./集结x86_64的/的 MyProject.a ' -output' Mylibrary.a '

执行 TERMINAL 中的上述代码。 在上面的代码中, MyProject.xcodeproj 应替换为您的Xcode项目名称, iphoneos9.3 应由Xcode替换为最大支持的部署目标(例如我正在使用Xcode 7.3.1及其支持的最大部署为9.3见: YourProject>> target>>> General标签