Managing Projects with GNU Make: The Power of GNU Make for Building Anything

Managing Projects with GNU Make: The Power of GNU Make for Building Anything

by Robert Mecklenburg
Managing Projects with GNU Make: The Power of GNU Make for Building Anything

Managing Projects with GNU Make: The Power of GNU Make for Building Anything

by Robert Mecklenburg

eBook

$23.99  $31.99 Save 25% Current price is $23.99, Original price is $31.99. You Save 25%.

Available on Compatible NOOK Devices and the free NOOK Apps.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

The utility simply known as make is one of the most enduring features of both Unix and other operating systems. First invented in the 1970s, make still turns up to this day as the central engine in most programming projects; it even builds the Linux kernel. In the third edition of the classic Managing Projects with GNU make, readers will learn why this utility continues to hold its top position in project build software, despite many younger competitors.The premise behind make is simple: after you change source files and want to rebuild your program or other output files, make checks timestamps to see what has changed and rebuilds just what you need, without wasting time rebuilding other files. But on top of this simple principle, make layers a rich collection of options that lets you manipulate multiple directories, build different versions of programs for different platforms, and customize your builds in other ways.This edition focuses on the GNU version of make, which has deservedly become the industry standard. GNU make contains powerful extensions that are explored in this book. It is also popular because it is free software and provides a version for almost every platform, including a version for Microsoft Windows as part of the free Cygwin project. Managing Projects with GNU make, 3rd Edition provides guidelines on meeting the needs of large, modern projects. Also added are a number of interesting advanced topics such as portability, parallelism, and use with Java.Robert Mecklenburg, author of the third edition, has used make for decades with a variety of platforms and languages. In this book he zealously lays forth how to get your builds to be as efficient as possible, reduce maintenance, avoid errors, and thoroughly understand what make is doing. Chapters on C++ and Java provide makefile entries optimized for projects in those languages. The author even includes a discussion of the makefile used to build the book.


Product Details

ISBN-13: 9780596552541
Publisher: O'Reilly Media, Incorporated
Publication date: 11/19/2004
Series: Nutshell Handbooks
Sold by: Barnes & Noble
Format: eBook
Pages: 302
File size: 2 MB

About the Author

Robert Mecklenburg began using Unix as a student in 1977 and has been programming professionally for 23 years. His make experience started in 1982 at NASA with Unix version 7. Robert received his Ph.D. in Computer Science from the Universityof Utah in 1991. Since then, he has worked in many fields ranging from mechanical CAD to bioinformatics, and he brings his extensive experience in C++, Java, and Lisp to bear on the problems of project management with make.

Table of Contents

Forewordxi
Prefacexiii
Part IBasic Concepts
1How to Write a Simple Makefile3
Targets and Prerequisites4
Dependency Checking6
Minimizing Rebuilds7
Invoking make7
Basic Makefile Syntax8
2Rules10
Explicit Rules10
Variables16
Finding Files with VPATH and vpath17
Pattern Rules21
The Implicit Rules Database25
Special Targets30
Automatic Dependency Generation31
Managing Libraries34
3Variables and Macros41
What Variables Are Used For42
Variable Types43
Macros45
When Variables Are Expanded47
Target- and Pattern-Specific Variables50
Where Variables Come From51
Conditional and include Processing54
Standard make Variables57
4Functions61
User-Defined Functions61
Built-in Functions64
Advanced User-Defined Functions80
5Commands88
Parsing Commands88
Which Shell to Use96
Empty Commands97
Command Environment98
Evaluating Commands99
Command-Line Limits100
Part IIAdvanced and Specialized Topics
6Managing Large Projects107
Recursive make108
Nonrecursive make117
Components of Large Systems124
Filesystem Layout126
Automating Builds and Testing128
7Portable Makefiles129
Portability Issues130
Cygwin131
Managing Programs and Files134
Working with Nonportable Tools137
Automake139
8C and C++141
Separating Source and Binary141
Read-Only Source149
Dependency Generation149
Supporting Multiple Binary Trees154
Partial Source Trees156
Reference Builds, Libraries, and Installers157
9Java159
Alternatives to make160
A Generic Java Makefile164
Compiling Java168
Managing Jars175
Reference Trees and Third-Party Jars177
Enterprise JavaBeans178
10Improving the Performance of make182
Benchmarking182
Identifying and Handling Bottlenecks186
Parallel make190
Distributed make194
11Example Makefiles196
The Book Makefile196
The Linux Kernel Makefile218
12Debugging Makefiles229
Debugging Features of make229
Writing Code for Debugging236
Common Error Messages241
Part IIIAppendixes
ARunning make249
BThe Outer Limits252
CGNU Free Documentation License-GNU Project-Free Software Foundation (FSF)263
Index271
From the B&N Reads Blog

Customer Reviews