Managing Projects with GNU Make 49
sarumont writes "Every Open Source developer uses or has used GNU make at some point or another. Everyone who has ever compiled a piece of Open Source software has used GNU's make. So what exactly is GNU make and how does it work? The 3rd Edition of 'Managing Projects with GNU Make' tells you all about using GNU make and more."
Quite the assumption (Score:4, Informative)
you might try these guys.
www.virtualdub.org [virtualdub.org]
www.dscaler.org [dscaler.org]
And many [sourceforge.net] more. [sourceforge.net]
Open source on windows, OMG it does exist!!!!
Step out of your Linux bubble.
Or anything in Java, or course (Score:3, Informative)
I'm sorry, what was this article about?
Re:Or anything in Java, or course (Score:2)
Re:Quite the assumption (Score:4, Insightful)
Re:Quite the assumption (Score:2)
I just wanted to point out that not all open source development is done on linux.
The fact that the author thought that all open source developement has something to do with GNU shows he is just another close minded linux fanboy.
While arguably we can thank GNU for the existence of the free software movement, since then it has branched
Re:Quite the assumption (Score:3, Insightful)
I'm not so sure about that. Certainly, SF is a site for open source-software, and a lot of OSS is *nix-centric (since, well, the most popular
Re:Quite the assumption (Score:2)
Re:Quite the assumption (Score:5, Insightful)
Open source on windows, OMG it does exist!!!!
Step out of your Linux bubble.
What's [cygwin.com] Linux-centric [sourceforge.net] about [mingw.org] GNU make [freebsd.org]?
I'm primarily a Windows user, and I used to use GNU make all the time. Until I realised I preferred omake [metaprl.org].
Re:Quite the assumption (Score:2)
Re:Java? (Score:3, Insightful)
Significant, invisible characters like tab? Just say no. And that's just the start of your problems...
I still have nightmares.
SCons is much better than GNU Make (Score:5, Informative)
SCons has automatic dependency checking built in, supporting many kinds of source files, but if it doesn't have what you need it can be easily extended.
SCons remembers the command line used to compile/build a given file, so it automatically figures out that it should rebuild that file if the command line arguments change. With Make it is very difficult to do that, so "make clean" is used much more often than it should be needed.
SCons is written in Python, and the SConstruct files it uses analagously to Makefiles are fundamentally Python scripts, but you don't need to know Python to use SCons. However, if you do know Python you can easily extend SCons.
SCons integrates well with Steven Ellis' 'nc' network compilation tool [brouhaha.com] (though nc works with make also).
Re:SCons is much better than GNU Make (Score:2)
much easier to use over make.
I'm not going to look back.
Re:SCons is much better than GNU Make (Score:5, Interesting)
SCons remembers the command line used to compile/build a given file, so it automatically figures out that it should rebuild that file if the command line arguments change. With Make it is very difficult to do that, so "make clean" is used much more often than it should be needed.
There are a couple other reasons "make clean" is used more often than it should:
SCons is written in Python, and the SConstruct files it uses analagously to Makefiles are fundamentally Python scripts
...which is wonderful. The thing about make is that you have to be familiar with so many different syntaxes and APIs to do the simplest thing. There's the shell + make + m4 + autoconf's libraries (workarounds for non-portable shell utilities) + automake's libraries. It's a huge pain, because there's not a single place to look things up. You have to find the appropriate shell utility...then check in the autoconf/automake documentation to see if there are portability wrappers. scons is simpler; you can find most stuff with just their manpage, and possibly Python's documentation when you need to do actual programming in the build system. One (very simple) syntax. Two sources of API documentation.
The autoconf/automake system is nice in that it makes no assumptions about the user's system beyond make - everything is just generated to plain shell scripts and makefiles. But it's such a pain for the developer that it's not worth it. SCons assumes the user has a working Python installation, which makes everything more pleasant. Python provides the same level of functionality with the same interface on every platform.
Re:SCons is much better than GNU Make (Score:3, Interesting)
This is my biggest (but not only) problem with GNU Make. It does not have support for the theoretically correct way to use it. It's not like the paper is new, or even that the maintainer disagrees with it's findings, but there is no movement at all to add support for the features that would make it easy
Re:SCons is much better than GNU Make (Score:4, Insightful)
It's almost the same as the situation with internet explorer. Until the program with the most market share improves, everyone who cares about working with the marjority of people is stuck with a deficient system.
Re:SCons is much better than GNU Make (Score:2)
Build tools (Score:3, Insightful)
One thing I find quite remarkable is that in a couple of decades, make is still the only mainstream multi-language multi-platform build tool. The alternatives are either not widely used or are language-specific like Ant. With so many people not liking make, it's suprising an alternative tool hasn't really caught on.
Very few original broken tools replaced (Score:2)
Would love to see a distro that replaces sh with python/perl...replaced make with scons etc.,....at least this distro could claim a differentiating point beyond the installer. I would use it.
Re:Very few original broken tools replaced (Score:2)
Re:Very few original broken tools replaced (Score:2)
As for sh this could be done...in fact many distros are using Pythin in many places where sh was once used.
In the end it will take one hugely succesful and unavoidable project to push alternatives. For example, if the kernel itself pushed an alernative to make, this alternative would almost certainly spread t
Re:Very few original broken tools replaced (Score:3, Insightful)
Traditional make is a lowest-common-denominator, however much it sucks. GNU make is slowly becoming widespread enough that it may be a viable alternative.
The auto
There are ways to create portability support (Score:2)
The "stick" approach would be to mandate inclusion in the LSB so that all distros carry the tool. The BSDs and other OSs would certainly follow suit.
I agree its a difficult legacy problem to solve but it is not intractable.
Re:Build tools (Score:2)
It requires J2SE, and it's files are XML. This only makes sense if you are already programming in Java. If a project has no needed dependency on Java, then why force it?
GNU Make vs Solaris/Sys V make (Score:1)
Some applications have problems with the make that ships with Solaris, but most work fine. My statement is is reference to the opening paragraph that states:
"Everyone who has ever compiled a piece of Open Source software has used GNU's make."
Everyone? (Score:3, Insightful)
It is quite possible to compile a piece of Open Source Software without GNU make. It's not easy, to be sure, since there are so many projects out there that require GNU make (automake doesn't help matters much), but it is possible. There is BSD make, Solaris make, Microsoft's strange nmake, and several others. GNU is but one of many, and it's not even the only free make.
The problem is that the make standard is so tepid that to get a decent make you need to extend it. So what we end up in reality is a lack of a make standard. I can write a complete C program that will compile with any standard C compiler. I can write a powerful bourne shell script that runs on any Bourne compliant shell. But to write a Makefile that will work under all makes is quite difficult.
Newer and better alternatives to make (Score:5, Interesting)
1. boost-build v2 [sourceforge.net] is the absolute BEST if you want to build C/C++ projects with multiple compilers & versions & targets--or even on simple projects that require a one-liner to feed into boost-build2 (normally taking 5-20 lines in GNU make).
Upside for boost-build2? Wraps compiler/linker flags in a generic language for many compilers and versions(gcc, msvc, bcc, etc). Also very easy for simple projects but truly shines on huge and complex projects. Jamfiles can inherit properties , requirements, targets, etc. from parent directories. Very very cool.
Downside to boost-build? Documentation truly sucks compared to other tools. Docs getting better but new users should prepare to unexpectedly find features they could've used to avoid hours of effort.
Boost-build v2 uses bjam but there seems to be a plan to add support for Python.
2. Scons [scons.org] is the next best thing to boost-build v2. The underlying language is Python but you don't have to be a Python expert to use it. And the documentation is much better than boost-build v2. However, it takes many more lines to get things done than boost-build v2 (which isn't all that bad considering boost-build v2 can do things in only 5 lines to replace a 40-line gnu makefile).
3. rake [rubyforge.org] is a make-alternative written in Ruby. For all you recent Ruby converts, be sure to check it out. I love Ruby but I gotta admit, I don't see anything out there being better than boost-build v2 today.
GNU make served us well but it is time to move on to better choices that make us more productive. Just like cvs having served us well but svn [slashdot.org] and others being a better choice today.
A-A-P (Score:3, Informative)
tmk (Score:1)
Re:Newer and better alternatives to make (Score:3, Informative)
If you want to use something as easy on developer but which would still require no additional on the users machine, have a look at bakefile [sf.net]. This is a very useful tool, especially for open source programs where users often have or are asked to rebuild the program from source and installing additional tools is just an ext
Ripping DVDs (Score:1)
Re:Ripping DVDs (Score:3, Informative)
The pages are essentially built up from a header file, a sidebar file, a text file (the only bit that changes regularly), and a footer file. The make file scans the directory for all the *.src files, then generates a page for each *.src file, copies it into the right folder as index.html, making the folder if it's not there already. Ea
Everyone? (Score:2)
Pet Peeve: Make abusers (Score:2)
One place I worked, they used a program that was similar (and equivalent) to make. But, rebuilding after one source file changed would recompile all 100 source files. Other components coded the build files correctly.
Another place I have worked uses gnu make. They rebuild a minimum of one file from each source directory during every build. This causes quite a bit of visual cruft - and makes it more likely that warnin