Table Of Contents

Previous topic


This Page

GNU Make Guide

This document provides a few pointers on GNU Make - see the make documentation for the whole story.

Make Targets

Make is invoked with the name (or names) of the target(s) that you want to build:

make test


make test metrics

Make Variables

Some make targets have required and/or optional variables that affect the target’s behaviour.

Make variables may be either passed on the command line or set in the environment.

  1. Passing a variable to make:

    make test ARGS=--verbosity=2
  2. Setting a variable in your environment:

    export ARGS=--verbosity=2
    make test


Once you set an environment variable it persists until it is unset or the session ends. This introduces the risk that you may set an environment variable and forget that you have done so which is a potential minefield.

Dry Run

Passing the “-n” flag to make tells it to print commands but not execute them:

make -n test