zmk.Script(5)

NAME
Script - template for describing interpreted scripts

SYNOPSIS

    include z.mk
    # scriptName is the name of the script file
    $(eval $(call ZMK.Expand,Program,scriptName))

DESCRIPTION
The template Script once expanded with a script name to creates rules for installing and removing a single script written in an interpreted programming language.

If the script is a shell script then it can be automatically checked with shellcheck, if available.

TARGETS
This module provides the following targets.

  install
This phony target copies $(scriptName) to $(scriptName.InstallDir), with the name $(scriptName.InstallName) and mode $(scriptName.InstallMode). The target directory is automatically created if required.

The variables Configure.ProgramPrefix, Configure.ProgramSuffix and Configure.ProgramTransformName automatically impact the installed names of all the scripts.

  uninstall
This phony target removes $(scriptName) as installed by the install target.

  static-check-shellcheck
This phony target uses shellcheck to perform static analysis of compatible scripts.

  static-check
This phony target depends on the target static-check-shellcheck.

VARIABLES
This module provides the following variables.

  $(scriptName).Interpreter
Name of the script interpreter.

The default value is inferred from the extension of the file name.

  $(scriptName).InstallDir
The directory $(scriptName) is installed to.

The default value is $(bindir). The special value noinst disables the rules related to installation and uninstallation.

  $(scriptName).InstallName
The name of the script after installation.

The default value is $(scriptName)

  $(scriptName).InstallMode
The UNIX mode $(scriptName) is installed with.

The default value is 0755.

  DESTDIR
Path added to all installation targets.

This variable is normally set externally, to install a compiled program into a staging area during construction of a compiled binary package.

IMPLEMENTATION NOTES
Script uses InstallUninstall to handle installation and removal.

HISTORY
The Script template first appeared in zmk 0.1

AUTHORS
Zygmunt Krynicki <me@zygoon.pl>