John Graham-Cumming
Member for
13 years 3 monthsJohn Graham-Cumming is Co-Founder at Electric Cloud, Inc . Prior to joining Electric Cloud, John was a Venture Consultant with Accel Partners, VP of Internet Technology at Interwoven, Inc. (IWOV), VP of Engineering at Scriptics Corporation (acquired by Interwoven), and Chief Architect at Optimal Networks, Inc. John holds BA and MA degrees in Mathematics and Computation and a Doctorate in Computer Security from Oxford University. John is the creator of the highly acclaimed open source POPFile project. He also holds two patents in network analysis and has others pending.
John Graham-Cumming is Co-Founder at Electric Cloud, Inc . Prior to joining Electric Cloud, John was a Venture Consultant with Accel Partners, VP of Internet Technology at Interwoven, Inc. (IWOV), VP of Engineering at Scriptics Corporation (acquired by Interwoven), and Chief Architect at Optimal Networks, Inc. John holds BA and MA degrees in Mathematics and Computation and a Doctorate in Computer Security from Oxford University. John is the creator of the highly acclaimed open source POPFile project. He also holds two patents in network analysis and has others pending.
All Articles by John Graham-Cumming
All Stories by John Graham-Cumming
| Learning GNU Make Functions with Arithmetic GNU Make has no built-in arithmetic capability. In this article, I present a collection of GNU Make macros that implement functions for addition, subtraction, multiplication, and division of integers. Functions are also provided for integer comparisons such as “greater than” and “not equal.” These macros are implemented entirely using GNU Make's built-in string manipulation functions. |
|
| Tips and Tricks From the Automatic Dependency Generation Masters Make's dependency syntax is flawed because it incorporates both foo.o must be updated if header.h, system.h or foo.c are changed and foo.o is the result of compiling foo.c. Thus, anything to the right of the : is a prerequisite, but the first prerequisite where there's a rule body (i.e. commands) is special: it's the prerequisite that will be passed to the compiler (or other command) to actually generate the target. |
|
| The Trouble with Hidden Targets Make programs are very good at keeping track of targets, files that need to be built, and the dependencies between targets. But the Make program is only as good as its inputs. If you don't tell Make about a relationship between two files, it wont discover it on its own and it'll make mistakes because it assumes it has perfect knowledge about the files and their relationships. |
|
| Tracing rule execution in GNU Make Who hasn't wondered what exactly Make's log file output means. This article is about Makefile tracing. I cover tracing the execution of Makefile rules. |
|
| Adding set operations to GNU Make The new GMSL functions include ways of testing the relationship between sets and determining whether an individual element is in a set. |
|
| The Basics: VPATH and vpath Ask Mr. Make talks about the uses of VPATH and vpath. |
|
| Learning Make with the Towers of Hanoi The Towers of Hanoi puzzle consists of a small board with three pegs on it. On the left most peg a stack of discs is arranged in descending order of size: the largest disc is on the bottom. |
|
| Make Clean: Usman's Law Usman's Law (named after a smart coworker of mine who spent months working with customer Makefiles). make clean is intended to take you back to a state where everything will be rebuilt from scratch. Often times it doesn't. Here's why. |
|
| GNU Make User-Defined Functions Creating GNU Make built-in functions is easy, but it does create a maintenance problem: the next time GNU Make is updated we'll need to port our changes to the new version. |
|
| The Pitfalls and Benefits of GNU Make Parallelization Many build processes run for hours with build managers commonly typing 'make' and going home for the night. GNU Make's solution to this problem is parallel execution, which is a simple command-line option that causes GNU Make to run jobs in parallel using the dependency in the Makefile to run in the correct order. |
|
| The Basics of GNU Make GNU Make user-defined functions can do a lot. Ask Mr. Make takes you on a quick your of the basics. |
|
| GNU Make path handling Ask Mr. Make discusses how GNU Make handles paths. |
|
| GMSL 1.09: A look inside the tweaks and updates I've written in the past about the GNU Make Standard Library open source project. This article outlines the changes made between v1.0.2 and the current release (v1.0.9) and discusses some of the techniques used to implement the GMSL. |
|
| Makefile Debugging: A introduction to remake remake forked from GNU Make 3.80 and is currently at version 0.62. This version incorporates some, but not all, of the changes made in GNU Make 3.81. |
|
| GNU Make Escaping: A Walk on the Wild Side Sometimes you find yourself needing to insert a special character in a Makefile: perhaps you need a newline inside a $(error) message, or a space character in a $(subst) or a comma as the argument to a GNU Make function. Those three simple things can be frustratingly hard in GNU Make; this article takes you through simple GNU Make syntax that removes the frustration. |
|
| Painless non-recursive Make In this article, Mr. Make outlines a pattern for non-recursive Make systems that supports the familiar make-anywhere style common to recursive Make systems. Typing make in a directory will build everything in that directory and below. |
|
| Atomic Rules in GNU Make This article looks at what to do if command updates more than one file, and how to express that so that GNU Make knows that more than one file was updated and behaves correctly. |
|
| Fast, Automatic Builds: the Agile Heartbeat I think that the person most affected by the introduction of agile or extreme programming techniques is not the software or quality assurance engineer, but the build manager. Agile techniques are a throwback to the age when developers were able to work on small projects in small teams. Each developer once again concentrates on small building blocks of code and integrates regularly with other developers to ensure that the overall software project is progressing. For developers, agile techniques are a natural fit because they reflect how developers like to work best: on small, manageable pieces of code with regular feedback. However, even though developers are working on small sections of code, their overall projects are now large and continually growing. And it's the large body of code that the build manager is expected to work with, not the manageable chunks. While daunting, this precipitous increase in builds can be managed by carefully implementing continuous integration and making fast, automatic builds the quot;heartbeatquot; of your agile development. |
|
| GNU Make meets file names with spaces in them Suppose you are faced with creating a Makefile that needs to deal with two files named foo bar and bar baz, with foo bar built from bar ba'. I've used italics to make clear that these are file names that include spaces. |
|
| Making an XML bill of materials in GNU Make In this article I present a simple technique that causes GNU Make to create a XML file containing a "bill of materials" or BoM. The BoM contains the names of all the files built by the Makefile and is nested to show the prerequisites of target. |
|
| The Basics: Getting environment variables into GNU Make The most basic rule of GNU Make and the environment is that any variable set in the environment when GNU Make is started will be available as a GNU Make macro inside the Makefile. |
|
| Makefile Optimization: $(eval) and macro caching The $(eval) function was introduced in GNU Make 3.80 but was a little buggy, 3.81 has fixed those bugs in $(eval) is ready for prime time. $(eval)'s argument is expanded and then parsed as if it were part of a Makefile. |
|
| Make: Sorting and Searching Ask Mr. Make covera two important topics for Makefile builders with a round up of techniques for sorting and searching inside Makefiles and on the file system. |
|
| Target-specific and Pattern-specific GNU Make macros This article introduces target- and pattern-specific variables and shows how they can be used to selectively alter options within a build based on the name of a target or targets being built. |
|
| Making directories in GNU Make This article looks at a variety of ways to achieve directory creation in GNU Make and points out a common trap for the unwary. |
|
| Rebuilding When a File's Checksum Changes In this article, Ask Mr. Make shows a simple hack to GNU Make to cause it to do the right thing when the contents of a source file change. |
|
| What's new in GNU Make 3.81 In this article, Ask Mr. Make covers what's new in GNU Make 3.81. |
|
| Rebuilding When CPPFLAGS Changes GNU Make has no way of detecting that some targets ought to be rebuilt, because it doesn't take into account changing the commands. If, for example DEBUG=1 causes the flags passed to the compiler to change then the target ought to be rebuilt. This article shows how, in a few lines of GNU Make code, to make that happen. |
|
| Dynamic Breakpoints in the GNU Make Debugger The most recent change (taking GMD from v1.0.0 to v1.0.1) is the addition of dynamic target breakpoints. At the GMD prompt it's now possible to set and remove breakpoints on the name of a file (in GNU Make language a target) that the Makefile will build. |
|
| Dumping Every Makefile Variable What if you want to print out every variable defined in a Makefile? In this tip I'm going to show you how and introduce GNU Make's powerful functions. |
|
| Setting a Makefile Variable From Outside the Makefile In this article, Ask Mr. Make talks about how to set Makefile variable from outside the Makefile. |
|
| Printing the Value of a Makefile Variable There aren't any debuggers for Make, and Make doesn't provide the sort of interactivity you'd see from a scripting language like Perl or Python. So what is an easy way to figure out the value of a variable? This simple Makefile does all the work for you. |
|
| Makefile Debugging: Tracing Macro Values Ask Mr. Make talks about how to trace macro values when debuggin makefiles. |
|
| An Interactive GNU Make Debugger The interactive GNU debugger has breakpoints, dumps information about the rule at which a breakpoint is hit and allows interactive querying of variable values and definitions. |
|
| Makefile Optimization: $(shell) and := go Together Ask Mr. Make discusses Makefile optimization: ow $(shell) and := go together. |
|
| Makefile Assertions Unfortunately, GNU Make does not have any form of assertions built in, but they are easy to create using existing GNU Make functions. |
|
| The Trouble with $(wildcard) $(wildcard) explained can be used anywhere in a Makefile or rule to get a list of files matching one or more glob style patterns. |
|
| Self-Documenting Makefiles < |
|
| What's New in GMSL 1.0.2 The GMSLThe GMSL is a library of functions to enhance GNU Make. It provides string and list functions, arithmetic operators, tracing facilities and even associative arrays. |
|
| The GNU Make Standard Library The GMSL contains functions for list and string manipulation, has a complete integer arithmetic library, and functions for data structures: there are GNU Make implementations of associative arrays and stacks. There are also built-in debugging facilities. |