CCONTROL(1)
===========
Rusty Russell <rusty@rustcorp.com.au>
v0.3, 16 September 2005

NAME
----
ccontrol - wrapper to control distcc, ccache and more

SYNOPSIS
--------
'gcc' ...

'cc' ...

'c++' ...

'make' ...

'ld' ...

DESCRIPTION
-----------
The ccontrol(1) program takes over the roles of the compiler and
linker, and reads a configuration file to decide what to do before
invoking them.  This is particularly useful for centralized control
over commands and options, such as enabling distcc(1) and ccache(1).

When ccontrol(1) is invoked under its own name, it merely prints its
version and exits.  Versions are named after the last person to report
a bug.

CONFIGURATION FILE
------------------
ccontrol's configuration file is $HOME/.ccontrol/default.  If this
cannot be read (and written), your compilations will all fail.  It is
normal to have several different configuration files in this
directory, and make default a symbolic link.

SYNTAX
------
A configuration file consists of sections, led by a "[path]" header
and followed by indented "name = value" entries.  The first section is
usually labelled "[*]" to set up the defaults.  At the very least, you
must set the "cc", "c++", "make" and "ld" values.

ccontrol will read every section which matches the current directory,
so you can override values on a per-directory basis.  The "[path]"
header of each section is a shell-style wildcard (see glob(7)) which
indicates the directory or directories it applies to.  Usually this
will end in a "*" to include all subdirectories.

The following settings are available:
cc::
  Followed by '=' specifies the full path of the compiler to be
  invoked when ccontrol is invoked as "cc" or "gcc".  ccontrol will
  fail to compile C programs if this is not set.

c++::
  Followed by '=' specifies the full path of the compiler to be
  invoked when ccontrol is invoked as "c++" or "g++".  ccontrol will
  fail to compile C++ programs if this is not set.

ld::
  Followed by '=' specifies the full path of the linker to be invoked
  when ccontrol is invoked as "ld".  ccontrol will fail to link
  programs if this is not set.

make::
  Followed by '=' specifies the full path of the binary to be invoked
  when ccontrol is invoked as "make".  ccontrol will fail to make if
  this is not set.

ccache::
  Followed by '=' specifies the full path of "ccache", and indicates
  that ccache is to be used where appropriate.  If this is not set,
  or set to 'off', ccache will not be used.

distcc::
  Followed by '=' specifies the full path of "distcc", and indicates
  that distcc is to be used where appropriate.  If this is not set,
  or set to 'off', distcc will not be used.

distcc-hosts::
  Followed by '=' specifies the distcc servers to use, as per the
  DISTCC_HOSTS environment variable in distcc(1).

cpus::
  Followed by '=' and a number of CPUs, set to the number of CPUs you
  have (the default is "1").  'ccontrol' uses this to tune the degree
  of parallelism.

no-parallel::
  By itself, suppresses parallel make.  Followed by "=" and a
  space-separated list of wildcards, suppresses parallel make for any
  make target matching one of those.  This option is needed because
  ccontrol(1) usually forces make(1) to perform all actions in
  parallel, but this can be confusing when an error occurs, and breaks
  poorly-written makefiles.

include::
  Followed by '=' specifies a file to include at the current point.
  The effect is exactly as if the contents of the included file were
  literally inserted.  Can be used at file level to include sections.
  Can also be used within sections to include section fragments.

verbose::
  By itself, indicates that ccontrol(1) is to spit lots of crap out to
  standard error about what it's doing to your innocent command line.

BUGS
----
The .ccontrol/default file must be writable: ccontrol(1) needs to get
an exclusive write lock on it, which means it needs to open the file
for writing.  Use 'include' to include read-only files.

If your code doesn't compile, ccontrol can only make it not compile
faster.

AUTHOR
------
Written by Rusty Russell <rusty@rustcorp.com.au>

LICENSE
-------
Copyright (C) 2005 Rusty Russell.  Free use of this software is
granted under the terms of the GNU General Public License (GPL).

SEE ALSO
--------
make(1), cc(1), c++(1), ld(1), glob(7)
