Project managment tools
Last edited November 14, 2006
More by Maxim Veksler »
http://web.archive.org/web/20050204161816/http://www.linuxforums.org/news/article-31869.html

Book Review: Managing Projects With GNU Make -- 3rd Edition

Posted by lakerdonald at Thu Jan 20, 2005 12:28 am

Managing Projects with GNU Make -- 3rd Edition
Robert Mecklenburg
O'REILLY Media Inc.
ISBN 0-596-00610-1


Acknowledgments
I'd like to thank O'REILLY Media for cheerfully providing a copy of GNU Make for my review.

Overview
There are many utilities available to help aid in the organization and compilation of source files into a full, finished executable. GNU Make is one of the more popular flavors of the most common of these utilities, Make. Make is available for a myriad of Operating Systems, including Windows, Unix, and, of course, Linux, where GNU Make is the standard. This extensive book covers the effective creation of Makefiles, the configuration files used by Make to tell what to do with which files. The way this book is laid out was a refreshing change for me. Unlike most books, which waste a chapter (sometimes two) just telling you what they are going to tell you, Managing Projects with GNU Make dives right in with a sample Makefile in the first chapter. The rest of the chapters then add on progressive levels of detail, with the introduction of more advanced features, such as macros, and finishes off with a few fullblown Makefiles, including the Makefile for GNU Make itself.

Content
The content of this book can be described with two words: rock solid. This means it's a book filled to the brim with useful information. This is what sets Managing Projects With GNU Make apart from other computer books and reference manuals. There are plenty of tomes of information out there, but much of the content is extraneous and esoteric. GNU Make is relevant, concise, and to the point. Robert Mecklenburg did a very nice job in writing this book as well. I actually read through the first half of this book away from the computer. The quality is that of a novel meant to be read for pleasure. When I did get access to a computer to try what I had learned, it was amazing. This stuff really worked; and worked well, too.

The Book Itself
As boring as technical reference books, manuals and the like can be, GNU Make tries to spread out the tables, figures and other points of reference among well thought out explanations. You don't have to be a computer techie to read this book, but unfortunately, with a subject such as the 'make' utility, you have to be rather technically inclined to appreciate it.
Managing Projects With GNU Make covers a very wide variety of topics, running the full gamut of platforms, architectures, and languages. The task of writing the third edition would not have been one to be taken lightly. GNU Make not only spans all of these areas, it does them in a orderly, logical manner which helps GNU Make serve as a nice reference guide, as well as something to read from cover to cover. With such a broad area to cover, it would be easy for an author to either get lazy and just skim them over, or try to give each one a chapter of its own. Instead, Robert Mecklenburg covered the minutiae within the language independent sections and gave the major programming languages chapters of their own in Part II, which includes other specialized topics (the three languages Java, C, and C++ were divided into two chapters, Java and C/C++).

Pros
-Concise and to the point
-Interesting
-Well written
-Accurate information
-Interesting insight from the author's personal experiences
-Not bogged down in minutiae

Cons
It was really hard to find much negative to say about it, however I had two major gripes:
-It needed a more thorough proofing/editing (there were several typos, which is a pet peeve of mine)
-The suggested retail price of $29.95 is a bit high for a book under 200 pages.

The Bottom Line

I give Managing Projects With GNU Make four and a half penguins out of five. If it weren't for the typographical errors, GNU Make would have been perfect.
--Andy Kissner

  1. freshmeat.net: Category Reviews - Make alternatives

    Summary article of build (development) related tools

  2. GNU Autoconf, Automake and Libtool

    GNU build system - Documentation by redhat

  3. Software Construction and Management Tools

    Links for various tools by shlomi fish

  4. The BuildBot

    Development build server on Linux

  5. Learning the GNU development tools:

    Software development tools from GNU

  6. Tutorial - Makefile

    Makefile format explained

  7. Learning the GNU development tools

    Learning the GNU development tools

  8. GNU autoconf Mini-HOWTO

    GNU autoconf Mini-HOWTO

  9. Recursive Make Considered Harmful

    Make in recursive form info

 

3. Portage Features

Content:

3.a. Portage Features

Portage has several additional features that makes your Gentoo experience even better. Many of these features rely on certain software tools that improve performance, reliability, security, ...

