Program to re-run, eg, `make` when files are modified?

makefile

Solution

For simple things, rerun could be a good fit: http://pypi.python.org/pypi/rerun

"Command-line executable Python script to re-run the given command every time files are modified in the current directory or its subdirectories."

It requires a Python interpreter, but does not care if your command or files are written in Python.

Usage

rerun [--help|-h] [--verbose|-v] [--ignore|-i=<file>] [--version] <command>
Where:

<command>           Command to execute
--help|-h           Show this help message and exit.
--ignore|-i=<file>  File or directory to ignore. Any directories of the
                    given name (and their subdirs) are excluded from the
                    search for changed files. Any modification to files of
                    the given name are ignored. The given value is
                    compared to basenames, so for example, "--ignore=def"
                    will skip the contents of directory "./abc/def/" and
                    will ignore file "./ghi/def". Can be specified multiple
                    times.
--verbose|-v        Display the names of changed files before the command
                    output.
--version           Show version number and exit.

Problem

Is there a program that will automatically re-run, eg, `make`, when files are modified? For example, when I'm writing `sphinx` documentation, it would be nice if `make html` was run automatically each time I edit any relevant files.

Original source

Related problems