Context:
I have downloaded the source code for “Discount”, which is a simple C program. The code is online here: http://www.pell.portland.or.us/~orc/Code/discount/
What I Need:
I want to turn this code into a .dylib file that I can then bundle with my Cocoa app. Once I HAVE the dylib file, I’m fine. What I’m struggling with is how to CREATE the dylib file in the first place.
Before you yell at me, YES I have Googled my ass off. But I cannot find a straightforward explanation of exactly what I need to do at the command line to compile this collection of C source files into a .dylib. Everything I come across is convoluted or talks about building a dylib project in Xcode or is outdated. (I’ve found some references for doing it with GCC, but I’d like to use LLVM.)
Make Install
From what I gather, running the typical “make install” is supposed to put a .dylib file into /usr/lib, but that does not seem to be happening for me.
Bottom Line:
Once I’ve downloaded the Discount source code, what do I need to do at the command line to create a .dylib file on OS X 10.8.2? Thank you.
That project by default doesn’t create a dynamic library on Mac OS X. I made a quick patch to the makefile that seems to work:
You can apply that to your tree after running the configure script and before building and it should work out. If you just want the easy part, running:
on your command line after building the regular package should generate the dynamic library for you. You can then install it yoursef.