colormake 0.1.2

A fast, lightweight tool to colorize make output for better readability.
.TH colormake 1 "December 2025"
.SH NAME
colormake \- color wrapper for make(1)
.SH SYNOPSIS
\fBcolormake\fR [ \fIOPTIONS\fR ] [ \fI--\fR ] [ \fIMAKE_ARGS\fR ... ]
.SH DESCRIPTION
\fBcolormake\fR acts as a wrapper around \fBmake\fR(1) to ease reading the output by
colorizing it. It recognizes make commands, compiler invocations (gcc, g++, clang,
rustc, cargo, CC, CXX, and libtool), errors, warnings, notes, filenames, and line
numbers, applying appropriate colors to each.

When invoked with stdin connected to a pipe or file (not a terminal), \fBcolormake\fR
processes the input stream and colorizes it accordingly. This allows piping make
output through colormake.

Colors are automatically enabled when output is to a terminal (TTY) and the \fBTERM\fR
environment variable is not set to "dumb" or "unknown". Colors can be explicitly
disabled with the \fB--no-color\fR option.

.SH OPTIONS
.TP
\fB--lines\fR \fIN\fR
Reserved for future use. Currently ignored.

.TP
\fB--cols\fR \fIN\fR
Set output width in columns. Lines longer than \fIN\fR columns (minus a small
adjustment for formatting) are truncated with a " .. " separator, preserving the
beginning and end of the line. If not specified, lines are not truncated.

.TP
\fB--no-color\fR
Disable color output. This overrides automatic terminal detection and forces
plain text output.

.TP
\fB--show-config\fR
Display the color scheme configuration with sample text for each color type, then
exit. Useful for verifying color settings.

.TP
\fB--show-make-version\fR
Execute the make command with \fB--version\fR and display its output, then exit.
Useful for verifying which make command will be used.

.TP
\fB--make-cmd\fR \fICMD\fR
Specify the make command to execute. Defaults to "make". This allows using
alternative make implementations such as "gmake" or "bmake".

.TP
\fB--help\fR
Display help message and exit.

.TP
\fB--version\fR
Display version information and exit.

.PP
All arguments after \fB--\fR or any unrecognized arguments are passed directly to
the make command.

.SH USAGE

To use colormake, simply replace \fBmake\fR with \fBcolormake\fR:

.EX
colormake
colormake clean
colormake -j4 install
colormake -- CFLAGS="-O2 -g"
.EE

You can also pipe make output through colormake:

.EX
make 2>&1 | colormake
make -j8 | colormake --cols 120
.EE

To change a Makefile to use colormake, you may change the shebang line at the top
which normally reads:

.EX
#!/usr/bin/make -f
.EE

to:

.EX
#!/usr/bin/colormake -f
.EE

.SH COLOR SCHEME

The default color scheme uses 24-bit RGB colors:

.TP
.B Make commands
Cyan (\fB\\033[38;2;136;192;208m\fR)

.TP
.B Compiler commands
Magenta bright (\fB\\033[38;2;180;142;173m\\033[1m\fR)
Recognizes: gcc, g++, clang, rustc, cargo, CC, CXX, and libtool prefixes

.TP
.B Filenames
Yellow (\fB\\033[38;2;235;203;139m\fR)

.TP
.B Line numbers
Cyan (\fB\\033[38;2;136;192;208m\fR)

.TP
.B Errors
Yellow bright (\fB\\033[38;2;235;203;139m\\033[1m\fR) with additional highlighting

.TP
.B Warnings
Green (\fB\\033[38;2;163;190;140m\fR)

.TP
.B Notes/Trace
Yellow (\fB\\033[38;2;235;203;139m\fR)

.TP
.B Default text
Light gray (\fB\\033[38;2;216;222;233m\fR)

.TP
.B Comments
Dark gray (\fB\\033[38;2;59;66;82m\fR)

Use \fB--show-config\fR to see the current color scheme with sample output.

.SH ENVIRONMENT

.TP
\fBTERM\fR
If set to "dumb" or "unknown", colors are automatically disabled even when
output is to a terminal.

.SH EXAMPLES

Build with colored output:

.EX
$ colormake
.EE

Build in parallel with colored output:

.EX
$ colormake -j8
.EE

Use gmake instead of make:

.EX
$ colormake --make-cmd gmake
.EE

Truncate long lines to 100 columns:

.EX
$ colormake --cols 100
.EE

Pipe make output through colormake:

.EX
$ make 2>&1 | colormake
.EE

Show color configuration:

.EX
$ colormake --show-config
.EE

Disable colors:

.EX
$ colormake --no-color
.EE

.SH FEATURES

\fBcolormake\fR includes several features for improved usability:

.B Automatic terminal detection
.RS
Colors are enabled automatically when appropriate, and disabled when output
is redirected to a file or pipe (unless explicitly enabled).
.RE

.B Multi-compiler support
.RS
Recognizes various compiler invocations including gcc, g++, clang, rustc,
cargo, CC, CXX, and libtool-wrapped commands.
.RE

.B Intelligent line truncation
.RS
Long lines are truncated with a " .. " separator, preserving both the
beginning and end of the line for context.
.RE

.B Whitespace normalization
.RS
Multiple consecutive spaces are collapsed to single spaces for cleaner output.
.RE

.B Buffered I/O
.RS
Uses efficient buffered I/O for better performance with large build outputs.
.RE

.SH EXIT STATUS

\fBcolormake\fR exits with the same status code as the underlying make command.
If make cannot be executed, it exits with status 127.

.SH SEE ALSO
\fBmake\fR(1)

.SH AUTHORS
Written by anhkhoakz.

This manual page was written for the Rust implementation of colormake, which is
a fast, lightweight rewrite of the original Perl-based colormake.

.SH LICENSE
This program is licensed under the GPL-3.0 license.