Quote:Original post by EmptyVoid
Ok how do I make a SDK?
Wow. That's a
huge question.
An SDK - a
software
development
kit - is a collection of tools, utilities, dynamic libraries, static import libraries and source code to assist and/or enable developers to create solutions that target a specific platform. That platform can be an operating system (eg, Windows SDK), a set of interfaces that abstract access to resources like hardware (eg, DirectX SDK), or even a single application (eg, Maya SDK). An SDK is authored the same way you author any collection of code and applications - that is not your problem. Your problem is that you don't fundamentally know what you are doing.
Let's start at the beginning. What do you want to accomplish? From your posts, it appears you want to create an extension mechanism for an application (eg, your game) that works across platforms - Windows, OS X, Linux. The first thing you need to realize is that these are three separate products - three separate applications compiled specifically to those operating system platforms, and a similar/identical extension mechanism across all three.
The following assumes you're writing your game in either C or C++.
Let's say you've written a game for Windows, using an abstraction toolkit like SDL so that your game builds under Linux simply by recompiling. You now want to add to your game the ability to load new functionality from a dynamic library or shared object present in a specific folder. For Windows, you need to call LoadLibrary to open the dynamic library, then GetProcAddress to obtain the address of a particular function implemented in it; for Linux and OS X (after 10.3), you need to call dlopen to load the shared object, then dlsym to obtain the address of a symbol defined in the library. C and C++ support the notion of conditional compilation via the preprocessor: you can check for the existence of platform-specific symbols and cause different branches of code to be compiled as a consequence.
#ifdef _WIN_VER // Windows LoadLibrary(...); ... GetProcAddress(...); ...#elseif __APPLE__ // Mac OS dlopen(...); ... dlsym(...); ...#elseif __linux__ // take a wild guess dlopen(...); ... dlsym(...); ... // despite calling the same function, the parameters for Linux may differ // from Mac OS X, so we separate those platforms as well#else // you can disable the application from loading plugins, or whatever#endif
But what if you don't want to mess about with platform-specific dynamic library techniques? Well, then you actually have to do more upfront work to simplify things on the end. Say you want to create something comparable to the
Maya Embedded Language; then you need to create the plugin language (or pick one - there are dozens of extension and embeddable languages), build/select the compiler, integrate it into the toolchain used by your developers (including your end users if you allow them to develop plugin and extensions), and then embed an interpreter or other mechanism to parse the compiled object files within your application.
As you can see, there is a lot you need to do. Get busy, and good luck!