Took me a little while to figure this out myself, only I was already using SDL and was transitioning from C to C++ on Lion. Its not just the makefile that is the issue here, its probably your source file as well...
Download SDL-version.tar.gz
Extract and run at prompt
./configure --prefix=/home/user/SDL && make && make install
Assuming everything actually built, you now can use the sdl-config to build your source by executing:
g++ Main.cpp -o Main `/home/user/SDL/sdl-config --cflags --libs` \
-framework OpenGL -framework Cocoa
which is the same as
g++ Main.cpp -o Main -I/home/user/SDL/include \
-L/home/user/SDL/lib -lSDLmain -lSDL -framework OpenGL -framework Cocoa
Now the key here is that you are using C++... for SDL macros to correctly replace your main, you need to prevent the C++ compiler from mangling you main function call. To do this declare your main like the following:
extern "C" int main(int argc, char ** argv)
{
}
If you don't include the extern "C" stuff, C++ will change the name of your main function and SDL won't be able to automatically find it. If you don't use the int main(int argc, char ** argv) function signature, C++ will complain about type mismatches... so you've got to do it verbatim. (If using GCC, you exclude the extern "C" portion)
Chenz