Thanks to visit codestin.com
Credit goes to lib.rs

#make #terminal #cli

app colormake

A fast, lightweight tool to colorize make output for better readability

2 releases

Uses new Rust 2024

new 0.1.2 Dec 23, 2025
0.1.0 Dec 20, 2025

#421 in Command line utilities

GPL-3.0 license

68KB
615 lines

ColorMake

A fast, lightweight tool to colorize make output for better readability.

Demo Image

Installation

Using Cargo Install

cargo install colormake

Manual Installation

cargo build --release
install -m 755 target/release/colormake /usr/local/bin/

Or using the Makefile:

make build
make install

Uninstallation

Using Cargo Uninstall

cargo uninstall colormake

Manual Uninstallation

rm /usr/local/bin/colormake

Or using the Makefile:

make uninstall

Usage

Use colormake as a drop-in replacement for make:

# Basic usage - runs 'make' with colored output
colormake

# Pass arguments to make
colormake clean
colormake install
colormake -j4

# Use a different make command
colormake --make-cmd gmake

# Custom make arguments
colormake -- -j8 CFLAGS="-O2"

As a Pipe Filter

Pipe make output through colormake:

make 2>&1 | colormake
make -j4 | colormake

Options

  • --help: Show help message
  • --version: Show version information
  • --no-color: Disable color output (overrides automatic terminal detection)
  • --cols N: Set output width (columns). Long lines are truncated with " .. " separator
  • --lines N: Number of lines to display (reserved for future use)
  • --show-config: Display color scheme configuration
  • --make-cmd CMD: Specify make command to execute (default: "make")
  • Trailing arguments: Passed directly to make command

Automatic Features

  • Terminal Detection: Colors are automatically enabled when output is to a terminal (TTY) and TERM is not "dumb" or "unknown"
  • stdout/stderr Merging: Both standard output and error streams are merged and colorized together
  • Whitespace Normalization: Multiple spaces are collapsed to single spaces for cleaner output

Examples

# Standard build with colors
colormake

# Parallel build
colormake -j8

# Build with custom flags
colormake -- CFLAGS="-g -O2"

# Disable colors
colormake --no-color

# Show color scheme
colormake --show-config

# Use with gmake
colormake --make-cmd gmake

Features

  • Fast: Uses regex-lite and buffered I/O for performance
  • Type-safe: Uses enums instead of string matching
  • Error handling: Proper error propagation
  • Zero dependencies: Only uses regex-lite and clap
  • Multi-compiler Support: Recognizes gcc, g++, clang, rustc, cargo, CC, CXX, and libtool prefixes
  • Smart Line Truncation: Long lines are intelligently truncated with prefix and suffix preservation
  • Automatic Terminal Detection: Enables colors only when appropriate

Color Scheme

  • Make commands: Cyan
  • Compiler commands: Magenta (bright) - supports gcc, g++, clang, rustc, cargo, CC, CXX, and libtool
  • Filenames: Yellow
  • Line numbers: Cyan
  • Errors: Yellow (bright) with highlighting
  • Warnings: Green
  • Notes: Yellow

Development

The project includes a Makefile for common development tasks:

# Run tests
make test

# Build release binary (runs tests first)
make build

# Install to /usr/local/bin (requires sudo)
make install

# Uninstall from /usr/local/bin (requires sudo)
make uninstall

# Clean build artifacts
make clean

Acknowledgments

This initiative expands on the efforts of:

License

This project is licensed under the GPL-3.0 license. See the LICENSE file for details.

Dependencies

~1.3–2MB
~33K SLoC