To enable or disable certain Portage features you need to edit /etc/make.conf's FEATURES variable which contains the various feature keywords, separated by white space. In several cases you will also need to install the additional tool on which the feature relies.

Not all features that Portage supports are listed here. For a full overview, please consult the make.conf man page:

Code Listing 1: Consulting the make.conf man page

$ man make.conf

To find out what FEATURES are default set, run emerge --info and search for the FEATURES variable or grep it out:

Code Listing 2: Finding out the FEATURES that are already set

$ emerge --info | grep FEATURES

3.b. Distributed Compiling

Using distcc

distcc is a program to distribute compilations across several, not necessarily identical, machines on a network. The distcc client sends all necessary information to the available distcc servers (running distccd) so they can compile pieces of source code for the client. The net result is a faster compilation time.

You can find more information about distcc (and how to have it work with Gentoo) in our Gentoo Distcc Documentation.

Installing distcc

Distcc ships with a graphical monitor to monitor tasks that your computer is sending away for compilation. If you use Gnome then put 'gnome' in your USE variable. However, if you don't use Gnome and would still like to have the monitor then you should put 'gtk' in your USE variable.

Code Listing 3: Installing distcc

# emerge distcc

Activating Portage Support

Add distcc to the FEATURES variable inside /etc/make.conf. Next, edit the MAKEOPTS variable to your liking. A known guideline is to fill in "-jX" with X the number of CPUs that run distccd (including the current host) plus one, but you might have better results with other numbers.

Now run distcc-config and enter the list of available distcc servers. For a simple example we assume that the available DistCC servers are 192.168.1.102 (the current host), 192.168.1.103 and 192.168.1.104 (two "remote" hosts):

Code Listing 4: Configuring distcc to use three available distcc servers

# distcc-config --set-hosts "192.168.1.102 192.168.1.103 192.168.1.104"

Don't forget to run the distccd daemon as well:

Code Listing 5: Starting the distccd daemons

# rc-update add distccd default
# /etc/init.d/distccd start

3.c. Caching Compilation

About ccache

ccache is a fast compiler cache. When you compile a program, it will cache intermediate results so that, whenever you recompile the same program, the compilation time is greatly reduced. In common compilations this can result in 5 to 10 times faster compilation times.

If you are interested in the ins and outs of ccache, please visit the ccache homepage.

Installing ccache

To install ccache, run emerge ccache:

Code Listing 6: Installing ccache

# emerge ccache

Activating Portage Support

Open /etc/make.conf and add ccache to the FEATURES variable. Next, add a new variable called CCACHE_SIZE and set it to "2G":

Code Listing 7: Editing CCACHE_SIZE in /etc/make.conf

CCACHE_SIZE="2G"

To check if ccache functions, ask ccache to provide you with its statistics. Because Portage uses a different ccache home directory, you need to set the CCACHE_DIR variable as well:

Code Listing 8: Viewing ccache statistics

# CCACHE_DIR="/var/tmp/ccache" ccache -s

The /var/tmp/ccache location is Portage' default ccache home directory; if you want to alter this setting you can set the CCACHE_DIR variable in /etc/make.conf.

However, if you would run ccache, it would use the default location of ${HOME}/.ccache, which is why you needed to set the CCACHE_DIR variable when asking for the (Portage) ccache statistics.

Using ccache for non-Portage C Compiling

If you would like to use ccache for non-Portage compilations, add /usr/lib/ccache/bin to the beginning of your PATH variable (before /usr/bin). This can be accomplished by editing .bash_profile in your user's home directory. Using .bash_profile is one way to define PATH variables.

Code Listing 9: Editing .bash_profile

PATH="/usr/lib/ccache/bin:/opt/bin"

3.d. Binary Package Support

Creating Prebuilt Packages

Portage supports the installation of prebuilt packages. Even though Gentoo does not provide prebuilt packages by itself (except for the GRP snapshots) Portage can be made fully aware of prebuilt packages.

To create a prebuilt package you can use quickpkg if the package is already installed on your system, or emerge with the --buildpkg or --buildpkgonly options.

If you want Portage to create prebuilt packages of every single package you install, add buildpkg to the FEATURES variable.

More extended support for creating prebuilt package sets can be obtained with catalyst. For more information on catalyst please read the Catalyst Reference Manual and Catalyst Frequently Asked Questions.

