Preface |
|
xv | |
|
|
1 | (42) |
|
Getting Environment Variables into GNU make |
|
|
1 | (2) |
|
Setting Variables from Outside the Makefile |
|
|
3 | (3) |
|
The Environment Used by Commands |
|
|
6 | (1) |
|
|
7 | (2) |
|
Target-Specific and Pattern-Specific Variables |
|
|
9 | (4) |
|
Target-Specific Variables |
|
|
10 | (1) |
|
Pattern-Specific Variables |
|
|
11 | (2) |
|
|
13 | (3) |
|
|
13 | (1) |
|
|
14 | (2) |
|
|
16 | (1) |
|
|
16 | (3) |
|
Undefined Variables in Conditionals |
|
|
17 | (1) |
|
|
18 | (1) |
|
Logical Operations Using Boolean Values |
|
|
19 | (2) |
|
User-Defined Logical Operators |
|
|
19 | (1) |
|
Built-in Logical Operators (GNU make 3.81 and Later) |
|
|
20 | (1) |
|
|
21 | (1) |
|
Delayed Variable Assignment |
|
|
22 | (2) |
|
|
24 | (1) |
|
|
25 | (4) |
|
|
26 | (1) |
|
Argument-Handling Gotchas |
|
|
26 | (1) |
|
Calling Built-in Functions |
|
|
27 | (2) |
|
Recent GNU make Versions: 3.81, 3.82, and 4.0 |
|
|
29 | (14) |
|
What's New in GNU make 3.81 |
|
|
29 | (5) |
|
What's New in GNU make 3.82 |
|
|
34 | (4) |
|
What's New in GNU make 4.0 |
|
|
38 | (4) |
|
What's New in GNU make 4.1 |
|
|
42 | (1) |
|
|
43 | (34) |
|
Printing the Value of a Makefile Variable |
|
|
43 | (2) |
|
Dumping Every Makefile Variable |
|
|
45 | (2) |
|
|
47 | (4) |
|
|
47 | (1) |
|
How the Variable Tracer Works |
|
|
48 | (3) |
|
|
51 | (4) |
|
|
51 | (1) |
|
|
52 | (1) |
|
An Even Smarter SHELL Hack |
|
|
53 | (1) |
|
|
54 | (1) |
|
|
55 | (3) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
57 | (1) |
|
An Interactive GNU make Debugger |
|
|
58 | (7) |
|
|
58 | (2) |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
62 | (3) |
|
Dynamic Breakpoints in the GNU make Debugger |
|
|
65 | (4) |
|
Dynamic Breakpoints in Action |
|
|
65 | (2) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
69 | (1) |
|
An Introduction to remake |
|
|
69 | (8) |
|
|
69 | (3) |
|
|
72 | (2) |
|
Targets, Macro Values, and Expansion |
|
|
74 | (3) |
|
3 Building And Rebuilding |
|
|
77 | (32) |
|
Rebuilding When CPPFLAGS Changes |
|
|
77 | (5) |
|
|
78 | (1) |
|
Changing Our Example Makefile |
|
|
79 | (2) |
|
|
81 | (1) |
|
|
82 | (1) |
|
Rebuilding When a File's Checksum Changes |
|
|
82 | (4) |
|
|
83 | (1) |
|
|
83 | (1) |
|
|
84 | (1) |
|
|
85 | (1) |
|
|
86 | (1) |
|
Automatic Dependency Generation |
|
|
86 | (6) |
|
|
87 | (1) |
|
Makedepend and make depend |
|
|
88 | (1) |
|
Automating makedepend and Removing make depend |
|
|
89 | (1) |
|
Making Deleted Files Disappear from Dependencies |
|
|
90 | (1) |
|
Doing Away with makedepend |
|
|
91 | (1) |
|
|
92 | (1) |
|
|
92 | (4) |
|
|
93 | (1) |
|
|
93 | (1) |
|
|
94 | (2) |
|
Painless Non-recursive make |
|
|
96 | (13) |
|
|
97 | (1) |
|
A Flexible Non-recursive make System |
|
|
98 | (5) |
|
Using the Non-recursive make System |
|
|
103 | (1) |
|
|
104 | (5) |
|
|
109 | (52) |
|
GNU make Gotcha: ifndef and ?= |
|
|
110 | (1) |
|
|
110 | (1) |
|
|
111 | (1) |
|
$(shell) and := Go Together |
|
|
111 | (4) |
|
|
111 | (1) |
|
The Difference Between = and := |
|
|
112 | (1) |
|
|
113 | (2) |
|
$(eval) and Variable Caching |
|
|
115 | (5) |
|
|
115 | (1) |
|
|
116 | (1) |
|
|
116 | (1) |
|
Speed Improvements with Caching |
|
|
117 | (1) |
|
|
118 | (1) |
|
|
119 | (1) |
|
The Trouble with Hidden Targets |
|
|
120 | (2) |
|
An Unexpected Error if the Hidden Target Is Missing |
|
|
121 | (1) |
|
|
121 | (1) |
|
You Can't Parallelize make |
|
|
121 | (1) |
|
Make Does the Wrong Work if the Hidden Target Is Updated |
|
|
122 | (1) |
|
You Can't Direct make to Build foo.o |
|
|
122 | (1) |
|
GNU make's Escaping Rules |
|
|
122 | (5) |
|
|
123 | (1) |
|
|
123 | (1) |
|
|
123 | (1) |
|
|
124 | (1) |
|
|
124 | (1) |
|
|
124 | (1) |
|
Function Arguments: Spaces and Commas |
|
|
125 | (1) |
|
|
126 | (1) |
|
The Trouble with $(wildcard) |
|
|
127 | (4) |
|
|
127 | (1) |
|
|
128 | (2) |
|
Unexpected Results Explained |
|
|
130 | (1) |
|
|
131 | (6) |
|
|
132 | (1) |
|
|
132 | (1) |
|
Solution 1 Build the Directory When the Makefile Is Parsed |
|
|
133 | (1) |
|
Solution 2 Build the Directory When all Is Built |
|
|
134 | (1) |
|
Solution 3 Use a Directory Marker File |
|
|
134 | (1) |
|
Solution 4 Use an Order-Only Prerequisite to Build the Directory |
|
|
135 | (1) |
|
Solution 5 Use Pattern Rules, Second Expansion, and a Marker File |
|
|
136 | (1) |
|
Solution 6 Make the Directory in Line |
|
|
137 | (1) |
|
GNU make Meets Filenames with Spaces |
|
|
137 | (4) |
|
|
137 | (1) |
|
|
138 | (2) |
|
Turn Spaces into Question Marks |
|
|
140 | (1) |
|
|
140 | (1) |
|
|
141 | (6) |
|
|
142 | (1) |
|
|
142 | (1) |
|
Lists of Paths in VPATH and vpath |
|
|
143 | (1) |
|
|
143 | (1) |
|
Windows Oddity: Case Insensitive but Case Preserving |
|
|
144 | (1) |
|
Built-in Path Functions and Variables |
|
|
145 | (1) |
|
Useful Functions in 3.81: abspath and realpath |
|
|
146 | (1) |
|
|
147 | (1) |
|
|
147 | (1) |
|
|
147 | (1) |
|
|
148 | (1) |
|
|
148 | (1) |
|
Pitfalls and Benefits of GNU make Parallelization |
|
|
148 | (9) |
|
|
149 | (1) |
|
|
150 | (1) |
|
The Hidden Temporary File Problem |
|
|
151 | (2) |
|
The Right Way to Do Recursive make |
|
|
153 | (1) |
|
Amdahl's Law and the Limits of Parallelization |
|
|
154 | (3) |
|
Making $(wildcard) Recursive |
|
|
157 | (1) |
|
|
158 | (3) |
|
|
161 | (26) |
|
|
161 | (9) |
|
|
162 | (3) |
|
Multiplication and Division |
|
|
165 | (2) |
|
Using Our Arithmetic Library: A Calculator |
|
|
167 | (3) |
|
Making an XML Bill of Materials |
|
|
170 | (4) |
|
An Example Makefile and BOM |
|
|
170 | (1) |
|
|
171 | (1) |
|
|
172 | (2) |
|
Advanced User-Defined Functions |
|
|
174 | (5) |
|
Getting Started Modifying GNU make |
|
|
174 | (2) |
|
Anatomy of a Built-in Function |
|
|
176 | (1) |
|
|
177 | (2) |
|
GNU make 4.0 Loadable Objects |
|
|
179 | (1) |
|
|
180 | (2) |
|
Self-Documenting Makefiles |
|
|
182 | (5) |
|
Documenting Makefiles with print-help |
|
|
185 | (1) |
|
The Complete help-system.mak |
|
|
185 | (2) |
|
6 The GNU Make Standard Library |
|
|
187 | (38) |
|
|
188 | (1) |
|
|
189 | (1) |
|
Checking the GMSL Version |
|
|
189 | (1) |
|
Example Real-World GMSL Use |
|
|
190 | (6) |
|
Case-Insensitive Comparison |
|
|
190 | (1) |
|
Finding a Program on the Path |
|
|
190 | (1) |
|
Using Assertions to Check Inputs |
|
|
191 | (1) |
|
|
192 | (1) |
|
|
193 | (1) |
|
Using Logical Operators in the Preprocessor |
|
|
193 | (1) |
|
Removing Duplicates from a List |
|
|
194 | (1) |
|
Automatically Incrementing a Version Number |
|
|
194 | (2) |
|
|
196 | (29) |
|
|
196 | (2) |
|
Integer Arithmetic Functions |
|
|
198 | (5) |
|
Integer Comparison Functions |
|
|
203 | (1) |
|
Miscellaneous Integer Functions |
|
|
204 | (1) |
|
List Manipulation Functions |
|
|
205 | (5) |
|
String Manipulation Functions |
|
|
210 | (3) |
|
Set Manipulation Functions |
|
|
213 | (3) |
|
|
216 | (2) |
|
|
218 | (2) |
|
|
220 | (1) |
|
Miscellaneous and Debugging Facilities |
|
|
221 | (2) |
|
|
223 | (2) |
Index |
|
225 | |