How to create iPhone static library based on Makefile?

I was able to create a static C library on OSX using make on the command line.

I tried using the same Makefile (with ARCHFLAGS=-arch armv6 -arch armv7 ) to create a static library for iOS, but with an error:

 gcc-4.2: error trying to exec '/usr/bin/arm-apple-darwin10-gcc-4.2.1': execvp: No such file or directory 

I think this does not work, because I use the OSX SDK make instead of some part of the iOS SDK. Any clues?

NB For more information about the library in question (levmar) and the Makefile, see this answer .

+4
source share
2 answers

You need to find:

  • iOS compiler location
  • command line options that are used in a command line call

The easiest way is to create a test application for iPhone / iPad in Xcode, create it, and then look in the build log to see how Xcode calls the compiler.

+1
source

Can you just create an Xcode project and invoke Xcode on the command line or from a script? If you don't need the hassle of maintaining an Xcode project, the easiest way is to use CMake to create an Xcode project, and then invoke Xcode on the command line or from a script. That way you can stay in the text file and in the script domain all the time.

0
source

All Articles