Installing Prebuilt Packages

Although Gentoo doesn't provide one, you can create a central repository where you store prebuilt packages. If you want to use this repository, you need to make Portage aware of it by having the PORTAGE_BINHOST variable point to it. For instance, if the prebuilt packages are on ftp://buildhost/gentoo:

Code Listing 10: Setting PORTAGE_BINHOST in /etc/make.conf

PORTAGE_BINHOST="ftp://buildhost/gentoo"

When you want to install a prebuilt package, add the --getbinpkg option to the emerge command alongside of the --usepkg option. The former tells emerge to download the prebuilt package from the previously defined server while the latter asks emerge to try to install the prebuilt package first before fetching the sources and compiling it.

For instance, to install gnumeric with prebuilt packages:

Code Listing 11: Installing the gnumeric prebuilt package

# emerge --usepkg --getbinpkg gnumeric

More information about emerge's prebuilt package options can be found in the emerge man page:

Code Listing 12: Reading the emerge man page

$ man emerge

3.e. Fetching Files

Parallel fetch

When you are emerging a series of packages, Portage can fetch the source files for the next package in the list even while it is compiling another package, thus shortening compile times. To make use of this capability, add "parallel-fetch" to your FEATURES.

Userfetch

When Portage is run as root, FEATURES="userfetch" will allow Portage to drop root privileges while fetching package sources. This is a small security improvement.

[ << ] [ < ] [ Home ] [ > ] [ >> ]


Gentoo Developer Handbook

Content:

  • Introduction
    This part covers aspects which apply to most areas of Gentoo development. This section is only really relevant if you are a Gentoo developer; otherwise you should skip this.
    1. Introduction
      This section outlines the purpose of the Gentoo Developer Handbook.
    2. Becoming a developer
      This section aims to explain how one can become a Gentoo developer.
    3. What you get
      This section outlines what services are available to Gentoo developers.
    4. Help for new developers
      This section provides help and instructions for new developers.
    5. Developer hierarchy
      This section outlines the hierarchy of Gentoo Developers and development.
  • Guides
    This section outlines and explains various development processes and provides standards for Gentoo developers.
    1. Ebuild HOWTO
      This section describes the Gentoo Linux Portage system, how to create new packages for Gentoo, and is also meant to be somewhat of a standard for the Gentoo Developers. It is a work in progress, and is constantly being updated and changed. It is by no means complete. You should always use this in conjunction with the manpages provided by portage (especially ebuild(5)) and the Gentoo Linux Development Policy.
    2. Eclass HOWTO
      This section aims to provide developers with a guide detailing how eclasses work and how they can be applied to ebuilds.
    3. Common ebuild Mistakes
      This section explains the frequent ebuild writing and submission mistakes made by contributors and developers.
    4. Gentoo Metadata
      This section explains the use and need of metadata.xml that is used within the Portage tree.
    5. Ebuild Maintenance HOWTO
      This section describes how developers would perform common tasks when maintaining ebuilds in the Portage tree.
    6. Manifest Signing Guide
      This section describes how developers can sign Manifests in the Portage tree using GPG.
  • Policies
    This part covers the different policies which we expect developers to abide when committing items to CVS.
    1. Ebuild policy
      This section outlines the ebuild policy which every ebuild in Portage must follow.
    2. Etiquette policy
      This section outlines the etiquette policy for Gentoo developers.
 
 
autodep A program for automatically detecting compile-time dependancies between C, C++, and Java source files from a compiler run - as you compile. It saves its dependancies in a format which can be included into Makefiles. First release version (0.2.0) only works on Linux; Solaris support is due soon.
Licence: GPL
Stable version: 0.2.0
Development version: 0.3.0
Binary (i386-linux): autodep-0.2.0-i586-linux.tgz
RPM (i386-linux): autodep-0.2.0-1.i386.rpm
Binary (sparc-solaris): Real Soon Now
Source: autodep-0.2.1-src.tgz
Home Page: No, but there's a man page

maketool
Maketool is a simple GTK based GUI front end for GNU make. Figures out what targets are available and presents them in a menu. Runs make and detects compiler errors in the output, allowing you to click on the errors to edit the corresponding source.
Maketool has its own page now.
Home Page: here.
The content on this page is provided by a Google Notebook user, and Google assumes no responsibility for this content.