makefiles

Started by
3 comments, last by Scourage 15 years, 4 months ago
Anyone got a link to a good place to learn about makefiles, the make command, macros, and all that? Tutorials? Something that assumes you've only used g++ blah.cpp -o blah -lSDL -lSDL_image from the command line all your life and you've never used a makefile ever.
Advertisement
I would strongly recommend that you forgo traditional *nix style makefiles. Once you start writing makefiles, you'll want to start writing configuration scripts, and before you know it you'll be in autotools hell. Instead I suggest you learn something like CMake (actually I recommend CMake itself). I find that this greatly simplifies the task of configuring and making my code across a variety of different platforms (both *nix and not). CMake is a makefile generator. You basically write a file from which the CMake tool will generate the appropriate makefile for the underlying platform. I've also heard good things about SCons (a Python based make system), but I've never used it myself. Anyway, I suggest you try one of these other tools instead, and save yourself from the headache of a autoconf/make system.

Cheers,
Rob
Not off the top of my head, but google.
Scons is very nice, and the samples are relatively easy to follow.
Bjam and it's cousins (jam, jam++, etc) are alternatives.

Cheers,

Bob

[size="3"]Halfway down the trail to Hell...

This topic is closed to new replies.

Advertisement