Command Mode

Overview

Similar to make, the command line arguments are interpreted as targets name for hmake. In addition to that, hmake introduces a special type of targets - commands. When these targets are invoked, the command line arguments will be passed through to the target as arguments.

See File Format for details.

---
format: hypermake.v0

targets:
  build:
    description: build the source code
    cmds:
      - ./build.sh

commands:
  pack-for:
    description: pack for specified target
    after:
      - build
    cmds:
      - './pack.sh $1'

When invoke

hmake pack-for ubuntu

Will execute target pack-for and the rest of the command line is passed as arguments to the target. From HyperMake, it’s possible to reference the arguments, like $1, in command targets.

Restrictions

Command targets are special, with restrictions:

  • It can depends on normal targets, but can’t be a dependency;
  • It must be the first argument on hmake command line.