zmk.Silent - Man Page

module for supporting silent rules

Synopsis

include z.mk
$(eval $(call ZMK.Import,Silent))

Description

The Silent module, once imported, provides functions and variables for supporting silent rules. Silent rules are a configuration option, trading precision of the exact commands used by the build system, for better visibility of warnings and other output. When enabled, actual commands executed by Make are hidden and a symbolic representation replaced with a symbolic representation devoid of details.

Silent rules are usually a configuration option of a specific build workspace. To enable, execute the configure script with the option --enable-silent-rules.

Targets

This module does not provide any targets.

Variables

This module provides the following variables.

Silent.Active

The global silent mode toggle. Any non-empty value enables silent rules. This is automatically configured by the Configure module.

Silent.Command

Expands to @ when silent rules are active. Can be placed in front of commands of a make rule to cause make not to echo the command itself. It should be paired with Silent.Say for the complete experience.

Silent.Say

Function expanding to a shell command printing the 1st and 2nd argument. The first argument should be the symbolic name of the tool, such as CC or LD. The second argument should be the resulting file, i.e. $@.

Examples

A hypothetical rule for compiling .foo files to .fooobj files, supporting silent rules, might look like this.

include z.mk
$(eval $(call ZMK.Import,Silent))

%.fooobj: %.foo
    $(eval $(call Silent.Say,FOOCC,$@))
    $(Silent.Command)foocc -c $^ -o $@

History

The Silent module first appeared in zmk 0.4

Authors

Zygmunt Krynicki <me@zygoon.pl>

Info

October 21, 2020