I heard about Jamfiles? Read some information which claimed they were better and easier to use than makefiles. So I tried to write one that would compile and link a simple hello world program. After two hours I went to bed and was never able to create a Jamfile that would work.
Has anyone ever written a Jamfile? If you have I would appreciate an example.
The idea is that you have more abstract options than makefile where as in a makefile, you execute everything using something similar to bash and even have to create a line that calls the compiler you want itself using different variables. There's nothing wrong with this although it can be VERY large and sometimes a lot more complex than we want it to be. Jam apparently claims to fix this for even the biggest n00b5 to figure out.
I worked with jamfiles for a day--and they are not easier; whether or not they are better for complicated builds I could not say, but as far as I am concern makefiles work just fine for my own personal use.
I've seen Makefiles scalled quite well to large projects but I couldn't tell you how Jamfiles would scale. The website says they're scalable and all, but the larger examples I saw looked no better than Makefiles.
What do they do about the performance hit of generating dependencies? I'm assuming there's a way to keep it from going through and regenerating them every build, right?
Jamfiles have two significant advantages over Makefiles:
- they do not rely upon the underlying system (particularly the available shell)
- they have a higher-level organization
That said, my projects are usually simple enough that I just use a couple of Makefiles - one for Win32 and one for POSIX.
I'm going to include a Jamfile in my next project and see how it works out and get some feedback. Now if only I could find someone to use my software....
This stuff is actually pretty annoying: http://www.perforce.com/perforce/conferences/us/2001/wingerd/WPLaura.pdf
X = foo.c;
This is an incomplete statement that will cause a syntax error, or worse, unexplainable
results. When Jam reads this it will set the value of X to “foo.c;” plus whatever happens
to be on the next line. Why? Because there is no whitespace before the semicolon that is
meant to end the statement.
I glanced over a little information about them for a few minutes, and I'm left with the question: What makes Jamfiles any better than Makefiles?
From the examples I've seen, Jamfiles look even more cryptic than Makefiles!
I used bjam for a large project, and it worked well. The built-in dependency checker meant we could use parallel builds without much effort. It brought compilation times down from hours to minutes. So the developers could be a lot more productive.